Developers

Errors

One error format, with stable codes to branch on.

Every failed request returns a non-2xx status and the same body:

{
  "error": {
    "type": "conflict",
    "code": "invalid_transition",
    "message": "Fulfillment can't move from delivered to shipped.",
    "param": "fulfillment_status",
    "request_id": "req_8RojGGDMGfh1js_r"
  }
}
FieldUse it for
typeThe broad category — matches the HTTP status
codeBranch on this. Stable; new codes may be added
messageA human-readable explanation. May change — don't parse it
paramThe request field the error is about, or null
request_idAlso in the X-Request-Id header. Quote it to support

All codes

Statustypecode
400invalid_requestvalidation_failed
400invalid_requestinvalid_cursor
401authenticationmissing_api_key
401authenticationinvalid_api_key
401authenticationexpired_api_key
401authenticationrevoked_api_key
403permissioninsufficient_scope
403permissionplan_required
404not_foundresource_not_found
409conflictinvalid_transition
409conflictinsufficient_stock
409conflictidempotency_mismatch
409conflictidempotency_in_progress
429rate_limitrate_limited
500api_errorinternal_error

Handling them

  • 400 — fix the request; retrying the same one fails again. param points at the field.
  • 401 / 403 — check the key, its scopes and the store's plan. See Authentication.
  • 404 — the id doesn't exist in this store. A key never sees another store's data.
  • 409 — the change isn't allowed in the record's current state, e.g. an invalid fulfillment step or not enough stock. Re-read the record first.
  • 429 — wait for Retry-After seconds. See Rate limits.
  • 500 — something failed on our side. Retry with backoff, using an Idempotency-Key for writes.

On this page