Errors

AfterShip uses conventional HTTP response codes to indicate success or failure of an API request. In general, codesin the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, a charge failed, etc.), and codes in the 5xx range indicate an error with AfterShip's servers.


HTTP Status Code Summary

HTTP Status Codemeta.codemeta.typeSample Error Message
400400BadRequestThe request was invalid or cannot be otherwise served.
4004001BadRequestInvalid JSON data.
4004002BadRequestInvalid JSON data.
4004003BadRequestTracking already exists.
4044004BadRequestTracking does not exist.
4004005BadRequestThe value of `tracking_number` is invalid.
4004006BadRequest`tracking` object is required.
4004007BadRequest`tracking_number` is required.
4004008BadRequestThe value of `[field_name]` is invalid.
4004009BadRequest`[field_name]` is required.
4004010BadRequestThe value of `slug` is invalid.
4004011BadRequestMissing or invalid value of the required fields for this courier. Besides `tracking_number`, also required: `[field_name]`
4004012BadRequestCannot detect courier. Activate courier at https://secure.aftership.com/settings/courier
4004013BadRequestRetrack is not allowed. You can only retrack an inactive tracking.
4004014BadRequest`notification` object is required.
4004015BadRequestThe value of `id` is invalid.
4004016BadRequestRetrack is not allowed. You can only retrack each shipment once.
4004017BadRequestThe format of `tracking_number` is invalid.
401401UnauthorizedInvalid API key.
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.
429429TooManyRequestsYou have exceeded the API call rate limit. Default limit is 10 requests per second.
500
502
503
504
500
502
503
504
InternalErrorSomething went wrong on AfterShip's end.

* [field_name] is a dynamic value, e.g. `tracking_postal_code`, `tracking_account_number`, etc


Examples

Invalid API key

Created Tracking Number is Failed

Server is down