Articles on: Others

Test Carrier Detection API

Overview


AfterShip API returns tracking information of all our supported carriers 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 carrier detection quick and error-free. That API is


Carrier 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:


  1. Provide the tracking number like this:


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


  1. Share your preferred carriers in this way


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


  1. Two new fields have been introduced — ‘Origin country’ and ‘Destination country’ — to increase the accuracy of carrier 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.

Updated on: 10/04/2024