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.message | meta.details |
|---|---|---|---|
| 401 | 401 | Unauthorized | The API key is invalid. |
| 404 | 404 | Not Found | The URI requested is invalid or the resource requested does not exist. |
| 200 | 4104 | The request was invalid or cannot be otherwise served. | |
| 500 | 50000 | Something went wrong on AfterShip's end. Also, some error that cannot be retried happened on an external system that this call relies on. |
Examples
401 - Invalid API key
preparing...
4104 - The request was invalid or cannot be otherwise served
preparing...