Request Errors

In the events of API request errors, AfterShip uses conventional HTTP response codes in the 4XX and 5XX range to indicate the reason behind the error.


AfterShip uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in 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 Codemeta.codemeta.typeSample Error Message
400400BadRequestThe request was invalid or cannot be otherwise served.
4004001BadRequestInvalid JSON data.
4004003BadRequestTracking already exists.
4044004BadRequestTracking does not exist.
4004005BadRequestThe value of tracking_number is invalid.
4004007BadRequesttracking_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]
4004012BadRequestThe error message will be one of the following:
1. Unable to import shipment as the carrier is not on your approved list for carrier auto-detection. Add the carrier here: https://admin.aftership.com/settings/couriers
2. Unable to import shipment as we don’t recognize the carrier from this tracking number.
3. Unable to import shipment as the tracking number has an invalid format.
4. Unable to import shipment as this carrier is no longer supported.
5. Unable to import shipment as the tracking number does not belong to a carrier in that group.
4004013BadRequestRetrack is not allowed. You can only retrack an inactive tracking.
4004015BadRequestThe value of id is invalid.
4004016BadRequestRetrack is not allowed. You can only retrack each shipment once.
4004017BadRequestThe format of tracking_number is invalid.
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.
429429TooManyRequestsYou have exceeded the API call rate limit. The default limit is 10 requests per second.
500 502 503 504500 502 503 504InternalErrorSomething went wrong on AfterShip's end.
preparing...
preparing...
preparing...