2XX range indicate success, codes in the 4XX and 5XX range indicate failure.
HTTP status codes that can be returned by the Procuros API:
| HTTP Status Code | Meaning |
|---|---|
| 400 - Bad Request | There was an issue with the request sent, such as a duplicate payload was sent. |
| 401 - Unauthorized | The API token is missing or invalid. |
| 403 - Forbidden | The API token doesn’t have permission to perform this action. |
| 404 - Not Found | The requested entity (e.g. Transaction) could not be found. |
| 422 - Validation Failed | The request data is invalid. Responses contain errors that show what field failed validation and why. |
| 429 - Too Many Requests | You are calling the API too much. Check if you can use our bulk endpoints, otherwise contact support to get your rate limit increased. (won’t happen to >99% of customers) |
| 500, 502, 503, 504 - Server Error | An error occurred on Procuros side (rare cases) |
Error Responses
To help you troubleshoot your interactions with the Procuros API, we’ve included further information within the responses returned from failed requests to the API.| Property | Type | Description |
|---|---|---|
message | string | Short error descriptions |
errors | object | (Only on 422 “Validation Failed” Errors) Map of fields that failed validation including the corresponding validation error |
Message
4xx range responses will always include the message property. For example in the case of a 400, the message property will give you the reason why in English.
Errors
For “Validation Failed” Client Errors (HTTP status code422), responses include an additional property errors, which list all request fields that failed validation and why.
Example:
Handling an Error
Example
Error Handling Best Practises
The most common errors are related to missing or misconfigured data. Here is an example on how to handle these with the Report Outgoing Error Request endpoint.Best Practise: Missing GTIN
- Set
errorTypeto:DATA. - Set the
errorReasonto:The GTIN/EAN :gtin couldn't be foundand set up the gtin variable accordingly