Get your carriers

Many Shipping API operations involve defining shipping rules, which enable you to search for an optimal subscribed carrier service for a consignment. Before creating any shipping rules, you can retrieve the carrier services associated with your Metapack shipper account because a shipping rule must specify at least one of the carrier services associated with your account. However, before you search for carrier services, you must first identify which carriers are associated with your account.

Get carriers request

You need the following to make a get carriers request.

Data Description
Carriers You cannot retrieve carrier data if carriers are not configured for your Metapack shipper account.

Use the Get your carriers operation to return the carriers associated with your Metapack shipper account.

Example request

Copy
Copied
GET /shipping/v1/carriers HTTP/1.1
Host: api.metapack.com
API-Key: Basic Base64-encoded <username>:<password>
Content-Type: application/json

Get carriers response

200 (OK)

Carrier names and codes are returned for your account. You need to extract the code of each (desired) carrier.

Example response

Copy
Copied
[
    {
        "code": "DP05",
        "name": "Deutsche Post International"
    },
    {
        "code": "ROYALMAIL",
        "name": "Royal Mail"
    }
]

Related tasks