"success": false alongside a human-readable message, a structured errors array with field-level detail when applicable, and a requestId you can include in support requests.
Error Response Format
All error responses use the following envelope structure:boolean
required
Always
false for error responses.string
required
A short, human-readable summary of what went wrong. Suitable for logging; not guaranteed to be stable across API versions, so do not use it for programmatic branching — use the HTTP status code instead.
array
Present on validation errors. Each element has a
field (the request property that failed) and a message describing the constraint violation.string
An opaque identifier for the specific request. Include this value when contacting support to help correlate server-side logs to your issue.
HTTP Status Codes
The API uses standard HTTP semantics. Match on the status code first, then inspect the response body for detail.Common Error Scenarios
CSRF errors — 403 Forbidden
CSRF errors — 403 Forbidden
A Recovery: Call
403 on a write request almost always means the x-csrf-token header is absent, stale, or does not match the CSRF cookie the server has on file.- Missing header — every
POST,PATCH, andDELETErequest must includex-csrf-token. Read-onlyGETrequests do not require it. - Stale token — CSRF tokens are bound to the session. If the session was refreshed or the token cookie expired, the previously fetched token is no longer valid.
- Mismatched value — the server compares the
x-csrf-tokenheader against the CSRF cookie using the double-submit pattern. Any mismatch results in a403.
GET /auth/csrf-token to obtain a fresh token, then retry the write request with the new value in x-csrf-token.Validation errors — 400 Bad Request
Validation errors — 400 Bad Request
A Recovery: Iterate over the
400 response means your request payload, query parameters, or path parameters did not pass schema validation. The errors array pinpoints every failing field so you can correct them all in a single retry.Example — invalid registration payload:errors array, surface the messages to the user or fix the values programmatically, and resubmit the request.Rate limiting — 429 Too Many Requests
Rate limiting — 429 Too Many Requests
The API enforces rate limits to protect reliability. Login and registration endpoints apply brute-force protection — accounts are locked out after 10 consecutive failed attempts for 15 minutes. General endpoint rate limits apply across all routes.When you hit a limit, the response includes a Recovery strategy:
Retry-After header specifying the number of seconds to wait before retrying.Example response:- Read the
Retry-Afterheader value (in seconds). - Wait for the specified duration before retrying — do not immediately retry or you will continue receiving
429responses. - For login brute-force lockouts, wait the full 15-minute window before attempting again, or advise the user to reset their password.
- In automated clients, implement exponential backoff with jitter to avoid thundering-herd retries.
Conflict errors — 409 Conflict
Conflict errors — 409 Conflict
A Direct the user to log in or use the password-reset flow instead of registering again.Insufficient stock on cart or order:Reduce the requested quantity or remove the item. Refresh the product variant to show the user the current available stock before they try again.
409 response indicates the request is valid but conflicts with the current state of a resource. The two most common scenarios are:Duplicate email on registration:The
410 Gone status code is specifically used for expired or already-used tokens — email verification links and password reset OTPs. A 410 is distinct from a 404 (resource never existed) and signals that the token existed but is no longer valid. To recover, request a fresh token: use POST /auth/email-verification/resend for verification emails, or restart the password reset flow.