error key. Successful responses never include it.
message key and keep error fixed to "Unauthorized":
code you can match on, and
sometimes a context object with related identifiers:
error as text for humans and
code as the value to branch on.
Status codes
Parameter validation
Each endpoint validates its parameters before doing any work. A failed check returns422 with a message
that names the parameter, for example:
Wrong types and values outside an allowed list fail the same way, with a message that names the parameter.
Match on the status code and the parameter name rather than on the exact sentence.
Business errors
Business rules return422 with a descriptive sentence, for example
"no shipping_label with id 99 was found.". Each endpoint in the API reference lists the messages it can
return. Some messages are returned in the language of the warehouse’s country (Spanish or Portuguese) when
they come from the operations side; the reference shows them verbatim.
Exceptions to watch for
A few endpoints do not follow the patterns above yet. Handle them explicitly:- Errors with status
200.POST /orders/cancel,POST /orders/delete,PATCH /orders/{id}/holdandPATCH /orders/{id}/unholdcan answer200with anerrorkey, for example when the order is in a status that does not allow the action. Check the body forerroreven on200. - Click and collect. These endpoints answer
404with acodesuch asORDER_NOT_FOUND, and their500body is{"error": "unexpected_error", "timestamp": 1760000000}. - Order creation.
POST /orders,POST /orders/create-and-shipandPOST /brazil/ordersanswer500with{"error": "unexpected error"}and no timestamp. - Unknown identifiers. Some endpoints answer
500instead of422for astore_idorshipping_method_idthat does not exist. Check identifiers before you retry a500.