Batch Calls

Suggestion

Before reading this tutorial you should be familiar with Making API Calls.

Batch calls allow API applications to make multiple API calls within a single API call. In addition, each call can be tied to a different access_token meaning batch API calls work with multiple users.

Tip

The maximum number of API calls that you can make in a single batch call is 50. In addition, you can make these calls without being throttled.


Create a batch object

To create a batch object, make the /batch/create call.

Arguments:

 

Parameter Required Type Description
client_id Yes Integer (64 bits) The ID for your API application. You can find it on your application's dashboard.
client_secret Yes String (255 chars) The secret for your API application. You can find it on your application's dashboard.
calls Yes Array of API calls An array of the API calls that you would like to make (see API call arguments below).

 

Within each index of the calls parameter, each API call has its own separate structure as follows:

Tip

You must pass access_token for each call. For each individual API call, you must pass the access_token of the user you are making the call on behalf of. If you do not, then you will you get an access_denied error with error code 1002.

API call arguments:

 

Parameter Required Type Description
call Yes String (255 chars) The name of the API call you want to make (ie. /checkout/find).
authorization Yes if the API call requires authorization String (255 chars) The access token of the user that is making the API call.
reference_id No String (255 chars) A unique id that you can attach to an API call so that you can specifically identify that call.
parameters Only if the API call requires parameters Array The parameters required by the API call that you specified in the "call" parameter.

 

  • PHP
  • cURL
  • Ruby
  • Python

Response

 

Response Type Description
calls array An array of responses to all the API calls made in the batch call.

 


Complete the Batch Call

You now have the responses to all the batch calls you made in the calls response object. Now, you can make multiple API calls at once, enjoy!