Shipping Carriers API Overview

You can manage carriers and carrier credentials via the Shipping Admin APIs. 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

If a carrier configuration does not already exist for the carrier, you will have to create one (as well as a carrier credential set) before configuring the actual credentials. In most cases, these will automatically be created and you can skip ahead to the Carrier Credentials API.

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

A credential set is used to store a list of key-value pairs for a carrier, such as an account ID and password. The required fields vary and must match the metadata defined for the carrier. A single credential set can be assigned to multiple sites, location groups, or locations.

Call Create Carrier Credential Set to create the initial credential set.

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

The request body should be similar to the below template, which uses example fields for FedEx. 

{
    "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.