Request content and responses
HTTP header status codes
The API returns standardized HTTP status codes in its headers with every call. The most common ones are:
HTTP status code | description |
|---|---|
200 OK | the request was processed with no error. |
201 Created | the resource was created. |
202 Accepted | The request was processed with no error but the action itself is asychroneous. This means that it could fail down the line, when processed by downstream systems. |
207 Multi-Status | Processing of the multi-object payload was partially successful. You should look into the response body to have more details. |
400 Bad Request | Your payload was ill-formed (incorrect syntax, data type, etc). You should fix it before resubmitting the request. |
401 Unauthorized | Missing authorisation (typically, you forgot to include the Bearer JWT Token in the Authorization HTTP Header of the request) |
403 Forbidden | You were successfuly identified by the server, but you don't have the permission to access the requested resource. |
404 Not Found | The resource you are trying to access does not exist. You should verify the URI and if it contains path parameters, you should ensure that they are correct. |
409 Conflict | The resource you are trying to update was already updated or its update is in progress. You should not call again. |
429 Too Many Requests | You have exceeded the rate limits for this resource. See Rate limiting and scope for more information. |
payload content: rule of thumb
Generally speaking, the API is designed around the principe "don't send what you don't have and you won't get what is not there". This is mainly to avoid receiving and sending unnecessary information and to keep the content as much as light and readable as possible.
Don't send what you don't have
- don't send fields you don't have any value for (unless it is required in the request body) example: do not send a price update with a value of "0"
- don't send data that did not change since last update example: do not constantly send the same stock value on a SKU if not required
You won't get what is not there
The API doesn't return data which isnull, blank or 0. Therefore if a field is not included within the response body, you can assume that it is either empty or none existant for that specific resource. You can then implement default values based on said field data type. Check the API Reference for schemas. example: when retrieving items stock, you won't see any warehouse on a given item that does not have stock in said warehouses. example: when retrieving orders, you will not see in the response a price field such as 'ecotax' if its value is 0.
Parsing the response body for more information
Certain endpoints allow multi-content payloads or partial updates, which can result in ambiguous HTTP code in the response header. Typically, the 207 Multi Status HTTP code explicitly means that you need to parse the body to get the proper status for every update.