Errors
Errors
Errors
Errors are problem details, sent as application/problem+json. The title says what went wrong, and the detail usually says what to do about it:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.10",
"title": "Order already exists",
"status": 409,
"detail": "You've already sent an order with the reference WEB-100234. Get it from the Location URL to see it."
}
Invalid requests
A request that isn’t valid gets 400 Bad Request, with each problem listed under errors, keyed by the field’s path:
{
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"Delivery.Date": ["The delivery date can't be in the past."],
"Items[0].Quantity": ["The field Quantity must be between 1 and 100."]
}
}
The paths start with a capital letter, but they name the same fields as the request: Items[0].Quantity is items[0].quantity.
Fix the request before you send it again: the same request gets the same error.
Status codes
| Status | Meaning | What to do |
|---|---|---|
| 400 | The request isn’t valid. | Fix the fields listed under errors. |
| 401 | The access token is missing, invalid or expired. | Get a new token. See Authentication. |
| 403 | The token isn’t for a partner application we’ve set up. | Check you’re using the right credentials for the environment. |
| 404 | There’s no order with that reference among your orders. | Check the reference. |
| 409 | Creating: you’ve already sent an order with that reference. Changing: we’ve started the order, or it changed while you were updating it. | Creating: the order exists, so get it by its reference. Changing: the detail says which; contact us, or get the order and send the change again. |
| 5xx | Something went wrong on our side. | Try again after a short wait. |
Retrying
It’s safe to retry creating an order. Each order has a reference of your own, and we never create two orders with the same reference: if the first attempt got through, the retry gets 409 and you can get the order by its reference.