Request Errors
In case of API request errors, AfterShip employs standard HTTP response codes within the 4XX and 5XX ranges to specify the reason for the error. These error codes are detailed in the response body.
Typically, codes in the 2XX range indicate successful requests, codes in the 4XX range indicate errors caused by client-side input (e.g., missing a required parameter or a failed charge), and codes in the 5XX range indicate server-side issues on AfterShip’s end.
HTTP Status Code Summary
HTTP Status Code | meta.code | meta.type | Sample Error Message |
---|---|---|---|
400 | 40000 | BadRequest | Invalid JSON. |
400 | 40001 | MissingParameter | Required parameters is missed. |
401 | 401 | Unauthorized | The API key is invalid. |
403 | 40300 | Forbidden | The request is understood, but it has been refused or access is not allowed. |
403 | 40301 | Forbidden | The data in this store is read-only. You cannot create or modify data through the Commerce API. |
404 | 40400 | NotFound | The requested URI is invalid or the specified resource does not exist. |
409 | 40900 | Conflict | There is a conflict with another request, possibly due to the use of the same idempotent key. |
412 | 41201 | PreconditionFailed | The as-store-id or date header has an empty value. |
412 | 41202 | PreconditionFailed | The connection could not be found. |
412 | 41203 | PreconditionFailed | A private connected app needs to configure which AfterShip product can access your data. |
412 | 41204 | PreconditionFailed | The store could not be found. |
422 | 42200 | UnprocessableEntity | The request body is well-formed but contains semantic errors. Please review the response body for more details on these errors. |
429 | 42900 | TooManyRequests | The request was not accepted because the application has exceeded the rate limit. The default API call limit is 10 requests per second. |
500 | 50000 | InternalError | Something went wrong on AfterShip's end, and an unrecoverable error occurred on an external system that this call relies on. |
Examples
Invalid API key
preparing...