Errors
When something goes wrong you get a 4xx or 5xx status and a body like this:
{ "error": { "code": "product_not_found", "message": "…" } }Branch on error.code: codes don't change. The message is written for people and says how to fix the problem, so log it, but don't parse it.
Status codes
| Status | Codes | What it means |
|---|---|---|
400 | invalid_parameter ambiguous_set_code | A parameter is missing, has a value we can't use, or isn't one the endpoint takes. Unknown parameters are rejected, so typos don't go unnoticed. |
401 | missing_api_key invalid_api_key revoked_api_key expired_api_key | There's a problem with the key. See Authentication. |
403 | endpoint_not_allowed ip_not_allowed | The key can't call this endpoint, or not from this IP address. |
404 | product_not_found set_not_found not_found | The product, set or endpoint doesn't exist. Check the id, or search for it. |
405 | method_not_allowed | The API is read-only: send GET. |
429 | rate_limited quota_exceeded | Too many requests this minute, or the monthly quota is used up. Wait for Retry-After. |
500 | internal_error | Something broke on our side. Retry after a short wait. |
Every response carries an
X-Request-Id header starting req_. It's also in your request logs. Include it if you contact support.