Use this API to integrate with the Shippo service
- Create a new address
Shippo external API. (2018-02-08)
First-time users and those looking for specific integration tutorials,
see our full API documentation and guides.
Download the API Specification yaml file
API Resources
All API URLs listed in this documentation are relative to https://api.goshippo.com/.For example, the /addresses/ resource is reachable at https://api.goshippo.com/addresses/.
Authentication
The API requires Shippo's token HTTP Authentication with your Shippo token (live or test).In order to authenticate properly, please put Authorization: ShippoToken <token> in your header. You can find your token on the Shippo API settings page.
For more information about authentication and test mode, please visit our Authentication guide.
The API is available via Secure Socket Layer (SSL) only. All requests to the Shippo API must use TLS version 1.2 or higher.
Request & Response Data
Request data is passed to the API by POSTing JSON objects with the appropriate key/value-pairs to the respective resource. The documentation for each API resource contains more details on the values accepted by a given resource.Response data also formatted as JSON object. You can specify how many results per page are to be returned. For instance, /rates/?results=25 will return up to 25 results.
REST & Disposable Objects
The Shippo API is built around REST principles. Use POST requests to create objects, GET requests to retrieve objects, and PUT requests to update objects.Only the Carrier Accounts object can be updated via PUT requests. All other objects such as Addresses, Parcels, Shipments, Rates, Transactions, Refunds, Customs Items, and Customs Declarations are disposable. This means that once you have created an object, you cannot change it. Instead, create a new one with the desired values.
API Version
This reference guide supports the Shippo API version: 2018-02-08 .
To see reference guides for older API versions, see our legacy reference guide. For more information about Shippo API versions, see our API versions guide.
Optional string used to pick a non-default API version to use. See our API version guide.
- https://api.goshippo.com/addresses
- cURL
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl https://api.goshippo.com/addresses/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"{ "next": "baseurl?page=3&results=10", "previous": "baseurl?page=1&results=10", "results": [ { … } ] }
Request
Creates a new address object. You can use address objects to create new shipments, calculate rates, and to create orders.
Optional string used to pick a non-default API version to use. See our API version guide.
Address details.
required for purchase
First and Last Name of the addressee
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Either company or name required; No length validation (first 35 chars printed on label) |
Company Name
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Max 35 characters; Either company or name required |
required for purchase
First street line. Usually street number and street name (except for DHL Germany, see street_no).
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | At least one street line required; Max 35 characters per line |
Second street line.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | At least one street line required; Max 35 characters per line |
Third street line. Only accepted for USPS international shipments, UPS domestic and UPS international shipments.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | At least one street line required; Max 35 characters per line |
Street number of the addressed building. This field can be included in street1 for all carriers except for DHL Germany.
required for purchase
Name of a city. When creating a Quote Address, sending a city is optional but will yield more accurate Rates. Please bear in mind that city names may be ambiguous (there are 34 Springfields in the US). Pass in a state or a ZIP code (see below), if known, it will yield more accurate results.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Required; Max 35 characters |
required for purchase for some countries
State/Province values are required for shipments from/to the US, AU, and CA. UPS requires province for some countries (i.e Ireland). To receive more accurate quotes, passing this field is recommended. Most carriers only accept two or three character state abbreviations.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Required if country requires state; Max 2 characters for US, CA, PR |
required for purchase
Postal code of an Address. When creating a Quote Addresses, sending a ZIP is optional but will yield more accurate Rates.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Max 10 characters |
ISO 3166-1 alpha-2 country codes and country names can be used. For most consistent results, we recommend using country codes like US or DE. If using country names, please ensure they are spelled correctly and in English. Country names are converted to country codes. Refer to this guide for a list of country codes. Sending a country is always required.
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Required; Min 1, max 15 characters |
E-mail address of the contact person, RFC3696/5321-compliant.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Max 80 characters |
A string of up to 100 characters that can be filled with any additional information you want to attach to the object.
- https://api.goshippo.com/addresses
- cURL
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl https://api.goshippo.com/addresses/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396" \
-d name="Shawn Ippotle" \
-d company="Shippo" \
-d street1="215 Clayton St." \
-d street2="" \
-d city="San Francisco" \
-d state="CA" \
-d zip=94117 \
-d country="US" \
-d phone="+1 555 341 9393" \
-d email="shippotle@shippo.com"\
-d is_residential=True\
-d metadata="Customer ID 123456"required for purchase
First and Last Name of the addressee
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Either company or name required; No length validation (first 35 chars printed on label) |
Company Name
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Max 35 characters; Either company or name required |
required for purchase
First street line. Usually street number and street name (except for DHL Germany, see street_no).
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | At least one street line required; Max 35 characters per line |
Second street line.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | At least one street line required; Max 35 characters per line |
Third street line. Only accepted for USPS international shipments, UPS domestic and UPS international shipments.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | At least one street line required; Max 35 characters per line |
Street number of the addressed building. This field can be included in street1 for all carriers except for DHL Germany.
required for purchase
Name of a city. When creating a Quote Address, sending a city is optional but will yield more accurate Rates. Please bear in mind that city names may be ambiguous (there are 34 Springfields in the US). Pass in a state or a ZIP code (see below), if known, it will yield more accurate results.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Required; Max 35 characters |
required for purchase for some countries
State/Province values are required for shipments from/to the US, AU, and CA. UPS requires province for some countries (i.e Ireland). To receive more accurate quotes, passing this field is recommended. Most carriers only accept two or three character state abbreviations.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Required if country requires state; Max 2 characters for US, CA, PR |
required for purchase
Postal code of an Address. When creating a Quote Addresses, sending a ZIP is optional but will yield more accurate Rates.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Max 10 characters |
ISO 3166-1 alpha-2 country codes and country names can be used. For most consistent results, we recommend using country codes like US or DE. If using country names, please ensure they are spelled correctly and in English. Country names are converted to country codes. Refer to this guide for a list of country codes. Sending a country is always required.
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Required; Min 1, max 15 characters |
E-mail address of the contact person, RFC3696/5321-compliant.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Max 80 characters |
A string of up to 100 characters that can be filled with any additional information you want to attach to the object.
Complete addresses contain all required values.
Incomplete addresses have failed one or multiple validations.
Incomplete Addresses are eligible for requesting rates but lack at least one required value for purchasing labels.
Date and time of Address creation.
Unique identifier of the given Address object. This ID is required to create a Shipment object.
Username of the user who created the Address object.
Date and time of last Address update. Since you cannot update Addresses after they were created, this time stamp reflects the time when the Address was changed by Shippo's systems for the last time, e.g., during the approximation of one or more values.
Object that contains information regarding if an address had been validated or not. Also contains any messages generated during validation. Children keys are is_valid(boolean) and messages(array).
{ "name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street2": "string", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "latitude": 0, "longitude": 0, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": { "is_valid": false, "messages": [ … ] }, "test": false }
Optional string used to pick a non-default API version to use. See our API version guide.
- https://api.goshippo.com/addresses/{AddressId}
- cURL
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl https://api.goshippo.com/addresses/d799c2679e644279b59fe661ac8fa488/ \
-H "Authorization: ShippoToken shippo_test_3a47d23c032ca626fce863c48d0f93d63a394396"required for purchase
First and Last Name of the addressee
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Either company or name required; No length validation (first 35 chars printed on label) |
Company Name
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Max 35 characters; Either company or name required |
required for purchase
First street line. Usually street number and street name (except for DHL Germany, see street_no).
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | At least one street line required; Max 35 characters per line |
Second street line.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | At least one street line required; Max 35 characters per line |
Third street line. Only accepted for USPS international shipments, UPS domestic and UPS international shipments.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | At least one street line required; Max 35 characters per line |
Street number of the addressed building. This field can be included in street1 for all carriers except for DHL Germany.
required for purchase
Name of a city. When creating a Quote Address, sending a city is optional but will yield more accurate Rates. Please bear in mind that city names may be ambiguous (there are 34 Springfields in the US). Pass in a state or a ZIP code (see below), if known, it will yield more accurate results.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Required; Max 35 characters |
required for purchase for some countries
State/Province values are required for shipments from/to the US, AU, and CA. UPS requires province for some countries (i.e Ireland). To receive more accurate quotes, passing this field is recommended. Most carriers only accept two or three character state abbreviations.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Required if country requires state; Max 2 characters for US, CA, PR |
required for purchase
Postal code of an Address. When creating a Quote Addresses, sending a ZIP is optional but will yield more accurate Rates.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Max 10 characters |
ISO 3166-1 alpha-2 country codes and country names can be used. For most consistent results, we recommend using country codes like US or DE. If using country names, please ensure they are spelled correctly and in English. Country names are converted to country codes. Refer to this guide for a list of country codes. Sending a country is always required.
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Required; Min 1, max 15 characters |
E-mail address of the contact person, RFC3696/5321-compliant.
Carrier-Specific Constraints:
| Carrier | Constraints |
|---|---|
| FedEx | Max 80 characters |
A string of up to 100 characters that can be filled with any additional information you want to attach to the object.
Complete addresses contain all required values.
Incomplete addresses have failed one or multiple validations.
Incomplete Addresses are eligible for requesting rates but lack at least one required value for purchasing labels.
Date and time of Address creation.
Unique identifier of the given Address object. This ID is required to create a Shipment object.
Username of the user who created the Address object.
Date and time of last Address update. Since you cannot update Addresses after they were created, this time stamp reflects the time when the Address was changed by Shippo's systems for the last time, e.g., during the approximation of one or more values.
Object that contains information regarding if an address had been validated or not. Also contains any messages generated during validation. Children keys are is_valid(boolean) and messages(array).
{ "name": "Shwan Ippotle", "company": "Shippo", "street1": "215 Clayton St.", "street2": "string", "street3": "", "street_no": "", "city": "San Francisco", "state": "CA", "zip": "94117", "country": "US", "phone": "+1 555 341 9393", "email": "shippotle@shippo.com", "is_residential": true, "metadata": "Customer ID 123456", "is_complete": true, "latitude": 0, "longitude": 0, "object_created": "2014-07-09T02:19:13.174Z", "object_id": "d799c2679e644279b59fe661ac8fa488", "object_owner": "shippotle@shippo.com", "object_updated": "2014-07-09T02:19:13.174Z", "validation_results": { "is_valid": false, "messages": [ … ] }, "test": false }
A carrier parcel template represents a package used for shipping that has preset dimensions defined by a carrier. Some examples of a carrier parcel template include USPS Flat Rate Box and Fedex Small Pak. When using a carrier parcel template, the rates returned may be limited to the carrier that provides the box. You can create user parcel templates using a carrier parcel template. Shippo takes the dimensions of the carrier parcel template but you must configure the weight.
A user parcel template represents a package used for shipping that has preset dimensions and attributes defined by you. They are useful for capturing attributes of parcel-types you frequently use for shipping, allowing them to be defined once and then used for many shipments. These parcel templates can also be used for live rates.
User parcel templates can also be created using a carrier parcel template, where the dimensions will be copied from the carrier presets, but the weight can be configured by you.
A batch is a technique for creating multiple labels at once. Use the batch object to create and purchase many shipments in two API calls. After creating the batch, retrieve the batch to verify that all shipments are valid. You can add and remove shipments after you have created the batch. When all shipments are valid you can purchase the batch and retrieve all the shipping labels.
If you purchased your shipping label through Shippo, you can also get all the tracking details of your Shipment
from the Transaction object.
When using your Test token for tracking, you need to use Shippo's predefined tokens for testing different tracking statuses. You can find more information in our Tracking tutorial on how to do this, and what the payloads look like.
Webhooks are a way for Shippo to notify your application when a specific event occurs. For example, when a label is purchased or when a shipment tracking status has changed. You can use webhooks to trigger actions in your application, such as sending an email or updating a database.
A manifest is a single-page document with a barcode that carriers can scan to accept all packages into transit without the need to scan each item individually. They are close-outs of shipping labels of a certain day. Some carriers require manifests to process the shipments.
An order is a request from a customer to purchase goods from a merchant. Use the orders object to load orders from your system to the Shippo dashboard. You can use the orders object to create, retrieve, list, and manage orders programmatically. You can also retrieve shipping rates, purchase labels, and track shipments for each order.
Rates at checkout is a tool for merchants to display up-to-date shipping estimates based on what's in their customers cart and where they’re shipping to. Merchants set up curated shipping options for customers in the checkout flow based on data in the shopping cart. The request must include the to address and item information. Optional fields are the from address and package information. If the optional fields are not included, the service will use the default address and/or package configured for rates at checkout. The response is a list of shipping options based on the Service Group configuration. (see Service Group configuration for details).
Shippo Accounts are used by Shippo Platform Accounts to create and manage Managed Shippo Accounts. Managed Shippo Accounts are headless accounts that represent your customers. They are opaque to your end customers, meaning customers do not need to create their own Shippo login or have a billing relationship with Shippo. They can be used by marketplaces, e-commerce platforms, and third-party logistics providers who want to offer, seamless, built-in shipping functionality to their customers. See our guide for more details.
| Token | Carrier name |
|---|---|
| airterra | Airterra |
| apc_postal | APC Postal |
| apg | APG |
| aramex | Aramex |
| asendia_us | Asendia US |
| australia_post | Australia Post (also used for Startrack) |
| axlehire | Jitsu |
| better_trucks | BetterTrucks |
| borderguru | BorderGuru |
| boxberry | Boxberry |
| bring | Bring (also used for Posten Norge) |
| canada_post | Canada Post |
| cdl | CDL |
| chronopost | Chronopost |
| collect_plus | CollectPlus |
| correios_br | CorreiosBR |
| correos_espana | Correos España |
| colissimo | Colissimo |
| deutsche_post | Deutsche Post |
| dhl_benelux | DHL Benelux |
| dhl_ecommerce | DHL eCommerce |
| dhl_express | DHL Express |
| dhl_germany_c2c | DHL Germany C2C |
| dhl_germany | DHL Germany |
| dpd_de | DPD GERMANY |
| dpd_uk | DPD UK |
| estafeta | Estafeta |
| fastway_australia | Aramex |
| fedex | FedEx |
| globegistics | Globegistics (now Asendia) |
| gls_us | GLS US |
| gophr | Gophr |
| gso | GSO |
| hermes_germany_b2c | Hermes Germany B2C |
| hermes_uk | Evri UK |
| hongkong_post | Hongkong Post |
| lasership | LaserShip |
| lso | LSO |
| mondial_relay | Mondial Relay |
| new_zealand_post | New Zealand Post (also used for Pace and CourierPost) |
| nippon_express | Nippon Express |
| ontrac | OnTrac |
| parcelforce | Parcelforce |
| passport | Passport |
| pcf | PCF |
| poste_italiane | Poste Italiane |
| posti | Posti |
| purolator | Purolator |
| royal_mail | Royal Mail |
| royal_mail_sf | Royal Mail Storefeeder |
| rr_donnelley | ePost Global |
| russian_post | Russian Post |
| skypostal | SkyPostal |
| stuart | Stuart |
| swyft | Swyft |
| uds | UDS (United Delivery Service) |
| ups | UPS |
| usps | USPS |
| veho | Veho |
Validation result codes returned by the address validation service.
Allowed values:
verification_errorunknown_streetcomponent_mismatch_errormultiple_matchsub_premise_number_invalidsub_premise_number_missingpremise_number_invalidpremise_number_missingbox_number_invalidbox_number_missingpmb_number_missingpostal_code_changeadministrative_area_changelocality_changedependent_locality_changestreet_name_changestreet_type_changestreet_directional_changesub_premise_type_changesub_premise_number_changedouble_dependent_locality_changesubadministrative_area_changesubnational_area_changepo_box_changepremise_type_changehouse_number_changeorganization_changeextraneous_informationusps_door_inaccessibleadministrative_area_partialcity_partialstreet_partialbuilding_partialsubpremise_partialadministrative_area_fullcity_fullthoroughfare_fullpremises_fullsubpremise_fullgeocoded_streetgeocoded_neighborhoodgeocoded_communitygeocoded_stategeocoded_rooftopgeocoded_interpolated_rooftopinvalid_postal_codepostal_code_not_foundempty_requestservice_errorstreet_detail_missingInvalid City/State/ZipDefault MatchUnknown StreetAddress Not FoundNon-Deliverable ZIP4Multiple ResponsesInvalid Dual AddressInvalid StateInvalid CityAmbiguous Address
B13A Option details are obtained by filing a B13A Canada Export Declaration via the Canadian Export Reporting System (CERS). More information on reporting commercial exports from Canada.
Allowed values:
FILED_ELECTRONICALLYSUMMARY_REPORTINGNOT_REQUIRED