Carrier accounts
You can create, modify, delete, and specify which shipping carriers you want to use via the Shippo API. This allows you to connect your shipping account to compare and purchase different Rates for each Shipment. Once you add your own account, you will get your negotiated rates from your carrier account.
You can also manually connect to carriers through the Carriers page of your Shippo Dashboard.
Default Carrier Accounts
You won't need to sign up for a new carrier account to start testing or shipping on Shippo. By default, you have access to Shippo's discounted master accounts for U.S. outbound shipments to retrieve shipping rates and purchase labels.
If you want to use your own carrier account, continue this tutorial.
Create a Carrier Account Object
Each carrier has different account properties. For instance, while FedEx requires an account number and a meter number, UPS asks you for a UPS account number, user ID and password. Each Carrier Account object will have a unique object_id
that you will need to reference in your API calls.
The Carrier Account object can be created (POST), modified or de-activated (PUT), or retrieved (GET). You can also list (GET) all accounts.
Here's how you create a carrier account:
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>"}'
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)
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)
$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
));
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
});
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);
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:
{
"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": ""
}
See our list of supported carriers and capabilities here ▸
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.
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
shipment = Shippo::Shipment.create(
:address_from => address_from,
:address_to => address_to,
:parcels => parcel,
:carrier_accounts => ["b741b99f95e841639b54272834bc478c"],
:async => false)
shipment = shippo.Shipment.create(
address_from= address_from,
address_to= address_to,
parcels= [parcel],
carrier_accounts= ['b741b99f95e841639b54272834bc478c'],
async= False)
$shipment = Shippo_Shipment::create(array(
'address_from'=> $fromAddress,
'address_to'=> $toAddress,
'parcels'=> array($parcel),
'carrier_accounts' => array('b741b99f95e841639b54272834bc478c'),
'async' => false
));
shippo.shipment.create({
"address_from": addressFrom,
"address_to": addressTo,
"parcels": [parcel],
"carrier_accounts": ['b741b99f95e841639b54272834bc478c'],
"async": false
}, function(err, shipment) {
// asynchronously called
});
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);
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
:
curl https://api.goshippo.com/carrier_accounts/?carrier=fedex\
-H "Authorization: ShippoToken <API_TOKEN>"\
Shippo::CarrierAccount.all(:carrier => "fedex")
shippo.CarrierAccount.all(carrier="fedex")
Shippo_CarrierAccount::all(array('carrier'=> 'fedex'))
shippo.carrieraccount.list({ carrier: 'fedex' }, function(err, response) {
// asynchronously called
});
CarrierAccount.getByCarrier("fedex");
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
{
"carrier": "apc_postal",
"account_id": "12345", // APC Postal Account ID
"parameters": {
"processing_site": "NJ" // APC Postal Processing Site
},
...
}
APG
{
"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
{
"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
{
"carrier": "australia_post",
"account_id": "123456", // Australia Post account number
"parameters": {
"api_key": "yourapikey", // Australia Post API key
"password": "testpass" // Australia Post password
},
...
}
BetterTrucks
{
"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
{
"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
{
"carrier": "couriersplease",
"account_id": "123456", // CouriersPlease account number
"parameters": {
"api_key": "yourapikey" // CouriersPlease API key
},
...
}
Deutsche Post
{
"carrier": "deutsche_post",
"account_id": "test@test.com", // Deutsche Post username
"parameters": {
"password": "testpass" // Deutsche Post password
},
...
}
DHL eCommerce
{
"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
{
"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
{
"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
{
"carrier": "dpd_uk",
"account_id": "abc123", // DPD UK Account Name
"parameters": {
"username": "USERNAME", // DPD UK Username
"password": "PASSWORD" // DPD UK Password
},
...
}
ePost Global
{
"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.
{
"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
{
"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
{
"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
{
"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
{
"carrier": "lasership",
"account_id": "01isf7yzmpsbfy02172gyu2ek78", // LaserShip API key
"parameters": {
"lasership_apiid": "c27908r07cc20r893270adsc0402", // LaserShip API ID
"critical_pull_time": "16:00"
},
...
}
Mondial Relay
{
"carrier": "mondialrelay",
"account_id": "9328271", // Mondial Relay merchant ID
"parameters": {
"key": "JBHOS29JH19N7V6SJ89MK10K" // Mondial Relay key
},
...
}
OnTrac
{
"carrier": "ontrac",
"account_id": "37", // OnTrac account number
"parameters": {
"password": "testpass" // OnTrac provided password
},
...
}
Purolator
"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
{
"carrier": "sendle",
"account_id": "sendle_account_1",
"parameters": {
"sendle_id": "1234",
"api_key": "123456789",
},
...
}
Swyft
{
"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
{
"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
{
"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)
},
...
}