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 |
---|---|---|---|
400 | 40000 | BadRequest | The request body is an invalid JSON. |
400 | 40001 | MissingParameter | Request missing required parameters. |
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. |
404 | 40400 | NotFound | The URI requested is invalid or the resource requested does not exist. |
409 | 40900 | Conflict | The request conflicts with another request (perhaps due to using the same idempotent key). |
412 | 41201 | PreconditionFailed | Precondition failed, header as-store-id or Date has empty value. |
412 | 41202 | PreconditionFailed | Precondition failed, the connection not found. |
412 | 41203 | PreconditionFailed | Precondition failed, a private connected app should config which automizely product can access your data firstly. |
412 | 41204 | PreconditionFailed | Precondition failed, the store not found. |
422 | 42200 | UnprocessableEntity | The request body was well-formed but contains semantical errors. The response body will provide more details in the errors or error parameters. |
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 Automizely's end. Also, some error that cannot be retried happened on an external system that this call relies on. |
Examples
Invalid API key
preparing...