Reference
Error codes
Every error: { "error": "…", "error_code": "…", "request_id": "req_…" } (plus fields for validation). Branch on error_code.
| Status | error_code | Meaning and what to do |
|---|---|---|
| 400 | VALIDATION_ERROR | Fix the fields listed in fields |
| 400 | INVALID_JSON, BAD_REQUEST | Malformed request |
| 400 | INVALID_CURSOR | The cursor doesn't belong to this list or sort; start again without it |
| 400 | REQUEST_FAILED | Unexpected problem on our side; retry later and quote request_id |
| 400 | VARIANT_NOT_FOUND, SHIPPING_OPTION_NOT_FOUND | The ID isn't a visible variant or option of this store |
| 400 | INVALID_ADDRESS, INVALID_PINCODE, PINCODE_VALIDATION_UNAVAILABLE | Fix the address (or retry the pincode check later) |
| 400 | PUBLIC_CHECKOUT_DISABLED | The store doesn't allow guest checkout: log the shopper in |
| 400 | CART_EMPTY, PREORDER_DIRECT_ONLY, CHECKOUT_FAILED, COD_NOT_ENABLED | Checkout can't proceed as sent; show the message |
| 400 | CAPTCHA_FAILED | Solve a new captcha |
| 400 | OTP_NOT_SENT, INVALID_OTP, IDENTIFIER_NOT_ALLOWED, LOGIN_FAILED | Show the message; let the shopper retry |
| 400 | IDEMPOTENCY_KEY_REQUIRED | Send an Idempotency-Key header |
| 400 | RETURN_URL_NOT_ALLOWED | return_url must be on your app's allowed websites |
| 401 | INVALID_API_KEY, API_KEY_EXPIRED, WRONG_KEY_MODE | Check the key (test keys only work on staging, live keys on production) |
| 401 | CUSTOMER_TOKEN_INVALID | Refresh the shopper's token, or log them in again |
| 401 | REFRESH_TOKEN_ROTATED | A newer refresh token exists; use it |
| 401 | REFRESH_TOKEN_REUSED | Treated as theft; the shopper must log in again |
| 401 | INVALID_CREDENTIALS | Wrong email or password |
| 403 | ORIGIN_NOT_ALLOWED | This website isn't on the app's allowed websites |
| 403 | SECRET_KEY_IN_BROWSER | A secret key was sent from a browser: rotate it and move the call to your server |
| 403 | WRONG_KEY_TYPE | This endpoint needs the other kind of key |
| 403 | APP_SUSPENDED, STORE_UNAVAILABLE, FEATURE_NOT_AVAILABLE | The app or store can't use the API right now; contact the merchant |
| 403 | LOGIN_METHOD_NOT_ENABLED, ACCOUNT_DISABLED | Offer only the store's login_methods; the account can't log in |
| 404 | NOT_FOUND, ADDRESS_NOT_FOUND, CART_NOT_FOUND | Doesn't exist, or isn't visible to this key or shopper |
| 405 | METHOD_NOT_ALLOWED | Wrong HTTP method |
| 409 | IDEMPOTENCY_IN_PROGRESS | The first request with this key is still running; retry shortly |
| 415 | UNSUPPORTED_MEDIA_TYPE | Send JSON with Content-Type: application/json |
| 422 | IDEMPOTENCY_KEY_REUSED | Same key, different request: use a new key |
| 429 | RATE_LIMITED, OTP_LIMIT_REACHED | Wait Retry-After seconds (OTP: until tomorrow, or use email) |
| 503 | SERVICE_UNAVAILABLE, LOGIN_UNAVAILABLE | Temporarily off; retry after Retry-After |