Error handling
Every error returns a consistent JSON body, regardless of the endpoint.
Shape
error_code— stable code you can use to handle the error programmatically.message— human-readable description of the error.errors— optional; per-field detail on validation errors.
shell
{
"error_code": "VALIDATION_ERROR",
"message": "\"email\" is required",
"errors": {
"email": "required"
}
}Status codes
| Status | Meaning |
|---|---|
| 400 | Invalid request (field validation) |
| 401 | Missing, invalid, or revoked key |
| 402 | Subscription access blocked or monthly quota exhausted without auto top-up |
| 403 | The key lacks the required scope |
| 404 | Resource not found (or not in your tenant) |
| 409 | Conflict — resource already exists or state disallows it |
| 422 | Business rule violated (e.g. no availability) |
| 429 | Rate limit exceeded — see Rate limits |
| 500 | Internal error; retry later |
Retry strategy
Retry with exponential backoff on 429, 502, 503 and 504. Don't automatically retry other 4xx: they'll fail the same way.
Public Store API errors
The Store API has a separate error contract from the admin API. Every Store API error uses this shape:
400 invalid_request— invalid request, JSON, or parameters.401 invalid_api_key,invalid_customer_token, orcustomer_authentication_required— a valid credential is missing.402 store_api_subscription_required— inactive or unavailable API subscription.403 insufficient_scope,api_key_type_not_permitted, orforbidden— the key type, scope, or permission is insufficient.404 not_foundorstore_not_found— the API is disabled, or the store or resource is unavailable.409 idempotency_conflictorcommerce_conflict— idempotency conflict or incompatible purchase state; a pending operation needs reconciliation.410 cart_link_expired— cart link expired.422 invalid_selection— invalid product or availability selection.429 rate_limit_exceeded— the per-minute limit was reached; honorRetry-After.503 *_unavailable— a dependent service is unavailable.500 store_api_error— unexpected internal error; contact support and include therequest_id.
shell
{"error":{"code":"invalid_request","request_id":"..."}}For purchase operations, never blindly retry a
409: a pending operation may already have created a booking or started a payment. Keep the same Idempotency-Key and check its state before retrying.