# API objects ## 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](/docs/guides_general/authentication). In each example, replace `` with the test token you have generated. ### ![](/assets/step1.14ee6260337a0b326de06f1173e3703f933b52790e666cd390788635d3e7e0a6.9c1bb791.svg) Create an address object ```shell cURL curl https://api.goshippo.com/addresses/ \ -H "Authorization: ShippoToken " \ -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" ``` ```Python Python import shippo from shippo.models import components shippo_sdk = shippo.Shippo(api_key_header="") shippo_sdk.addresses.create( components.AddressCreateRequest( name="Shawn Ippotle", company="Shippo", street1="215 Clayton St.", city="San Francisco", state="CA", zip="94117", country="US", # iso2 country code phone="+1 555 341 9393", email="shippotle@shippo.com" ) ) ``` ```PHP PHP require_once('lib/Shippo.php'); Shippo::setApiKey(""); // Create address object $fromAddress = Shippo_Address::create( array( "name" => "Shawn Ippotle", "company" => "Shippo", "street1" => "215 Clayton St.", "city" => "San Francisco", "state" => "CA", "zip" => "94117", "country" => "US", "phone" => "+1 555 341 9393", "email" => "shippotle@shippo.com" )); ``` ```typescript TypeScript // Create address object const shippo = new Shippo({apiKeyHeader: ''}); const addressFrom = await shippo.addresses.create({ name: "Shawn Ippotle", company: "Shippo", street1: "215 Clayton St.", city: "San Francisco", state: "CA", zip: "94117", country: "US", // iso2 country code phone: "+1 555 341 9393", email: "shippotle@shippo.com", }); ``` 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. ```json { "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" } ``` ### ![](/assets/step2.37831ee18f1f0290fe49fb6b512319f7a374b18f4063f0302fe35b4afcd9816b.9c1bb791.svg) Use this object ID to retrieve the address details ```shell cURL curl https://api.goshippo.com/addresses/d799c2679e644279b59fe661ac8fa488/ \ -H "Authorization: ShippoToken " ``` ```Python Python # Retrieve an existing address by object_id shippo_sdk.addresses.get("d799c2679e644279b59fe661ac8fa488") ``` ```PHP PHP // Retrieve an existing address by object_id Shippo_Address::retrieve('d799c2679e644279b59fe661ac8fa488'); ``` ```typescript TypeScript // Retrieve an existing address by object_id shippo.addresses.get('d799c2679e644279b59fe661ac8fa488'); ``` 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. ```json { "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. | Object | Object Name | | --- | --- | | [Address Object](/shippoapi/public-api/addresses) | AddressId | | [Parcel Object](/shippoapi/public-api/parcels) | ParcelId | | [User Parcel Object](/shippoapi/public-api/user-parcel-templates) | UserParcelTemplateObjectId | | [Shipment Object](/shippoapi/public-api/shipments) | ShipmentId | | [Rate Object](/shippoapi/public-api/rates) | RateId | | [Transaction Object](/shippoapi/public-api/transactions) | TransactionId | | [Batch Object](/shippoapi/public-api/batches) | BatchId | | [Customs Item Object](/shippoapi/public-api/customs-items) | CustomsItemId | | [Customs Declaration Object](/shippoapi/public-api/customs-declarations) | CustomsDeclarationId | | [Carrier Account Object](/shippoapi/public-api/carrier-accounts) | CarrierAccountId | | [Manifest Object](/shippoapi/public-api/manifests) | ManifestId | | [Pickup Object](/shippoapi/public-api/pickups) | PickupId | | [Order Object](/shippoapi/public-api/orders) | OrderId | | [Refund Object](/shippoapi/public-api/refunds) | RefundId | | [Invoice Object](/shippoapi/public-api/overview) | InvoiceObjectId | | [Service Group Object](/shippoapi/public-api/service-groups) | ServiceGroupId | | [Shippo Account Object](/shippoapi/public-api/shippo-accounts) | ShippoAccountId |