Errors
An error answer carries a fixed code and a message. Programs should act on the code; the message is translated into the language the program asks for.
Every error has the same shape. code is one of the values below and does not change; message comes in the language of the Accept-Language header (English if none fits); request_id is the value to quote to the store owner; field is present when one parameter or body member was refused.
{
"error": {
"code": "invalid_parameter",
"message": "A parameter is unknown or has an invalid value.",
"request_id": "8c2e5a9d01b7f346",
"field": "updated_since"
}
}All codes
| Code | HTTP status | Message |
|---|---|---|
bad_request | 400 | The request could not be read. |
https_required | 400 | The API is only available over HTTPS. If you sent a key with this request, it has been revoked. |
unauthorized | 401 | A valid API key is required. |
forbidden | 403 | This key is not allowed to do that. |
license_inactive | 403 | The API is not available for this store at the moment. |
not_found | 404 | Not found. |
method_not_allowed | 405 | This method is not supported here. |
idempotency_conflict | 409 | This Idempotency-Key was already used for a different request. |
request_in_progress | 409 | A request with this Idempotency-Key is still running or ended without a recorded result. Check the current state, then use a new Idempotency-Key. |
order_not_shippable | 409 | This order cannot be marked as shipped: it must be in preparation, paid or payable on delivery, and not shipped yet. |
stock_rejected | 409 | At least one row was refused, so nothing was changed. See the results. |
reference_limit | 409 | This order already has the maximum number of external references. |
price_rejected | 409 | At least one row was refused, so no price was changed. See the results. |
sku_exists | 409 | This stock code is already in use. |
product_limit | 409 | The product limit of the store’s plan is reached. |
payload_too_large | 413 | The request body is too large. |
unsupported_media_type | 415 | Only application/json is accepted. |
invalid_parameter | 422 | A parameter is unknown or has an invalid value. |
rate_limited | 429 | Too many requests. Please retry later. |
daily_limit | 429 | The daily limit of this key for this action is reached. |
server_error | 500 | Something went wrong. Quote the request id when you contact the store. |
maintenance | 503 | The store is being updated. Please retry shortly. |
unavailable | 503 | The store cannot be reached at the moment. Please retry shortly. |
Repeat or not?
| Answer | Repeat? |
|---|---|
No answer, 500, 503 | Yes, after a pause that grows with each attempt (and at least Retry-After). Writes with the same Idempotency-Key. |
429 | Yes, after Retry-After seconds. |
409 request_in_progress | Not blindly: read the current state first. |
Any other 4xx | No. The request, the key or the state of the record has to change first. |
Code by code
bad_request 400
Message: The request could not be read.
What to do: The body is not valid JSON, is not a JSON object, is nested too deeply, or has a member twice. Fix the request; repeating it unchanged will fail again.
https_required 400
Message: The API is only available over HTTPS. If you sent a key with this request, it has been revoked.
What to do: The request arrived over plain HTTP. If it carried a key, that key no longer works: ask the store owner for a new one and use https:// addresses only. Do not follow redirects from HTTPS to HTTP.
unauthorized 401
Message: A valid API key is required.
What to do: No key, a mistyped key, or a key that was revoked or has expired. Check that the header is Authorization: Bearer … and that the server passes it on (the store panel has a server check). Do not retry in a loop: repeated failures from one address are slowed down. If the key is gone, the owner creates a new one.
forbidden 403
Message: This key is not allowed to do that.
What to do: The key is valid but may not do this: the permission for this endpoint is missing, or the request comes from an address outside the key's IP list. Permissions cannot be added to a key; the owner creates a new key with the right ones.
license_inactive 403
Message: The API is not available for this store at the moment.
What to do: The licence of the store is not active, so its API is closed. Nothing is wrong with your request. Stop polling, tell the store owner, and try again later at a low rate (for example once an hour).
not_found 404
Message: Not found.
What to do: The address is unknown, the record does not exist or is out of reach for this key, or the API of this store is switched off. Check the base address with GET /v1/store. A draft product is returned only with status=draft.
method_not_allowed 405
Message: This method is not supported here.
What to do: The address exists but not with this method. The Allow header of the answer lists the methods that work.
idempotency_conflict 409
Message: This Idempotency-Key was already used for a different request.
What to do: You sent a different request under an Idempotency-Key you used before. Use a new value for every new request and keep the value only for repeats of the very same request.
request_in_progress 409
Message: A request with this Idempotency-Key is still running or ended without a recorded result. Check the current state, then use a new Idempotency-Key.
What to do: The first request with this key value is still running, or it ended without a recorded result. Wait a few seconds and read the current state (the order, the stock row, the price, the product with that stock code). If the change is there, you are done; if not, send the request again with a new Idempotency-Key.
order_not_shippable 409
Message: This order cannot be marked as shipped: it must be in preparation, paid or payable on delivery, and not shipped yet.
What to do: The order is not in a state that can be shipped through the API, or it was shipped already. Read the order: if status is shipped with your tracking number, treat it as done; otherwise leave it to a person in the store panel.
stock_rejected 409
Message: At least one row was refused, so nothing was changed. See the results.
What to do: In mode all one refused row stops the whole request. Read results: every row has a status and refused rows a reason. Correct or drop the refused rows (for expected_mismatch count again from the figure in stock) and send a new request with a new Idempotency-Key.
reference_limit 409
Message: This order already has the maximum number of external references.
What to do: The order already carries document numbers of five programs. Reuse one of the existing program names (sending it again replaces its number) or ask the store owner which one to use.
price_rejected 409
Message: At least one row was refused, so no price was changed. See the results.
What to do: In mode all one refused row stops the whole request: no price was changed. Read results: refused rows have status = rejected and a reason, the rows that were fine have not_applied. For expected_mismatch and sale_not_lower take the current figures from price and sale_price of the row, decide again and send a new request with a new Idempotency-Key. Never answer change_too_large by sending the change in smaller steps: such a row is checked by a person and changed in the store panel.
sku_exists 409
Message: This stock code is already in use.
What to do: A product or a variant of the store already has this stock code; products in the recycle bin count too. Do not try other spellings. Look the code up with GET /v1/products?sku=… (add status=draft for drafts): if it is the product you meant to create, treat the job as done; otherwise the store owner decides which code the new product gets.
product_limit 409
Message: The product limit of the store’s plan is reached.
What to do: The store has as many products as its plan allows; drafts count. Stop creating products and tell the store owner, who can remove products or move to a larger plan. Repeating the request will be refused again.
payload_too_large 413
Message: The request body is too large.
What to do: The body is larger than 256 KB. Send fewer rows per request (stock and prices: at most 100 rows).
unsupported_media_type 415
Message: Only application/json is accepted.
What to do: Send the body as JSON with the header Content-Type: application/json.
invalid_parameter 422
Message: A parameter is unknown or has an invalid value.
What to do: A parameter or body member is unknown, appears twice, or has a value that is not allowed. field in the answer names it (idempotency_key when the Idempotency-Key header of a write is missing or malformed). Fix the request; the API never ignores what it does not know.
rate_limited 429
Message: Too many requests. Please retry later.
What to do: Wait as many seconds as the Retry-After header says, then continue. Spread requests evenly instead of sending them in bursts, and use updated_since instead of reading everything again.
daily_limit 429
Message: The daily limit of this key for this action is reached.
What to do: The key has used up its daily allowance for this action (500 shipments, 500 new products or 20,000 price rows a day). Stop sending this kind of request and continue the next day (or after the time in Retry-After, when the answer has that header); if this is your normal volume, the store owner can spread the work over more than one key.
server_error 500
Message: Something went wrong. Quote the request id when you contact the store.
What to do: Something failed inside the store. Retry later with growing pauses; for a write, repeat with the same Idempotency-Key. If it keeps failing, give the store owner the request_id.
maintenance 503
Message: The store is being updated. Please retry shortly.
What to do: The store is being updated, usually for a few minutes. Wait as long as Retry-After says and repeat; for a write, with the same Idempotency-Key.