List Carriers
The /v2/carriers endpoint can return a lot of useful information about the carriers available to your account. The most important of which is the carrier_id. Each of your carriers has a unique carrier_id, which you'll use to specify the carrier account for many commonly used endpoints.
For example, when purchasing a label, you'll explicitly specify the carrier_id for the account the label should come from. Similarly, when rate shopping, you may want to specify the carrier_id of the account that you know has the best rates for the type of package you are shipping.
You can also use this endpoint in a few different ways, depending on what you need:
- List Carriers: Returns a list of all your available carriers and their details (including
carrier_id,carrier_code,account_number), a list of all the carriers’ available services and their attributes, a list of the carriers’ available package types and their attributes, and a list of all the carriers’ available options. - Get a single carrier: Returns a list of services, package types, and options for the specified
carrier_id. - List Carrier Services: Returns a list of services and service attributes for the specified
carrier_id. - List Carrier Package Types: Returns a list of available package types for the specified
carrier_id. - List Carrier Options: Returns a list of the available advanced options for a specified
carrier_id. Advanced options include the ability to ship alcohol or dangerous goods, bill to a third-party account, and much more.
Requirements
- You’ll need the
carrier_idfor all except the List Carriers call.
List Carriers: Sample Request
GET /v2/carriers/
Depending on how many carriers you have connected to your account, the response can be quite long, as it includes all services, package types, and options available for each carrier. This sample response is truncated to a single carrier with its package types and options (in this case, no options are available for this carrier).
- Production https://api.shipstation.com/v2/carriers
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://api.shipstation.com/v2/carriers \
-H 'api-key: YOUR_API_KEY_HERE'{ "carriers": [ { … } ], "request_id": "aa3d8e8e-462b-4476-9618-72db7f7b7009", "errors": [ { … } ] }
Get a Single Carrier: Sample Request
GET /v2/carriers/:carrier_id
- Production https://api.shipstation.com/v2/carriers/{carrier_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api.shipstation.com/v2/carriers/{carrier_id}' \
-H 'api-key: YOUR_API_KEY_HERE'{ "carrier_id": "se-8412", "carrier_code": "dhl_express", "account_number": "account_570827", "requires_funded_amount": true, "balance": 3799.52, "nickname": "ShipStation Account - Stamps.com", "friendly_name": "Stamps.com", "funding_source_id": "se-28529731", "primary": true, "has_multi_package_supporting_services": true, "supports_label_messages": true, "disabled_by_billing_plan": true, "services": [ { … } ], "packages": [ { … } ], "options": [ { … } ], "send_rates": true, "supports_user_managed_rates": true }
List Carrier Services: Sample Request
GET /v2/carriers/:carrier_id/services
- Production https://api.shipstation.com/v2/carriers/{carrier_id}/services
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api.shipstation.com/v2/carriers/{carrier_id}/services' \
-H 'api-key: YOUR_API_KEY_HERE'{ "services": [ { … } ] }
List Carrier Package Types: Sample Request
GET /v2/carriers/:carrier_id/packages
- Production https://api.shipstation.com/v2/carriers/{carrier_id}/packages
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api.shipstation.com/v2/carriers/{carrier_id}/packages' \
-H 'api-key: YOUR_API_KEY_HERE'{ "packages": [ { … } ] }
List Carrier Options: Sample Request
This example uses UPS as the carrier since UPS offers a wide variety (but not an exhaustive list) of potential advanced options.
GET /v2/carriers/:carrier_id/options
- Production https://api.shipstation.com/v2/carriers/{carrier_id}/options
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://api.shipstation.com/v2/carriers/{carrier_id}/options' \
-H 'api-key: YOUR_API_KEY_HERE'{ "options": [ { … } ] }