Errors
How failed requests look, and the limits the API enforces.
Errors from the API handler return an HTTP status and a JSON body. A request rejected before it reaches the handler, such as malformed JSON, can get a plain-text response.
{
"code": "NOT_FOUND",
"message": "Order not found",
"data": {}
}codeis the kind of error. Branch on it, or on the status.messagesays what went wrong, for a person to read. It can change, so don't parse it.datais optional. When a request fails validation,data.issueslists each problem with itspathandmessage. The response also includes the same list as a top-levelissuesfield.
Statuses
| Status | code | Meaning |
|---|---|---|
400 | BAD_REQUEST | The request failed validation, or breaks one of the endpoint's rules. |
401 | UNAUTHORIZED | The API key is missing, invalid or revoked. |
404 | NOT_FOUND | The endpoint or requested resource could not be found. |
409 | CONFLICT | The request clashes with something that already exists or is still happening, such as a duplicate name or images that are still processing. |
415 | UNSUPPORTED_MEDIA_TYPE | The endpoint expects a JSON body. Send it with Content-Type: application/json. |
429 | TOO_MANY_REQUESTS | You hit the rate limit. |
500 | INTERNAL_SERVER_ERROR | Something went wrong on our side. |
Any endpoint can return 401, 429 or 500. Input that fails validation returns 400. Reference pages list the 400, 404 and 409 errors specific to each endpoint.
Rate limits
Each API key can make 50 requests per 10-second window. Past that, the API returns 429 with a Retry-After header giving the seconds to wait.
Retrying
- Retry
429after theRetry-Afterdelay. Retry a409about something still processing after a short wait. - Retry
500with a growing delay when the operation is safe to repeat. When retrying Create an order, reuse the originalorderIdwith the same integration. If the order was already saved, the API can return a duplicate-order400. - Don't retry other
4xxerrors without changing the request.
Getting help
When you contact us about a failed request, include the x-request-id response header if available.