Get your carrier services

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.

Get carrier services request

You need the following to make a get carrier services request.

Data/Parameter Description
Carriers You cannot retrieve carrier data if carriers are not configured for your Metapack shipper account.
carrierCode The code of each carrier (associated with your account) returned by the Get your carriers operation.

Using the Get your carrier services operation, enter the carrierCode of the relevant carrier.

Example request

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

Get carrier services response

200 (OK)

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

Example response

Copy
Copied
[
    {
        "code": "DP05PACKETPLUS",
        "name": "Packet Plus"
    },
    {
        "code": "DP05PACKETPRIORITY",
        "name": "Packet Priority"
    },
    {
        "code": "DP05PACKETSTANDARD",
        "name": "Packet Standard"
    }
]

Related tasks