Skip to main content

Bulk / Batch Requests

Batch requests allow developers to avoid multiple HTTP round-trips when performing multiple API actions or bulk uploading data to ChargeOver.

The basic format of an API batch request is a list of JSON-encoded request objects to process. Each request object must have the following attributes:

AttributeDescription

request_method

This HTTP request method for this request

  • GET to retrieve/query for objects
  • POST to create new objects
  • PUT to update existing objects

uri

A relative URI for the API resource. For example, to get a specific customer, the URI would be /api/v3/customer/2 (where 2 is the customer_id). To create a customer, the URI would be /api/v3/customer.

payload

If your request requires a payload, put the JSON-encoded payload here. For example, to create a customer, you'd pass in your JSON-encoded customer object.

The API response will contain a corresponding list of response objects - one response object for each request you sent. Each response object will have the following attributes:

AttributeDescription

code

A HTTP status code for the request.

  • 200 for an OK response to gets, queries, etc.
  • 201 for an OK response to something newly created
  • 400 for bad requests
  • See the HTTP Status Codes section for complete details

status

Either OK for success, or Error if an error occurred.

message

If an error occurred, the error message will appear here.

response

If your request warrented a response (e.g. a returned object) the JSON-encoded response will be here.

There is a maximum of 25 requests within a single batch/bulk request.