If you already know what service level you’ll be shipping with, you can create a shipping label in one API call through Shippo using our Instalabel feature.
Instalabel creation is currently only available for a select set of carriers through Shippo. To see if your carrier is supported, see our carrier capabilities page.
If this is your first time using Shippo, we recommend going through the First Shipment tutorial to get yourself acquainted with the basic concepts.
- If you are using your own carrier accounts, make sure to go through the Carrier Account tutorial to add your carrier credentials and connect them with Shippo first.
- Retrieve the unique carrier account object_id for the carrier that you’d like to use for the single-call request.
- Take a look at our list of available service level tokens to select the one that you’d like to use for the request.
Creating a label with one API call is a POST request to the Transaction endpoint with the nested shipment information, the carrier account and the service token. A sample request looks like this:
{
"shipment": {
"address_from": {
// sender address fields
},
"address_to": {
// recipient address fields
},
"parcels": [
{
// parcel fields
}
],
... // other relevant shipment fields
},
"carrier_account": "<carrier-account-object-id>",
"servicelevel_token": "<servicelevel-token>"
}Here’s a sample call that instantly creates and returns a shipping label:
curl https://api.goshippo.com/transactions/ \
-H "Authorization: ShippoToken <API_Token>" \
-H "Content-Type: application/json" \
-d '{
"shipment": {
"address_from": {
"name": "Mr. Hippo",
"street1": "215 Clayton St.",
"city": "San Francisco",
"state": "CA",
"zip": "94117",
"country": "US",
"phone": "+1 555 341 9393",
"email": "support@shippo.com"
},
"address_to": {
"name": "Mrs. Hippo",
"street1": "965 Mission St.",
"city": "San Francisco",
"state": "CA",
"zip": "94105",
"country": "US",
"phone": "+1 555 341 9393",
"email": "support@shippo.com"
},
"parcels": [{
"length": "5",
"width": "5",
"height": "5",
"distance_unit": "in",
"weight": "2",
"mass_unit": "lb"
}]
},
"carrier_account": "b741b99f95e841639b54272834bc478c",
"servicelevel_token": "usps_priority"
}'The API will respond with the JSON serialized Shipment object. Shippo automatically creates the corresponding rate object, which you can use to retrieve the amount of the label.
{
"object_state": "VALID",
"status": "SUCCESS",
"object_created": "2013-12-27T19:14:48.273Z",
"object_updated": "2013-12-27T19:14:48.273Z",
"object_id": "64bba01845ef40d29374032599f22588",
"object_owner": "shippotle@shippo.com",
"was_test": false,
"rate": {
"object_id": "cf6fea899f1848b494d9568e8266e076",
"amount": "5.50",
"currency": "USD",
"amount_local": "5.50",
"currency_local": "USD",
"provider": "USPS",
"servicelevel_name": "Priority Mail",
"servicelevel_token": "usps_priority",
"carrier_account": "078870331023437cb917f5187429b093",
},
"tracking_number": "ZW70QJC",
"tracking_status": {
"object_created": "2013-12-27T23:17:41.411Z",
"object_id": "a21b3d6831c14ceaba6730179ce6e784",
"status": "UNKNOWN",
"status_details": "",
"status_date": "2013-12-28T12:04:04.214Z"
},
"tracking_url_provider": "https://tools.usps.com/go/TrackConfirmAction.action?tLabels=ZW70QJC",
"eta": "2013-12-30T12:00:00.000Z",
"label_url": "https://shippo-delivery.s3.amazonaws.com/96.pdf?Signature=PEdWrp0mFWAGwJp7FW3b%2FeA2eyY%3D&Expires=1385930652&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA",
"commercial_invoice_url": "",
"metadata": "",
"messages": []
}