Carrier accounts

The Shippo API uses carrier accounts to connect to carriers to use their services, such as purchasing a label. You can use the Shippo API to add, modify, and deactivate which carriers your Shippo account uses. Using the Shippo API, you can connect multiple carrier accounts giving you rates from multiple carriers when you create a shipment.

Shippo supports two types of carrier accounts.

  1. Shippo carrier account. These are Shippo’s accounts with specific carriers. Using Shippo carrier accounts you can purchase labels immediately, without creating your account with a carrier. The cost to purchase labels is billed through your Shippo account. Using Shippo carrier accounts you can benefit from discounts negotiated by Shippo.
  2. Your own carrier accounts. These are accounts that you have created yourself with a supported carrier. You can add your carrier account details to your Shippo account, allowing Shippo to manage your label creation. The cost of purchasing labels is billed through the account you created with your carrier.

Connecting Shippo carrier accounts

By default, you have access to Shippo's carrier accounts for U.S. outbound shipments to retrieve shipping rates and purchase labels. When Shippo adds new carrier accounts, they are automatically enabled on your account.

note

UPS requires Terms and Conditions to be accepted, so you must use the Shippo Web App and navigate to the Carriers Settings page and click "Activate Account" for UPS to view and accept the Terms and Conditions.

Connecting your own carrier account

You can connect your own carrier accounts using the Shippo Web App or through the API.

Follow this guide to learn about connecting your carriers using the Shippo API. Shippo supports all carriers listed below for your own carrier accounts.

To connect your carrier account to your Shippo account, you must create a carrier account object. Each carrier account has different properties that must be shared with Shippo. Refer to the list below to identify which properties are required for your chosen carrier.

Note

Before continuing, you must have created your account with your chosen carrier and obtained the required properties as listed below.

The Carrier Account object can be created (POST), modified or de-activated (PUT), or retrieved (GET). You can also list (GET) all accounts.

To connect your own carrier account and create a carrier account object, follow this example.

cURLRubyPythonPHPNodeJavaC#
Copy
Copied
curl https://api.goshippo.com/carrier_accounts/\
    -H "Authorization: ShippoToken <API_TOKEN>"\
    -d carrier="fedex"\
    -d account_id="<YOUR-FEDEX-ACCOUNT-NUMBER>"\
    -d parameters='{"first_name": "<YOUR_FIRST_NAME>", "last_name": "YOUR_LAST_NAME", "phone_number": "<YOUR_PHONE_NUMBER>", "from_address_st": "<YOUR_STREET_ADDRESS>", "from_address_city": "<YOUR_CITY>", "from_address_state": "<YOUR_STATE>", "from_address_zip": "<YOUR_ZIP>", "from_address_country_iso2": "<YOUR_COUNTRY>"}'
Copy
Copied
fedex_account = Shippo::CarrierAccount.create(
    :carrier => 'fedex',
    :account_id => '<YOUR-FEDEX-ACCOUNT-NUMBER>',
    :parameters => {:first_name => '<YOUR_FIRST_NAME>', :last_name => 'YOUR_LAST_NAME', :phone_number => '<YOUR_PHONE_NUMBER>', :from_address_st => '<YOUR_STREET_ADDRESS>', :from_address_city => '<YOUR_CITY>', :from_address_state => '<YOUR_STATE>', :from_address_zip => '<YOUR_ZIP>', :from_address_country_iso2 => '<YOUR_COUNTRY>'},
    :test => false,
    :active => true)
Copy
Copied
fedex_account = shippo.CarrierAccount.create(
        carrier= "fedex",
        account_id= "<YOUR-FEDEX-ACCOUNT-NUMBER>",
        parameters= {
            "first_name": "<YOUR_FIRST_NAME>",
            "last_name": "YOUR_LAST_NAME",
            "phone_number": "<YOUR_PHONE_NUMBER>",
            "from_address_st": "<YOUR_STREET_ADDRESS>",
            "from_address_city": "<YOUR_CITY>",
            "from_address_state": "<YOUR_STATE>",
            "from_address_zip": "<YOUR_ZIP>",
            "from_address_country_iso2": "<YOUR_COUNTRY>"
        },
        test= False,
        active= True)
Copy
Copied
$fedex_account = Shippo_CarrierAccount::create(array(
    'carrier' => 'fedex',
    'account_id' => '<YOUR-FEDEX-ACCOUNT-NUMBER>',
    'parameters' => array('first_name' => '<YOUR_FIRST_NAME>', 'last_name' => 'YOUR_LAST_NAME', 'phone_number' => '<YOUR_PHONE_NUMBER>', 'from_address_st' => '<YOUR_STREET_ADDRESS>', 'from_address_city' => '<YOUR_CITY>', 'from_address_state' => '<YOUR_STATE>', 'from_address_zip' => '<YOUR_ZIP>', 'from_address_country_iso2' => '<YOUR_COUNTRY>'),
    'test' => false,
    'active' => true
));
Copy
Copied
shippo.carrieraccount.create({
    "carrier":"fedex", 
    "account_id":"<YOUR-FEDEX-ACCOUNT-NUMBER>", 
    "parameters":{"meter":"<YOUR-FEDEX-METER-NUMBER>"},
    "test":true,
    "active":true
}, function(err, account) {
  // asynchronously called
});
Copy
Copied
HashMap<String, Object> accountMap = new HashMap<String, Object>();
accountMap.put("carrier", "fedex");
accountMap.put("account_id", "<YOUR-FEDEX-ACCOUNT-NUMBER>"); 
accountMap.put("parameters", new HashMap<String, Object>() {
    {
        put("first_name", "<YOUR_FIRST_NAME>");
        put("last_name", "YOUR_LAST_NAME");
        put("phone_number", "<YOUR_PHONE_NUMBER>");
        put("from_address_st", "<YOUR_STREET_ADDRESS>");
        put("from_address_city", "<YOUR_CITY>");
        put("from_address_state", "<YOUR_STATE>");
        put("from_address_zip", "<YOUR_ZIP>");
        put("from_address_country_iso2", "<YOUR_COUNTRY>");
    }
});
accountMap.put("test", Boolean.FALSE);
accountMap.put("active", Boolean.TRUE);

CarrierAccount fedex_account = CarrierAccount.create(accountMap);
Copy
Copied
Hashtable accountTable = new Hashtable ();
accountTable.Add ("carrier", "fedex");
accountTable.Add ("account_id", "<YOUR-FEDEX-ACCOUNT-NUMBER>");
accountTable.Add ("parameters", new Hashtable(){
        {"first_name": "<YOUR_FIRST_NAME>"},
        {"last_name": "YOUR_LAST_NAME"},
        {"phone_number": "<YOUR_PHONE_NUMBER>"},
        {"from_address_st": "<YOUR_STREET_ADDRESS>"},
        {"from_address_city": "<YOUR_CITY>"},
        {"from_address_state": "<YOUR_STATE>"},
        {"from_address_zip": "<YOUR_ZIP>"},
        {"from_address_country_iso2": "<YOUR_COUNTRY>"}
});
accountTable.Add ("test", false);
accountTable.Add ("active", true);

CarrierAccount fedexAccount = resource.CreateCarrierAccount(accountTable)

The API will respond with the JSON serialized carrier account object:

Copy
Copied
{
    "account_id": "<YOUR-FEDEX-ACCOUNT-NUMBER>",
    "active": true,
    "carrier": "fedex",
    "object_id": "b741b99f95e841639b54272834bc478c",
    "object_owner": "shippotle@shippo.com",
    "parameters": {
        "first_name": "<YOUR_FIRST_NAME>",
        "last_name": "YOUR_LAST_NAME",
        "phone_number": "<YOUR_PHONE_NUMBER>",
        "from_address_st": "<YOUR_STREET_ADDRESS>",
        "from_address_city": "<YOUR_CITY>",
        "from_address_state": "<YOUR_STATE>",
        "from_address_zip": "<YOUR_ZIP>",
        "from_address_country_iso2": "<YOUR_COUNTRY>"
    },
    "test": false,
    "active": true,
    "is_shippo_account": false,
    "metadata": ""
}

Refer to our carrier capabilities for a full list of supported carriers and their capabilities.

Using carrier accounts in Shipments

You can specify which carrier accounts you want to use on a per-shipment basis by passing in each account's object_id in the shipment's carrier_accounts field as a list. If you don't specify which accounts to use, Shippo will use all your active accounts for this shipment.

cURLRubyPythonPHPNodeJavaC#
Copy
Copied
curl https://api.goshippo.com/shipments/\
    -H "Authorization: ShippoToken <API_TOKEN>"\
    -d address_from="d799c2679e644279b59fe661ac8fa488"\
    -d address_to="42236bcf36214f62bcc6d7f12f02a849"\
    -d parcels=["7df2ecf8b4224763ab7c71fae7ec8274"]\
    -d carrier_accounts=["b741b99f95e841639b54272834bc478c", "b741b99f95e841639b54272834bc478c" ]\
    -d async=false
Copy
Copied
shipment = Shippo::Shipment.create(
	:address_from => address_from,
	:address_to => address_to,
	:parcels => parcel,
	:carrier_accounts => ["b741b99f95e841639b54272834bc478c"],
	:async => false)
Copy
Copied
shipment = shippo.Shipment.create(
		address_from= address_from,
		address_to= address_to,
		parcels= [parcel],
		carrier_accounts= ['b741b99f95e841639b54272834bc478c'],
		async= False)
Copy
Copied
$shipment = Shippo_Shipment::create(array(
    'address_from'=> $fromAddress,
    'address_to'=> $toAddress,
    'parcels'=> array($parcel),
    'carrier_accounts' => array('b741b99f95e841639b54272834bc478c'),
    'async' => false
));
Copy
Copied
shippo.shipment.create({
		"address_from": addressFrom,
		"address_to": addressTo,
		"parcels": [parcel],
		"carrier_accounts": ['b741b99f95e841639b54272834bc478c'],
		"async": false
}, function(err, shipment) {
  // asynchronously called
});
Copy
Copied
HashMap<String, Object> shipmentMap = new HashMap<String, Object>();
shipmentMap.put("address_to", toAddressMap);
shipmentMap.put("address_from", fromAddressMap);
shipmentMap.put("parcels", parcelMap);
shipmentMap.put("carrier_accounts", new String[]{"b741b99f95e841639b54272834bc478c"});
shipmentMap.put("async", false);

Shipment shipment = Shipment.create(shipmentMap);
Copy
Copied
shippo.shipment.create({
		"address_from": addressFrom,
		"address_to": addressTo,
		"parcel": parcels,
		"carrier_accounts": ["b741b99f95e841639b54272834bc478c"],
		"async": false})

Filtering carrier accounts

You can filter carrier accounts by carrier and account_id:

cURLRubyPythonPHPNodeJavaC#
Copy
Copied
curl https://api.goshippo.com/carrier_accounts/?carrier=fedex\
    -H "Authorization: ShippoToken <API_TOKEN>"\
Copy
Copied
Shippo::CarrierAccount.all(:carrier => "fedex")
Copy
Copied
shippo.CarrierAccount.all(carrier="fedex")
Copy
Copied
Shippo_CarrierAccount::all(array('carrier'=> 'fedex'))
Copy
Copied
shippo.carrieraccount.list({ carrier: 'fedex' }, function(err, response) {
    // asynchronously called
});
Copy
Copied
CarrierAccount.getByCarrier("fedex");
Copy
Copied
Hashtable queryParams = new Hashtable();
queryParams.Add("carrier","fedex");
ShippoCollection<CarrierAccount> filteredCarrierAccounts = resource.AllCarrierAccount(queryParams);

Account structure by carrier

Each carrier has its own type of fields. Browse the list below to find the required fields for the carriers you want to use.

APC Postal


Copy
Copied
{
    "carrier": "apc_postal",
    "account_id": "12345", // APC Postal Account ID
    "parameters": {
              "processing_site": "NJ" // APC Postal Processing Site
               },
    ...
}

APG


Copy
Copied
{
   "carrier": "apg",
   "account_id": "12345", // Unique identificator of account
   "parameters": {
       "account_id": "shippo", // APG Account username
       "password": "shippo", // APG Account password
       "sender_code": "sti.us.sender_code" // APG Sender Code
    }
}

Asendia


Copy
Copied
{
    "carrier": "asendia_us",
    "account_id": "123", // Asendia account number
    "parameters": {
        "asendia_user_login": "usertesting",  // Asendia user login
        "asendia_user_password": "1234512345",  // Asendia user password
        "ftp_username": "testtest",
        "ftp_password": "xyz123",
        "company_name": "Your Company Name", // Required (displays on manifest)
        "permit_no": "234"
    },
    ...
}

Australia Post


Copy
Copied
{
    "carrier": "australia_post",
    "account_id": "123456", // Australia Post account number
    "parameters": {
        "api_key": "yourapikey", // Australia Post API key
        "password": "testpass" // Australia Post password
    },
    ...
}

BetterTrucks


Copy
Copied
{
    "carrier": "better_trucks",
    "account_id": "100", // unique identifier of account
    "parameters": {
        "api_key": "XXXX-XXXXX-XXXXX",  // API Key provided by BetterTrucks
        "account_id": "100"  // Identifier for account
    },
    "test": false,
    "active": true
}

Canada Post


Copy
Copied
{
    "carrier": "canada_post",
    "account_id": "shippo_api", // Canada Post API username
    "parameters": {
        "api_password": "HipposDontLie!", // Canada Post API password
        "customer_number": "413781", // Canada Post customer number
        "contract_id": "910412", // Canada Post contract number (optional)
        "payment_method": "Account" // Payment method for account, 'CreditCard' or 'Account' (optional)
        "use_manifests": true // Indicates that shipments will be linked with a manifest (contract customers only; optional)
    },
    ...
}

CouriersPlease


Copy
Copied
{
    "carrier": "couriersplease",
    "account_id": "123456", // CouriersPlease account number
    "parameters": {
        "api_key": "yourapikey" // CouriersPlease API key
    },
    ...
}

Deutsche Post


Copy
Copied
{
    "carrier": "deutsche_post",
    "account_id": "test@test.com", // Deutsche Post username
    "parameters": {
        "password": "testpass" // Deutsche Post password
    },
    ...
}

DHL eCommerce


Copy
Copied
{
    "carrier": "dhl_ecommerce",
    "account_id": "dhl_ecommerce", // Custom account identifier
    "parameters": {
        "username": "HipposDontLie!", // DHL eCommerce client ID
        "password": "shipshippo", // DHL eCommerce client secret
        "pickup_no": "123123", // DHL eCommerce pickup number
        "facility_code": "23" // DHL eCommerce facility code
    },
    ...
}

DHL Express


Copy
Copied
{
    "carrier": "dhl_express",
    "account_id": "123456789", // DHL account number
    "parameters": {
        "password": "", // Password from DHL Express
        "site_id": "", // Site ID from DHL Express
        "payment_country": "US" // ISO2 code of the country associated with the account
    },
    "active": true,
    "is_shippo_account": false
}

DHL Germany


Copy
Copied
{
    "carrier": "dhl_germany",
    "account_id": "2222222222", // The first 10 digits of your DHL account number
    "parameters": {
        "business_customer_portal_username": "dhl_shippo", // DHL username for www.dhl-geschaeftskundenportal.de
        "business_customer_portal_password": "HipposDontLie!", // DHL password for www.dhl-geschaeftskundenportal.de
        "default_participation_code": "01", // The last 2 digits of your DHL account number
        "tracking_account": "978346", // DHL tracking account (optional)
        "tracking_password": "HipposAreBack!" // DHL tracking password (optional)
    },
    ...
}

DPD UK


Copy
Copied
{
  "carrier": "dpd_uk",
  "account_id": "abc123", // DPD UK Account Name
  "parameters": {
    "username": "USERNAME", // DPD UK Username
    "password": "PASSWORD" // DPD UK Password
  },
  ...
}

ePost Global


Copy
Copied
{
  "carrier": "rr_donnelley",
  "account_id": "1111",
  "parameters": {
    "processing_site": "LAX"
    "company_name": "Company"
  },
  ...
}

EVRi UK


Note

Hermes UK have changed their name to EVRi. To support existing customers already using this carrier, we have continued to use the hermes name in our API configuration.

Copy
Copied
{
    "carrier": "hermes_uk",
    "account_id": "hermes_account_1",
    "parameters": {
              "hermes_uk_api_user": "user-name",
              "hermes_uk_api_password": "1234qwerty",
              "hermes_uk_client_id": 123,
              "hermes_uk_client_name": "CompanyName",
              "hermes_uk_parcel_shop_api_user": "ABC1234",
              "hermes_uk_parcel_shop_api_password": "12345678"
               },
    ...
}

FedEx


Copy
Copied
{
  "carrier": "fedex",
  "account_id": "321123", //Fedex account number
  "parameters": {
      "first_name": "Hippo",  //Your first name
      "last_name": "Hippovich", // Your last name
      "phone_number": "1234567890", // Your phone number
    "smartpost_id": 5902, // Smartpost Hub ID (optional)
    "from_address_st": "250 Union St", // Shipping address must match what you have on file with FedEx (see fedex.com profile)
    "from_address_city": "San Francisco",
    "from_address_state": "CA",
    "from_address_zip": "94133",
    "from_address_country_iso2": "US"
  },
  "active": true,
  "test": false
}

Globegistics


Copy
Copied
{
    "carrier": "globegistics",
    "account_id": "Name of this account", // The name of this account on Shippo
    "parameters": {
              "account_number": "123456", // Globegistics Account Number
              "api_key": "123456789", // Globegistics API Key
               },
    ...
}

GLS US


Copy
Copied
{
    "carrier": "gls_us",
    "account_id": "1111", // GLS US account number
    "parameters": {
    	"api_token": "your_account_pw", // GLS US account password
	"username": "your_account_username", // GLS US account username
    },
...
}

LaserShip


Copy
Copied
{
    "carrier": "lasership",
    "account_id": "01isf7yzmpsbfy02172gyu2ek78", // LaserShip API key
    "parameters": {
        "lasership_apiid": "c27908r07cc20r893270adsc0402", // LaserShip API ID
        "critical_pull_time": "16:00"
    },
    ...
}

Mondial Relay


Copy
Copied
{
    "carrier": "mondialrelay",
    "account_id": "9328271", // Mondial Relay merchant ID
    "parameters": {
        "key": "JBHOS29JH19N7V6SJ89MK10K" // Mondial Relay key
    },
    ...
}

OnTrac


Copy
Copied
{
    "carrier": "ontrac",
    "account_id": "37", // OnTrac account number
    "parameters": {
        "password": "testpass" // OnTrac provided password
    },
    ...
}

Purolator


Copy
Copied
    "carrier": "purolator",
    "account_id": "shippo_purolator", // Purolator account number
    "parameters": {
        "production_key": "345345", // Purolator production key
        "production_key_password": "abcdef" // Purolator production key password
    },
    ...
}

Sendle


Copy
Copied
{
    "carrier": "sendle",
    "account_id": "sendle_account_1",
    "parameters": {
              "sendle_id": "1234",
              "api_key": "123456789",
               },
    ...
}

Swyft


Copy
Copied
{
    "carrier": "swyft",
    "object_owner": "user@shippo.com",
    "account_id": "unique_account_id",
    "parameters": {
        "api_key": "11111-22222-33333-44444" // Swyft API Key
    },
    "test": false,
    "active": true,
    "is_shippo_account": false,
    "metadata": "Account Name",
    "carrier_name": "Swyft"
}

UDS


Copy
Copied
{
    "carrier": "uds",
    "account_id": "12345", // UDS Client ID
    "parameters": {
      "client_key": "grteehj54tjgf", // UDS Client Key
      "UDS_TRACK_API_USER_ID": "shippo", // UDS Username for tracking
      "UDS_TRACK_API_PASSWORD": "shippo", // UDS Password for tracking
    }
}

UPS


Copy
Copied
{
    "carrier": "ups",
    "account_id": "myupsuser", // UPS user ID
    "parameters": {
        "password": "HipposDontLie!", // UPS password
        "account_number": "AB1234", // UPS account number
        "surepost": false, // Add Surepost rating (optional)
        "cost_center": "shippo", // Mail Innovations cost center (optional)
        "usps_endorsement": "3", // Mail Innovations USPS endorsement (optional)
        "customer_id": "1234", // Mail Innovations UPS customer ID (optional)
        "customer_guid": "1234-abcde" // Mail Innovations UPS customer GUID (optional)
    },
    ...
}

Veho

Copy
Copied
{
    "carrier": “veho”,
    "account_id": "Name of this account", // The name of this account on Shippo
    "parameters": {
              "api_key": "123456789", // Veho API Key
               },
    "test": false,
    "active": true,
}