In this topic:

Creating a scheduled job

JSS (known as Scheduler in the Gotransverse UI) provides a way to create a scheduled job for evaluating billing accounts against the specified Dunning Plan. To create a new scheduled job, retrieve the available dunning job type and base your new job on it.

Note: For creating and scheduling a job with API, use the JSS URL provided to you by goTransverse.

Retrieving job types

Query the job type with the DUNNING component name and note its ID.

GET http://example-jss.gotransverse.com/jss/2/job-type?component_name=DUNNING

Response

[
{
  "id": "65817660-c18d-4565-a3ce-13c763a0ef58",
  "name": "Dunning Processor",
  "description": "Dunning Processor",
  "component_name": "DUNNING",
  "job_properties_template": [
   {
      "key": "acct_category",
      "value": "acct_category",
	  "label": "Account Category",
	  "data-type": "acct_category",
	  "properties": [],
	  "default-value": null
   } 
],
  "run_properties_template": [],
  "type_properties": []
]

Creating a job

In the request payload, specify the ID of job type to base your job on, the way is will be run, and details about the account category to which the billing account associated with dunning belongs to.

POST http://example-jss.gotransverse.com/jss/2/job

Request

{
  "job_type_id": "cf26b558-6525-4f58-abe1-5fe4222c1ad2",
  "name": "job for dunning",
  "description": "additional information on the job",
  "job_status": "ACTIVE",
  "git_project_branch": "string",
  "can_run_manual": true,
  "job_property_values": [
{
     "key": "acct_category",
	 "value": "770"
}
]
}

Response

{
  "id": "8ef79411-a3ca-4ac4-9c57-e6721b2ac61f",
  "job_type_id": "65817660-c18d-4565-a3ce-13c763a0ef58",
  "name": "job for dunning",
  "description": "additional information on the job",
  "job_status": "ACTIVE",
  "cron_expression": null,
  "git_project_branch": "string",
  "can_run_manual": true,
  "job_property_values": [
  {
      "key": "acct_category",
	  "value": "770"
  }
]
}

Running the job

To start the dunning evaluation, run the created job:

POST http://example-jss.gotransverse.com/jss/2/job/{job-id}/job-run

Request

{
  "job_id": "8ef79411-a3ca-4ac4-9c57-e6721b2ac61f",
  "run_type": "MANUAL"
}

Response

{
  "job_id": "8ef79411-a3ca-4ac4-9c57-e6721b2ac61f",					
  "run_type": "MANUAL",
  "run_at": "2018-10-25T11:45:34.961Z",
  "run_property_values": [],
  "id": "83694490-6d51-4dad-beaf-52d6050b4cd2",
  "friendly_id": "2973355",
  "latest_state": {
       "job_id": "8ef79411-a3ca-4ac4-9c57-e6721b2ac61f",
       "job_run_id": "83694490-6d51-4dad-beaf-52d6050b4cd2",
       "state": "created",
       "state_by": "multi-entity",
       "state_info": [],
       "id": "40272732-a9b1-4ad8-b966-18fc526cea58",
       "state_date": "2018-10-25T11:45:34.964282Z"
},
  "job": {
       "id": "8ef79411-a3ca-4ac4-9c57-e6721b2ac61f",
       "job_type_id": "65817660-c18d-4565-a3ce-13c763a0ef58",
       "name": "job for dunning",
       "description": "additional information on the job",
       "job_status": "ACTIVE",
       "cron_expression": null,       
	   "git_project_branch": "string",
       "can_run_manual": true,
       "job_property_values": [
	    {
	       "key": "acct_category",
		   "value": "770"
        }
   ]
},
  "type_properties": [],
  "component_name": "DUNNING"
}
Top