Error format
When a request fails, success is false, data is null (with a few noted exceptions) and error holds a human-readable message. Check the HTTP status first for the kind of failure, then read error for the detail. Each action's page lists its own messages.
{ "success": false, "data": null, "error": "Product not found or inactive." }HTTP status codes
400 — Bad request. Missing action or malformed JSON body.
401 — Invalid or missing API key. Also a wrong line or customer password, or a wrong current_password.
403 — Refused. The line is not the named customer's, the account is suspended (data.suspended: true), a token or email does not match the order, or the lineup on this service is set by the store.
404 — Resource not found. The product, activation, order, customer or payment method does not exist or is inactive.
405 — Wrong HTTP method for this action.
409 — The address already has a login (register_customer), answered with data.sign_in: true.
422 — Validation error. A required field is missing or a value is invalid; the message names the field.
429 — Too many requests, or too many failed sign-in attempts for that account or visitor. Back off and retry.
500 — Something went wrong on the server. The JSON envelope is still returned.
503 — This installation is suspended. No action is available until it is restored.
Handling
401 — Stop. The key is wrong or was regenerated.
404 and 422 — Fix the request; the message says what was wrong.
429 — Wait and retry with exponential backoff.
500 — Log the full response and retry once after a short delay.