Run multiple calls
POST/api/v1/batch
Up to 500 calls in one, in sequence. Useful for importing history: customers, products and orders.
Each operation is an ordinary call under /api/v1 – method, path and body – and is checked and run exactly as if it had been sent on its own: with the key's scopes and the same errors. The responses come in the same order, with the status and body for each one. An operation that fails does not stop the others.
The whole batch counts as one call towards the per-minute limit, but at most 20 batches per minute per key. Upsert with PUT makes it safe to rerun an interrupted batch; with Idempotency-Key, a resent batch gets the same response without being run again.
Scope
All valid keys.
Body
JSON, Content-Type: application/json. Unknown fields return 422.
operationsarray<object>required- The operations (at most 500), which are run in sequence.at least 1 · at most 500
operations[].methodstringrequiredGETPOSTPUTPATCHDELETEoperations[].pathstringrequired- The path under /api/v1, with the query string if the call has one.at least 1 characters · at most 2048 characters
operations[].bodyobject<optional>- The request body, as a JSON object.
Retrying a request
Feel free to send the Idempotency-Key header (e.g. a UUID). If the same request is sent again with the same key within 24 hours, the first response is returned, without anything being done twice. Batch and idempotency
Response
200 The responses, in the same order as the operations.
resultsarray<object>requiredresults[].statusintegerrequired- The operation's HTTP status.
results[].bodyoptionalrequired- The operation's response: the usual response, an error (problem+json) or null (204).
succeededintegerrequiredfailedintegerrequired
Errors
- 400
- bad_request
- 429
- rate_limited