Skip to main content

Test Carrier Detection API

Test Carrier Detection API in AfterShip Tracking: follow setup steps, configure key options, verify behavior, and troubleshoot workflow issues.

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

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"  }
}

2. Share your preferred carriers in this way

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

3. 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.

Did this answer your question?