Order Intake API: Errors, Retries and Edge Cases
Every error status and body the Order Intake API returns, what to do about each, safe retry rules, and a checklist of edge cases to handle.
Errors
| Status | Body | Meaning | What to do |
|---|---|---|---|
401 | empty | No or wrong credentials, no key yet, or the store is deactivated | Check the username and key. Ask your customer if they rotated the key or deactivated the store. Don't retry in a loop. |
404 | {"errors": ["Please check your store number"]} | {store_id} belongs to a different store than these credentials | Use the store ID that goes with this username. |
404 | {"errors": [...]} from create | Missing or invalid fields, malformed JSON, or the store's import filter | Fix what's listed and send again. Don't retry a filtered order. |
404 | {"error": "could not find order"} | No order with that ID or order_number in this store | Check the ID, or use ?order_number=. |
404 | {"errors": ["could not find item"]} | No such line on the order, or it was deleted | Re-read the order's items. |
400 | {"errors": [...]} | Invalid update, such as a SKU change or a quantity below 1 | Fix the request. |
400 | {"errors": "supplied updated time is invalid"} | updated_at_start or updated_at_end isn't RFC 3339 | Use a format like 2026-10-26T14:30:00Z. |
400 | {"errors": ["supplied cursor is invalid"]} | cursor isn't a next_cursor from this API | Start again from the first page, or resend the next_cursor you got. |
403 | {"errors": ["Order can no longer be modified"]} | The order isn't unverified any more | Don't retry. Contact your customer. |
409 | {"errors": ["Order is being updated, try again"]} | Another change to this order is in progress | Retry after a second or two. |
500 | {"error": "...", "request_id": "..."} | Unexpected error | Retry with backoff. If it keeps happening, send the request_id to your customer. |
Three error shapes
Parse errors defensively. There are three shapes:
| Shape | When |
|---|---|
{"errors": ["...", "..."]} (a list) | Almost everything |
{"error": "..."} (a string, singular key) | An unknown order, and 500s (with request_id) |
{"errors": "..."} (a string) | A malformed updated_at_start or updated_at_end |
And a 401 has no body at all.
def error_messages(response):
if response.status_code == 401 or not response.content:
return ["unauthorized"]
body = response.json()
value = body.get("errors", body.get("error"))
return value if isinstance(value, list) else [value]Validation is 404 on create, 400 on update
404 on create, 400 on updateCreate returns validation errors as 404. Updates and item changes return 400. Read the errors list either way.
Concurrency and retries
- One change at a time per order. If two requests change the same order at once, one can get
409. Send changes to the same order in sequence, and retry a409after a second or two. - Parallel across orders is fine. Creating or reading different orders in parallel works. Keep it to a handful of concurrent requests per store.
- Retry safely. Creates are idempotent on
order_number, and reads have no side effects. Retry timeouts,409and5xxwith exponential backoff. - Don't retry unchanged:
400,401,403and404. They won't succeed without a change. - Log the request ID. A
500has arequest_id. Include it when you report a problem to your customer.
| Response | Retry? |
|---|---|
| Timeout, connection error | Yes, with backoff. A repeated create returns the existing order. |
409 | Yes, after 1–2 seconds |
5xx | Yes, with exponential backoff |
400, 404 | No. Fix the request. |
403 | No. The warehouse has started; contact your customer. |
401 | No. Pause the store and alert your customer. |
Edge cases checklist
| Area | What to handle |
|---|---|
| Duplicates | Sending an order number that already exists returns the existing order with 200, even if it's cancelled. Order numbers can't be reused in a store. |
| Order numbers | A number is stored as text: 10001 and "10001" are the same order. |
| Addresses | Responses return the verified address, which can differ from what you sent. |
| Before a label | Orders with no label have "shipments": []. |
| Several shipments | An order can have more than one shipment (split, partial or replacement). |
| Several boxes | A shipment can have several parcels, each with its own tracking number. |
| Merged orders | A shipment can belong to several of your orders. Write tracking to each one in orders. |
| Voided labels | The voided shipment disappears. A replacement label is a new shipment with a new id. |
| No label | An order can be fulfilled with no shipments (shipped without a Warehance label). |
| Skipped states | An order can go straight from unfulfilled to fulfilled. |
| Warehouse cancels | The warehouse can cancel an order at any point before it ships. |
| Split or merged | These orders can't be edited, even while still unfulfilled. |
| Items | Deleted lines disappear from responses. A line's SKU can't change. sku_id can be null while your customer maps a SKU. |
| Currency | currency is set on create and can't change. All amounts and item prices are in it. |
| Unknown shipment | GET /shipments/{id}.json returns 200 with {"shipment": null}. |
| Error shapes | {"error": "..."}, {"errors": "..."} and {"errors": [...]} all occur. A 401 is empty. |
| Error codes | Validation errors return 404 on create and 400 on updates. |
Updated 2 days ago
Did this page help you?
