In this topic:

Payment Retry Jobs

The Dunning Payment Retry functionality requires creating two jobs: one for starting the retry process and another one for updating it. To create a job, first, you must retrieve the associated job types for your job.

Retrieving job types

To retrieve a list of job types, use the following endpoint with the “component_name” query parameter set to “PAYRETRY”:

GET https://example-jss.gotransverse.com/jss/2/job-type?component_name=PAYRETRY

Response

[
{
  "id": "15da955f-3fa6-41c7-8d0c-f9492b4cfd34",
  "name": "Payment Retry Processor",
  "description": "Payment Retry Processor",
  "component_name": "PAYRETRY",
  "job_properties_template": [
  {
      "key": "payment_retry_schedule_code",
      "value": "payment_retry_schedule_code",
      "label": "Payment Retry Schedule Code",
      "data-type": "text",
      "properties": [],
      "default-value": null
  }
  ],
  "run_properties_template": [],
  "type_properties": []
},
{
  "id": "7c19c870-580a-4f44-89db-eb89142293e2",
  "name": "Payment Retry Updater",
  "description": "Payment Retry Updater",
  "component_name": "PAYRETRY",
  "job_properties_template": [],
  "run_properties_template": [],
  "type_properties": []
}
]

In the response body, there are two job types with the PAYRETRY component name:

"name": "Payment Retry Processor"
"id": "15da955f-3fa6-41c7-8d0c-f9492b4cfd34"

Used for creating the Payment Retry Processor job.
"name": "Payment Retry Updater"
"id": "7c19c870-580a-4f44-89db-eb89142293e2"
Used for creating the Payment Retry Updater job.

Creating a Payment Retry Processor job

To create a Payment Retry job, in the request body, specify the ID of the job type to base you job on, enter the name, description, status of the job, and desired Cron configurations.

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

Request

{
  "job_type_id": "15da955f-3fa6-41c7-8d0c-f9492b4cfd34",
  "name": "Payment Retry",
  "description": "additional information on the job",
  "job_status": "ACTIVE",
  "can_run_manual": true,
  "job_property_values": [
   {
	  "key": "payment_retry_schedule_code",
	  "value": "123"
   }
]
}

Response

{
  "id": "5e4fc775-b008-4ab9-b9f6-284ea0c47c9d",
  "job_type_id": "15da955f-3fa6-41c7-8d0c-f9492b4cfd34",
  "name": "Payment Retry",
  "description": "additional information on the job",
  "job_status": "ACTIVE",
  "cron_expression": null,
  "git_project_branch": null,
  "can_run_manual": true,
  "job_property_values": [
   {
	  "key": "payment_retry_schedule_code",
	  "value": "123"
   }
]
}

Creating a Payment Retry Updater job

To create a Payment Retry Updater job, in the request body, specify the ID of the job type to base our job on, enter the name, description, the status of the job, and desired Cron configurations.

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

Request

{
  "job_type_id": "7c19c870-580a-4f44-89db-eb89142293e2",
  "name": "Updater",
  "description": "additional information on the job",
  "job_status": "ACTIVE",
  "can_run_manual": true
}

Response

{
  "id": "e0315287-8520-475c-860a-73f5c4064c44",
  "job_type_id": "7c19c870-580a-4f44-89db-eb89142293e2",
  "name": "Updater",
  "description": "additional information on the job",
  "job_status": "ACTIVE",
  "cron_expression": null,
  "git_project_branch": null,
  "can_run_manual": true,
  "job_property_values": []
}

Running the job

To run the job, use the following endpoint and specify the job ID.

Note: If you specified the cron_expression parameter when creating a job, it will be run automatically at the time you specified.

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

Request

{
  "job_id": "5e4fc775-b008-4ab9-b9f6-284ea0c47c9d",
  "run_type": "MANUAL"
}

Response

{
  "job_id": "5e4fc775-b008-4ab9-b9f6-284ea0c47c9d",
  "run_type": "MANUAL",
  "run_at": "2018-10-30T12:13:17.276Z",
  "run_property_values": [],
  "id": "e09ea541-a4da-4d66-a2a7-54d9b4081a32",
  "friendly_id": "2973940",
  "latest_state": {
     "job_id": "5e4fc775-b008-4ab9-b9f6-284ea0c47c9d",
     "job_run_id": "e09ea541-a4da-4d66-a2a7-54d9b4081a32",
     "state": "created",
     "state_by": "test_user",
     "state_info": [],
     "id": "1d57ec96-c880-4fce-9066-882c564e8e93",
     "state_date": "2018-10-30T12:13:17.279343Z"
},
  "job": {
     "id": "5e4fc775-b008-4ab9-b9f6-284ea0c47c9d",
     "job_type_id": "15da955f-3fa6-41c7-8d0c-f9492b4cfd34",
     "name": "Payment Retry",
     "description": "additional information on the job",
     "job_status": "ACTIVE",
     "cron_expression": null,
     "git_project_branch": null,
     "can_run_manual": true,
     "job_property_values": [
      {
         "key": "payment_retry_schedule_code",
          "value": "your_sample_code"
     }
  ]
},
  "type_properties": [],
  "component_name": "PAYRETRY"
}

Retrieving details about the job

To see the details about the specified job run, use the following endpoint:

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

Top