AfterShip API returns tracking information of all our supported couriers swiftly so that you can share delivery updates quickly with customers.

You also get access to a testing API, which makes the whole process of courier detection quick and error-free. That API is

Courier detect API: POST

https://api.aftership.com/v4-beta/couriers/detect

Here are key details about the new testing API that you should be aware of:

Endpoint:
POST /v4-beta/couriers/detect

Authentication:
Header: aftership-api-key

Request Body:

Provide the tracking number like this:

{
"tracking": {
"tracking_number": "ERC584934723MY"
}
}


Share your preferred couriers in this way

{
"tracking": {
"tracking_number": "ERC584934723MY",
"slug": [“usps”, “fedex”, “dhl”, “malaysia-post”]
}
}


Two new fields have been introduced — ‘Origin country’ and ‘Destination country’ — to increase the accuracy of courier detection. So, fill them up in the following way for better results:

{
"tracking": {
"tracking_number": "ERC584934723MY",
"origin_country_iso3": "MYS",
"destination_country_iso3": "MYS"
}
}


Response Body:

There is no change made in the response body. It is as same as before: https://developers.aftership.com/reference/couriers#post-couriers-detect

For any other query, you can contact our support team available 24x7 for you 👍
Was this article helpful?
Cancel
Thank you!