Account-Switch and Payments
Here is an example of how account switch and payment jobs could be handled
Job Code | Job Type / Scope | Purpose | Input | What it returns |
---|---|---|---|---|
Write (Inject fields) | Authenticate with the external service and obtain an access token. |
|
| |
Read (Retrieve data as JSON) | Retrieve the user's current balance. |
|
| |
Read (Retrieve data as JSON) | List available payment methods for the user. |
|
| |
Write (Inject fields) | Make a payment. |
|
| |
Write (Inject fields) | Add a new |
|
| |
Write (Trigger action) | End the session |
|
NOTES ABOUT THE ENDPOINT
The main endpoint that will be called is /api/v1/jobs/submit
.This endpoint will allow you to submit a job. When calling the endpoint through our API, the results of the job are delivered via webhooks.
To use the API, you'll need to choose a Job Code according to your needs (see table). For example, if you are trying to make a connection to a provider, you would use the Job Code "EnsureConnection". If you are trying to make a payment, you would use the Job Code "MakePayment".
You will then need to provide the request parameters required for the endpoint to do its work. This input is different for every type of Job you are trying to accomplish. For example, if you are trying to make a payment, you will require the access token returned by the webhook during your initial connection, input the amount you are going to pay, and choose the payment method you will be using.
Once all the parameters are filled-in, the endpoint will do the rest!
IMPORTANT: If you try to perform a Job while another one is already in progress on the same account, it will be automatically blocked, and an error message will be displayed with the Job_Id that is already running.
In this case, the endpoint will return a 409 response that looks like this:
{
"job_id": "b35aa2af-41e4-4833-95c9-9efd2069e70c",
"message": "Job b35aa2af-41e4-4833-95c9-9efd2069e70c is already running"
}
Updated about 14 hours ago