Coming soon

The Storefront API isn’t open to developers yet. This is a preview of the docs, and details may change before launch.

Reference

Error codes

Every error: { "error": "…", "error_code": "…", "request_id": "req_…" } (plus fields for validation). Branch on error_code.

Statuserror_codeMeaning and what to do
400VALIDATION_ERRORFix the fields listed in fields
400INVALID_JSON, BAD_REQUESTMalformed request
400INVALID_CURSORThe cursor doesn't belong to this list or sort; start again without it
400REQUEST_FAILEDUnexpected problem on our side; retry later and quote request_id
400VARIANT_NOT_FOUND, SHIPPING_OPTION_NOT_FOUNDThe ID isn't a visible variant or option of this store
400INVALID_ADDRESS, INVALID_PINCODE, PINCODE_VALIDATION_UNAVAILABLEFix the address (or retry the pincode check later)
400PUBLIC_CHECKOUT_DISABLEDThe store doesn't allow guest checkout: log the shopper in
400CART_EMPTY, PREORDER_DIRECT_ONLY, CHECKOUT_FAILED, COD_NOT_ENABLEDCheckout can't proceed as sent; show the message
400CAPTCHA_FAILEDSolve a new captcha
400OTP_NOT_SENT, INVALID_OTP, IDENTIFIER_NOT_ALLOWED, LOGIN_FAILEDShow the message; let the shopper retry
400IDEMPOTENCY_KEY_REQUIREDSend an Idempotency-Key header
400RETURN_URL_NOT_ALLOWEDreturn_url must be on your app's allowed websites
401INVALID_API_KEY, API_KEY_EXPIRED, WRONG_KEY_MODECheck the key (test keys only work on staging, live keys on production)
401CUSTOMER_TOKEN_INVALIDRefresh the shopper's token, or log them in again
401REFRESH_TOKEN_ROTATEDA newer refresh token exists; use it
401REFRESH_TOKEN_REUSEDTreated as theft; the shopper must log in again
401INVALID_CREDENTIALSWrong email or password
403ORIGIN_NOT_ALLOWEDThis website isn't on the app's allowed websites
403SECRET_KEY_IN_BROWSERA secret key was sent from a browser: rotate it and move the call to your server
403WRONG_KEY_TYPEThis endpoint needs the other kind of key
403APP_SUSPENDED, STORE_UNAVAILABLE, FEATURE_NOT_AVAILABLEThe app or store can't use the API right now; contact the merchant
403LOGIN_METHOD_NOT_ENABLED, ACCOUNT_DISABLEDOffer only the store's login_methods; the account can't log in
404NOT_FOUND, ADDRESS_NOT_FOUND, CART_NOT_FOUNDDoesn't exist, or isn't visible to this key or shopper
405METHOD_NOT_ALLOWEDWrong HTTP method
409IDEMPOTENCY_IN_PROGRESSThe first request with this key is still running; retry shortly
415UNSUPPORTED_MEDIA_TYPESend JSON with Content-Type: application/json
422IDEMPOTENCY_KEY_REUSEDSame key, different request: use a new key
429RATE_LIMITED, OTP_LIMIT_REACHEDWait Retry-After seconds (OTP: until tomorrow, or use email)
503SERVICE_UNAVAILABLE, LOGIN_UNAVAILABLETemporarily off; retry after Retry-After