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 | Missing required parameters. |
401 | 401 | Unauthorized | The API key is invalid. |
403 | 40300 | Forbidden | The request is not allowed. |
403 | 40301 | Forbidden | Store data is read-only. Cannot create or modify data via Commerce API. |
403 | 40302 | Forbidden | The feature is not currently enabled for your organization. Please contact our support team for the details. |
404 | 40400 | NotFound | The requested URI is invalid or the specified resource does not exist. |
409 | 40900 | Conflict | Request conflict, please confirm if there is any repeated idempotent key used. |
412 | 41201 | PreconditionFailed | Invalid as-store-id or date header value. |
412 | 41202 | PreconditionFailed | The connection could not be found. |
412 | 41203 | PreconditionFailed | Private connected app required for accessing your data. |
412 | 41204 | PreconditionFailed | The store could not be found. |
422 | 42200 | UnprocessableEntity | Semantic errors found in the request body. Please review the response error details. |
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. |
Examples
Invalid API key
preparing...