API quick reference
| Item | Value |
|---|---|
| Base URL | https://api.goshippo.com |
| Authentication | Authorization: ShippoToken YOUR_API_TOKEN |
| Test vs. live | Use a shippo_test_ key to build for free. Swap to a shippo_live_ key to go live. |
| Version pin | Shippo-API-Version: 2018-02-08 |
Implementation plan
Most integrations follow the same four phases:Set up
- Create an account and get your test and live API keys (quickstart)
- Connect or confirm carrier accounts
- Install an SDK or call the REST API directly
Build your core flow
- Pick the workflow(s) below that match how you ship
- Add address validation up front
- Store rate, transaction, and tracking IDs
Handle post-purchase
- Register webhooks for tracking and labels
- Add refunds, returns, and end-of-day manifests as needed
Test and go live
- Run every path in test mode (testing guide)
- Handle errors and check
messages[]on rates - Swap to your live key
Pick your workflow(s)
Workflows
Rate shop and buy a label
The standard flow for most merchants. Two calls.- POST
/shipmentswithaddress_from,address_to, andparcels. The response includes arates[]array. - Pick a rate. Choose the cheapest, the fastest, or filter by rate
attributes. - POST
/transactionswith the rate’sobject_idand alabel_file_type. - Save the
label_urlandtracking_number.
/addresses and use its validate option.Learn more: Generate your first label, Rate shopping, Address validation
One-call label (Instalabel)
Use this when you already know the carrier and service level. It skips the rate step.- POST
/transactionswith a nestedshipment, pluscarrier_accountandservicelevel_token(for example,usps_priority). - The label and tracking number come back in the same response.
carrier_account ID from GET /carrier_accounts.Learn more: Generate your first label, Carrier accounts
International shipping
Use this for any shipment that clears customs.- POST
/customs/itemsfor each product. Include description, quantity, value, weight, origin country, and HS code. - POST
/customs/declarationswith the item IDs,contents_type,non_delivery_option, andcertify. - POST
/shipmentswith thecustoms_declarationattached. - POST
/transactionsto purchase the rate.
Learn more: International shipping
Returns
Send a return label with the order, or create one on request.- POST
/shipmentswithextra.is_return: true. For USPS, FedEx, and UPS, keep the addresses in their original order: Shippo swaps them on the label. For other carriers, swap them yourself. - POST
/transactionsto purchase the return rate.
Learn more: Returns
Batch labels
Use this for high-volume fulfillment, up to 10,000 labels per batch.- POST
/batcheswithdefault_carrier_account,default_servicelevel_token, and abatch_shipments[]array. - GET
/batches/{id}untilstatusisVALID. Fix invalid rows, or remove them with POST/batches/{id}/remove_shipments. - POST
/batches/{id}/purchase. - Listen for the
batch_purchasedwebhook, then download thelabel_url.
Learn more: Batch label creation, Webhooks
Checkout rates
Show shoppers real shipping prices in your cart.- POST
/service-groupsto create options such as “Standard” and “Express” with flat, free, or live pricing. - POST
/live-rateswith the cart’s items and destination to get prices for each service group. - After checkout, follow Rate shop and buy a label for the service the shopper chose.
Learn more: API reference
Tracking and webhooks
Keep customers and your own system updated after you buy a label.- POST
/webhooksfortrack_updated. Addtransaction_createdif you want label events too. - Labels bought through Shippo are tracked automatically. For labels bought elsewhere, POST
/trackswith the carrier and tracking number. - To check status on demand, GET
/tracks/{carrier}/{tracking_number}.
shippo with tracking number SHIPPO_TRANSIT or SHIPPO_DELIVERED to simulate tracking events.Manifests and pickups
Hand packages off to the carrier at the end of the day.- POST
/manifestswithcarrier_account,shipment_date, andaddress_fromto create a SCAN form (for example, for USPS). - POST
/pickupswith the transaction IDs, location, and time window to schedule a pickup.
Learn more: Manifests and SCAN forms, Pickups
Void a label
Use this when an order is cancelled or a label was printed by mistake.- POST
/refundswith thetransactionID. - GET
/refunds/{id}to check status. It moves fromQUEUEDtoSUCCESS, or toERRORif the refund is rejected.
Learn more: Refunding labels