Detect courier

post
/couriers/detect

Return a list of matched couriers based on tracking number format and selected couriers or a list of couriers.

Content-Type
string
required

Content-Type

Allowed value:
application/json
Default:
application/json
Example:
application/json

Detect courier request

tracking_number
string
required

Tracking number of a shipment.

Example:
RA123456879US
slug
array[string]

If not specified, Aftership will automatically detect the courier based on the tracking number format and your selected couriers. Use array to input a list of couriers for auto detect. Cannot be used with slug_group at the same time.

destination_postal_code
string

The postal code of receiver's address. Required by some couriers. Refer to this page for more details

tracking_ship_date
string

Shipping date in YYYYMMDD format. Required by some couriers. Refer to this page for more details

tracking_account_number
string

Account number of the shipper for a specific courier. Required by some couriers. Refer to this page for more details

tracking_key
string

Key of the shipment for a specific courier. Required by some couriers. Refer to this page for more details

destination_state
string

State of the destination shipping address of the shipment. Required by some couriers.

slug_group
string

Slug group is a group of slugs which belong to same courier. For example, when you inpit "fedex-group" as slug_group, AfterShip will detect the tracking with "fedex-uk", "fedex-fims", and other slugs which belong to "fedex". It cannot be used with slug at the same time. (See slug_groups definition)

Example:
fedex-group
origin_country_region
string

Enter ISO Alpha-3 (three letters) to specify the origin of the shipment (e.g. USA for United States).

destination_country_region
string

Enter ISO Alpha-3 (three letters) to specify the destination of the shipment (e.g. USA for United States).

Couriers object

Model of all couriers endpoint response

meta
meta
required

Meta data

code
integer
required

meta code

Example:
200
message
string

error message, only exist if the response status is not 2xx

type
string

error type, only exist if the response status is not 2xx

Allowed values:
BadRequestUnauthorizedForbiddenNotFoundTooManyRequestsInternalError
data
object
required
total
integer

Total count of courier objects

couriers
array[Courier]

Array of Courier object.

Auth
:
Parameters
:
Body
{ "tracking_number": "906587618687" }
{ "meta": { "code": 200 }, "data": { "total": 1, "couriers": [ { "slug": "ups-api", "name": "UPS", "phone": "+1 800 742 5877", "other_name": "United Parcel Service", "web_url": "https://www.ups.com", "required_fields": [], "optional_fields": [], "default_language": "en", "support_languages": [ "en" ], "service_from_country_regions": [], "credentials": { "fields": [ { "name": "user_id", "type": "string", "required": true }, { "name": "password", "type": "string", "required": true }, { "name": "access_license_number", "type": "string", "required": true } ] } } ] } }