> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goshippo.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.goshippo.com/feedback

```json
{
  "path": "/docs/API_Concepts/api-objects",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# API objects

> Understand how Shippo API objects and object IDs work, and learn how to create, retrieve, and use them.

## 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 `<API_TOKEN>` with the test token you have generated.

### <img src="https://mintcdn.com/shippo-f4b7b609/bsljvq9P8Idqx1CE/images/step1.svg?fit=max&auto=format&n=bsljvq9P8Idqx1CE&q=85&s=cf0d2ceaf4419aae89630f9f35a8c70d" alt="Step 1" width="44" height="32" data-path="images/step1.svg" /> Create an address object

<CodeGroup>
  ```shell cURL theme={null}
   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"
  ```

  ```Python Python theme={null}
  import shippo
  from shippo.models import components

  shippo_sdk = shippo.Shippo(api_key_header="<API_Token>")

  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 theme={null}
  require_once('lib/Shippo.php');
  Shippo::setApiKey("<API_TOKEN>");

  // 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 theme={null}
  // Create address object
  const shippo = new Shippo({apiKeyHeader: '<API_TOKEN>'});
  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",
  });
  ```
</CodeGroup>

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 theme={null}
{
"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"
}
```

### <img src="https://mintcdn.com/shippo-f4b7b609/bsljvq9P8Idqx1CE/images/step2.svg?fit=max&auto=format&n=bsljvq9P8Idqx1CE&q=85&s=bbb481f85d226206e137bbc697adaf75" alt="Step 2" width="44" height="32" data-path="images/step2.svg" /> Use this object ID to retrieve the address details

<CodeGroup>
  ```shell cURL theme={null}
  curl https://api.goshippo.com/addresses/d799c2679e644279b59fe661ac8fa488/ \
      -H "Authorization: ShippoToken <API_TOKEN>"
  ```

  ```Python Python theme={null}
  # Retrieve an existing address by object_id
  shippo_sdk.addresses.get("d799c2679e644279b59fe661ac8fa488")
  ```

  ```PHP PHP theme={null}
  // Retrieve an existing address by object_id
  Shippo_Address::retrieve('d799c2679e644279b59fe661ac8fa488');
  ```

  ```typescript TypeScript theme={null}
  // Retrieve an existing address by object_id
  shippo.addresses.get('d799c2679e644279b59fe661ac8fa488');
  ```
</CodeGroup>

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 theme={null}
{
   "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](/api-reference/addresses/list-all-addresses)                                   | AddressId                  |
| [Parcel Object](/api-reference/parcels/list-all-parcels)                                        | ParcelId                   |
| [User Parcel Object](/api-reference/user-parcel-templates/list-all-user-parcel-templates)       | UserParcelTemplateObjectId |
| [Shipment Object](/api-reference/shipments/list-all-shipments)                                  | ShipmentId                 |
| [Rate Object](/api-reference/rates/retrieve-a-rate)                                             | RateId                     |
| [Transaction Object](/api-reference/transactions/list-all-shipping-labels)                      | TransactionId              |
| [Batch Object](/api-reference/batches/create-a-batch)                                           | BatchId                    |
| [Customs Item Object](/api-reference/customs-items/list-all-customs-items)                      | CustomsItemId              |
| [Customs Declaration Object](/api-reference/customs-declarations/list-all-customs-declarations) | CustomsDeclarationId       |
| [Carrier Account Object](/api-reference/carrier-accounts/list-all-carrier-accounts)             | CarrierAccountId           |
| [Manifest Object](/api-reference/manifests/list-all-manifests)                                  | ManifestId                 |
| [Pickup Object](/api-reference/pickups/create-a-pickup)                                         | PickupId                   |
| [Order Object](/api-reference/orders/list-all-orders)                                           | OrderId                    |
| [Refund Object](/api-reference/refunds/list-all-refunds)                                        | RefundId                   |
| [Invoice Object](/api-reference/addresses/list-all-addresses)                                   | InvoiceObjectId            |
| [Service Group Object](/api-reference/service-groups/list-all-service-groups)                   | ServiceGroupId             |
| [Shippo Account Object](/api-reference/shippo-accounts/list-all-shippo-accounts)                | ShippoAccountId            |
