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.
4004006BadRequesttracking object is required.
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]
4004012BadRequestCannot detect courier. Activate courier at https://admin.aftership.com/settings/couriers
4004013BadRequestRetrack is not allowed. You can only retrack an inactive tracking.
4004014BadRequestnotification 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. The default limit is 10 requests per second.
500 502 503 504500 502 503 504InternalErrorSomething went wrong on AfterShip's end.
preparing...
preparing...
preparing...