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 Codemeta.codemeta.typeSample Error Message
400400BadRequestThe request body is an invalid JSON.
401401UnauthorizedThe API key is invalid.
403403ForbiddenThe request is understood, but it has been refused or access is not allowed.
404404NotFoundThe URI requested is invalid or the resource requested does not exist.
409409ConflictThe request conflicts with another request (perhaps due to using the same idempotent key).
422422UnprocessableEntityThe data given in the request failed validation. Inspect the response for details.
500500InternalErrorSomething went wrong on AfterShip's end. Also, some error that cannot be retried happened on an external system that this call relies on.
42210001UnprocessableEntityThe account with the given email does not exist in the system.
42210002UnprocessableEntityRole does not exist.
42210003UnprocessableEntityNo available member seats.