Request Errors
In the event of API request errors, AfterShip uses conventional HTTP response codes in the 4XX and 5XX range to indicate the reason behind the error along with the error code already defined in the response body.
In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error caused by the given information (E.g., you omitted a required parameter or a charge failed), and codes in the 5xx range indicate an error related to AfterShip’s servers.
HTTP Status Code Summary
HTTP Status Code | meta.code | meta.type | Sample Error Message |
---|---|---|---|
401 | 401 | Unauthorized | The API key is invalid. |
400 | 40000 | BadRequest | The request was invalid or cannot be otherwise served. |
422 | 42200 | UnprocessableEntity | The request params is invaild for the server understands. |
404 | 40400 | NotFound | The request path is not found in the server. |
409 | 40900 | Conflict | Has an existing one entity on the server. |
Examples
Invalid API key
preparing...
Entity Unprocessable
preparing...
Record Not Found
preparing...