Couriers

Get a list of our supported couriers.


POST /couriers/detect

Headers

aftership-api-key: YOUR_API_KEY
Content-Type: application/json

Parameters

Required Parameters
ParameterTypeDescription
tracking_numberStringTracking number of a shipment.
Optional Parameters
ParameterTypeDefault / Example
tracking_postal_codeStringThe postal code of receiver's address. Required by some couriers, such asdeutsch-post
tracking_ship_dateStringShipping date inYYYYMMDDformat. Required by some couriers, such asdeutsch-post
tracking_account_numberStringAccount number of the shipper for a specific courier. Required by some couriers, such asdynamic-logistics
tracking_keyStringKey of the shipment for a specific courier. Required by some couriers, such assic-teliway
tracking_destination_countryStringDestination Country of the shipment for a specific courier. Required by some couriers, such aspostnl-3s
slugArray or StringIf not specified, Aftership will automatically detect the courier based on the tracking number format and your selected couriers. Use array or comma separated to input a list of couriers for auto detect.

Body

{
    "tracking": {
        "tracking_number": "906587618687",
        "tracking_postal_code": "DA15BU",
        "tracking_ship_date": "20131231",
        "tracking_account_number": "1234567890",
        "slug": [
            "dhl",
            "ups",
            "fedex"
        ]
    }
}

Headers

HTTP/1.1 200 OK
Content-Type: application/json
Connection: keep-alive
Date: Mon, 10 Jun 2013 07:38:02 GMT

Attributes

Attributes
AttributeTypeDescription
totalNumberTotal number of matched couriers
trackingHash of Tracking ObjectHash describes the tracking information.
couriersArray of Courier ObjectA list of matched couriers based on tracking number format.
Tracking Object
AttributeTypeDescription
idStringA unique identifier generated by AfterShip for the tracking.
tracking_numberStringTracking number.
tracking_postal_codeStringThe postal code of receiver's address. Required by some couriers, such asdeutsch-post
tracking_ship_dateStringShipping date inYYYYMMDDformat. Required by some couriers, such asdeutsch-post
tracking_keyStringKey of the shipment for a specific courier. Required by some couriers, such assic-teliway
tracking_origin_countryStringOrigin Country of the shipment for a specific courier. Required by some couriers, such asdhl
tracking_destination_countryStringDestination Country of the shipment for a specific courier. Required by some couriers, such aspostnl-3s
tracking_stateStringLocated state of the shipment for a specific courier. Required by some couriers, such asstar-track-courier
tracking_account_numberStringAccount number of the shipper for a specific courier. Required by some couriers, such asdynamic-logistics
slugStringUnique code of courier. Get courier slug here
Courier Object
AttributeTypeDescription
slugStringUnique code of courier
nameStringName of courier
phoneStringContact phone number of courier
other_nameStringOther name of courier
web_urlStringWebsite link of courier
required_fieldsArrayThe extra fields need for tracking, such as `tracking_account_number`, `tracking_postal_code`, `tracking_ship_date`, `tracking_key`, `tracking_destination_country`
optional_fieldsArraythe extra fields which are optional for tracking. Basically it's the same as required_fields, but the difference is that only some of the tracking numbers require these fields.
default_languageStringDefault language of tracking results
support_languagesArrayOther supported languages
service_from_country_iso3ArrayCountry code (ISO Alpha-3) where the courier provides service

Body

{
    "meta": {
        "code": 200
    },
    "data": {
        "total": 2,
        "couriers": [
            {
                "slug": "fedex",
                "name": "FedEx",
                "phone": "+1 800 247 4747",
                "other_name": "Federal Express",
                "web_url": "http://www.fedex.com/",
                "required_fields": [],
                "optional_fields": []
            },
            {
                "slug": "dx",
                "name": "DX",
                "phone": "+44 0844 826 1178",
                "other_name": "DX Freight",
                "web_url": "https://www.thedx.co.uk/",
                "required_fields": [
                    "tracking_postal_code"
                ],
                "optional_fields": []
            }
        ]
    }
}