Shipping Carriers API Overview

You can manage carriers and carrier credentials via the Shipping Admin APIs (also known as Shipping Runtime or SRT). The Shipping Admin APIs have replaced the former Carrier Service API (also known as CARS), so all management of credentials via API should be done through the endpoints detailed below.

For information about configuring carriers in the Admin UI instead of via API, see the Shipping Carriers user guide. Additionally, see the Location Group documentation for details on how to enable carriers for locations.

Configure Carriers and Credentials

You will have to create a carrier configuration and a carrier credential set before configuring the actual credentials.

Carrier Configuration API

The Carrier Configuration API can initialize and update a basic carrier configuration. This must be done first before setting any credentials on the carrier account.

POST .../api/commerce/shipping/admin/carriers/{carrierID}

The request body should follow the below template. For more details, see the API schema.

{
    "id": "carrierId",
    "enabled": true,
    "enabledForReturns": false,
    "settings": [],
    "customTableRates": [],
    "areCredentialsSet": false
}

You can also perform GET, PUT, and DELETE calls to this same endpoint to retrieve, update, and remove carrier configurations.

Carrier Credential Set API

Next, call Create Carrier Credential Set to create the initial credential set.

POST .../api/commerce/shipping/admin/carriers/credential-sets/{carrierID}

The request body should follow the below template. Enter your API developer credentials here, not the carrier credentials. 

{
    "carrierId": "string",
    "code": "string",
    "name": "string",
    "values": [
        {
            "key": "accountnumber",
            "value": "string"
        },
        {
            "key": "apipassword",
            "value": "string"
        },
        {
            "key": "apiusername",
            "value": "string"
        },
        {
            "key": "meternumber",
            "value": "string"
        },
        {
            "key": "pickuptype",
            "value": "string"
        }

    ]
}

You can also perform GET, PUT, and DELETE calls to this same endpoint to retrieve, update, and remove carrier credential sets.

Carrier Credentials API

Finally, you can add carrier credentials with the Create Carrier Credentials call.

POST .../api/commerce/shipping/admin/carriers/credentials/{carrierId}

The request body should follow the below template. The locationCode and locationGroupCode are optional— by default, credentials are created at the site level. If location or location group credentials are not configured for a particular fulfillment location, then it will fall back to using those site-level credentials. Providing a location or location group will set these credentials as an override at that lower level.

{
   "carrierId": "string",
   "siteId": "string",
   "locationCode": "string", 
   "locationGroupCode": "string", 
   "credentialSet": {
      "carrierId": "string",
      "code": "string"
   }
}

You can also perform GET, PUT, and DELETE calls to this same endpoint to retrieve, update, and remove carrier credentials.