Skip to content

What is a Shippo API Object?

Read this guide to understand how the Shippo API uses objects and object IDs.

In the Shippo API, objects use used to stored information. Objects are stored in the Shippo database. Examples of objects include addresses, carrier accounts, transactions, and labels.

Each object has an associated object ID. Each object ID is unique and you can use the object ID to reference and use the data in the object.

Use POST requests to create objects, GET requests to retrieve objects, and PUT requests to update objects.

Most objects in the Shippo API are immutable. This means that once you have created an object, you cannot change it. Instead, you must create a new one with the updated values. Carrier Accounts, Service Groups, and User Parcel Templates are the only objects that you can update.

How to use a Shippo API object

Follow this example to help understand how to use Shippo API objects.

Before starting this example, make sure you have generated your test token. In each example, replace <API_TOKEN> with the test token you have generated.

Create an address object

 curl https://api.goshippo.com/addresses/ \
    -H "Authorization: ShippoToken <API_TOKEN>" \
    -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"

The expected response is a view of the address object that includes the address you created along with its metadata. It includes the object ID, "object_id" that you can use to reference the object.

{
"is_complete": true,
   "object_created":"2022-07-09T02:19:13.174Z",
   "object_updated":"2022-07-09T02:19:13.174Z",
   "object_id":"d799c2679e644279b59fe661ac8fa488",
   "object_owner":"shippotle@shippo.com",
   "validation_results": {},
   "name":"Shawn Ippotle",
   "company":"Shippo",
   "street_no": "",
   "street1":"215 Clayton St.",
   "street2":"",
   "street3":"",
   "city":"San Francisco",
   "state":"CA",
   "zip":"94117",
   "country":"US",
   "longitude": null,
   "latitude": null,
   "phone":"15553419393",
   "email":"shippotle@shippo.com",
   "is_residential":true,
   "metadata":"Customer ID 123456"
}

Use this object ID to retrieve the address details

curl https://api.goshippo.com/addresses/d799c2679e644279b59fe661ac8fa488/ \
    -H "Authorization: ShippoToken <API_TOKEN>"

In this example, d799c2679e644279b59fe661ac8fa488 is the object ID of the address you have created.

The expected response is a view of the address object that includes the address you created along with its metadata. The same response you received when you created the address object.

{
   "is_complete": true,
   "object_created":"2014-07-09T02:19:13.174Z",
   "object_updated":"2014-07-09T02:19:13.174Z",
   "object_id":"d799c2679e644279b59fe661ac8fa488",
   "object_owner":"shippotle@shippo.com",
   "validation_results": {},
   "name":"Shawn Ippotle",
   "company":"Shippo",
   "street_no": "",
   "street1":"215 Clayton St.",
   "street2":"",
   "street3":"",
   "city":"San Francisco",
   "state":"CA",
   "zip":"94117",
   "country":"US",
   "longitude": null,
   "latitude": null,
   "phone":"15553419393",
   "email":"shippotle@shippo.com",
   "is_residential":true,
   "metadata":"Customer ID 123456",
   "test": true
}

Shippo API object list

The following is a list of objects created in the Shippo API.

ObjectObject Name
Address ObjectAddressId
Parcel ObjectParcelId
User Parcel ObjectUserParcelTemplateObjectId
Shipment ObjectShipmentId
Rate ObjectRateId
Transaction ObjectTransactionId
Batch ObjectBatchId
Customs Item ObjectCustomsItemId
Customs Declaration ObjectCustomsDeclarationId
Carrier Account ObjectCarrierAccountId
Manifest ObjectManifestId
Pickup ObjectPickupId
Order ObjectOrderId
Refund ObjectRefundId
Invoice ObjectInvoiceObjectId
Service Group ObjectServiceGroupId
Shippo Account ObjectShippoAccountId