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 Code||meta.code||meta.type||Sample Error Message|
|400||400||BadRequest||The request was invalid or cannot be otherwise served.|
|400||4001||BadRequest||Invalid JSON data.|
|400||4003||BadRequest||Tracking already exists.|
|404||4004||BadRequest||Tracking does not exist.|
|400||4005||BadRequest||The value of |
|400||4008||BadRequest||The value of |
|400||4010||BadRequest||The value of |
|400||4011||BadRequest||Missing or invalid value of the required fields for this courier. Besides |
|400||4012||BadRequest||The 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.
|400||4013||BadRequest||Retrack is not allowed. You can only retrack an inactive tracking.|
|400||4015||BadRequest||The value of |
|400||4016||BadRequest||Retrack is not allowed. You can only retrack each shipment once.|
|400||4017||BadRequest||The format of |
|401||401||Unauthorized||The API key is invalid.|
|403||403||Forbidden||The request is understood, but it has been refused or access is not allowed.|
|404||404||NotFound||The URI requested is invalid or the resource requested does not exist.|
|429||429||TooManyRequests||You have exceeded the API call rate limit. The default limit is 10 requests per second.|
|500 502 503 504||500 502 503 504||InternalError||Something went wrong on AfterShip's end.|
[field_name] is a dynamic value, e.g.