Endpoint

The Endpoint

The main endpoint that will be called is /api/v1/jobs/submit.
This endpoint will allow you to submit a job -- a task, in other terms. When calling the endpoint through our API, the results of the job are delivered via Webhooks. You can then use those results to execute other jobs, which will return their own data. This back and forth will allow you to communicate with the platforms to achieve a wide array of jobs.

To use the API, you'll need to choose a Job Code according to your needs. For example, if you are trying to make a connection to a platform, you would use the Job Code "EnsureConnection". If you are trying to make a payment, you would use the Job Code "MakePayment".

It will look like this:

curl --location 'https://live.deck.co/api/v1/jobs/submit' \	
--header 'x-deck-client-id: f6ae3546-3729-47a4-55f3-08dd0r9defea' \       
--header 'x-deck-secret: fe007096-63bd-4566-cb19-08dd8d9df017' \							
--header 'Content-Type: application/json' \
--data '{
  "job_code": "MakePayment",							
  "input": {
    "access_token": "access-production-b7dbff48-ed10-4eeb-4789-08dd6b7k00m8",		
    "account_id": "123456789",	
    "amount": 10.00,											
    "payment_method_id": "pm-0001"				
	}
}

All supported Job Codes and code snips are available in the Links you create in the Links page of your Dashboard.

The 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, choose the account ID from which to make the payment, 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!

Here is an example of a webhook response for the job FetchBalance, which returns the balance of an account.

{
  "job_guid": "b35aa2af-41e4-4833-95c9-9efd2069e70c",
  "output": {
    "balance": 34.50
  },
  "webhook_type": "Job",
  "webhook_code": "FetchBalance",
  "environment": "Production"
}