Request Errors

In the event of API request errors, AfterShip uses conventional HTTP response codes within 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 (such as missing required parameters or failed charges), and codes in the 5xx range indicate errors related to AfterShip’s servers.


For non-generic error codes, AfterShip employs a range from 10000 to 99999 (a total of 90000 codes) to define specific codes, offering finer granularity for each HTTP status. The first bit of the meta.code identifies the module, while the second and third digits collectively identify the category of the error cause, and the fourth and fifth digits collectively locate the specific cause of the error.

Modulebit 1 of meta.code
common1
recommendation2
search3
tagging4
HTTP Status Codemeta.codemeta.typeSample Error Message
200200OKThe request has been processed successfully.
400400BadRequestThe request body JSON payload is invalid.
401401UnauthorizedThe API key is invalid.
403403ForbiddenAccess forbidden.
429429TooManyRequestsYou have exceeded the API call rate limit. The default limit is 10 requests per second.
500500InternalErrorSomething went wrong on AfterShip's end.
422422UnprocessableEntityInvalid request parameters.
42240000UnprocessableEntityUnable to predict tags and category from the product content.
preparing...
preparing...