# TaxIdentifier

`TaxIdentifiers` are identifying numbers or IDs that are used to charge a
specific party when dealing with the importing or exporting of good across international borders.

The `tax_identifiers` attribute on a `Shipment` object is a list of `TaxIdentifier` objects, which allows you to
supply up to 8 Tax Identification numbers.

---

## TaxIdentifier object

| Property | Type | Description |
|----------|------|-------------|
| entity | string | Which entity the tax ID belongs to ("SENDER" or "RECEIVER") |
| tax_id | string | The actual tax ID number |
| tax_id_type | string | The type of tax ID that is being used with the shipment (see possible types by carrier here) |
| issuing_country | string | The issuing country of the tax ID number |

Example Object:

```json
{
  "id": "shp_5348afb24fa545738669bdafc86b0dd5",
  "created_at": "2025-05-09T20:40:17Z",
  "is_return": false,
  "messages": [],
  "mode": "test",
  "options": {
    "currency": "USD",
    "payment": {
      "type": "SENDER"
    },
    "date_advance": 0
  },
  "reference": null,
  "status": "unknown",
  "tracking_code": null,
  "updated_at": "2025-05-09T20:40:17Z",
  "batch_id": null,
  "batch_status": null,
  "batch_message": null,
  "customs_info": {
    "id": "cstinfo_ebe4eb6cc07742b5b7981515da3c8df9",
    "object": "CustomsInfo",
    "created_at": "2025-05-09T20:40:17Z",
    "updated_at": "2025-05-09T20:40:17Z",
    "contents_explanation": "",
    "contents_type": "merchandise",
    "customs_certify": true,
    "customs_signer": "Steve Brule",
    "eel_pfc": "NOEEI 30.37(a)",
    "non_delivery_option": "return",
    "restriction_comments": null,
    "restriction_type": "none",
    "mode": "test",
    "declaration": null,
    "customs_items": [
      {
        "id": "cstitem_385811dc02ce4fb585ba01c4a4313461",
        "object": "CustomsItem",
        "created_at": "2025-05-09T20:40:17Z",
        "updated_at": "2025-05-09T20:40:17Z",
        "description": "T-shirt",
        "hs_tariff_number": "123456",
        "origin_country": "US",
        "quantity": 1,
        "value": "10.0",
        "weight": 5.0,
        "code": "123",
        "mode": "test",
        "manufacturer": null,
        "currency": null,
        "eccn": null,
        "printed_commodity_identifier": null
      }
    ]
  },
  "from_address": {
    "id": "adr_d0f8fb922d1511f09929ac1f6bc539aa",
    "object": "Address",
    "created_at": "2025-05-09T20:40:17+00:00",
    "updated_at": "2025-05-09T20:40:17+00:00",
    "name": "EasyPost",
    "company": null,
    "street1": "417 Montgomery Street",
    "street2": "5th Floor",
    "city": "San Francisco",
    "state": "CA",
    "zip": "94104",
    "country": "US",
    "phone": "4153334445",
    "email": "support@easypost.com",
    "mode": "test",
    "carrier_facility": null,
    "residential": null,
    "federal_tax_id": null,
    "state_tax_id": null,
    "verifications": {}
  },
  "insurance": null,
  "order_id": null,
  "parcel": {
    "id": "prcl_4db6b212473e4edaaaf025735d841dcc",
    "object": "Parcel",
    "created_at": "2025-05-09T20:40:17Z",
    "updated_at": "2025-05-09T20:40:17Z",
    "length": 20.2,
    "width": 10.9,
    "height": 5.0,
    "predefined_package": null,
    "weight": 65.9,
    "mode": "test"
  },
  "postage_label": null,
  "rates": [
    {
      "id": "rate_88aa4bfd2b514c2da71330aa3659b6bc",
      "object": "Rate",
      "created_at": "2025-05-09T20:40:17Z",
      "updated_at": "2025-05-09T20:40:17Z",
      "mode": "test",
      "service": "Express",
      "carrier": "USPS",
      "rate": "51.20",
      "currency": "USD",
      "retail_rate": "59.25",
      "retail_currency": "USD",
      "list_rate": "51.20",
      "list_currency": "USD",
      "billing_type": "easypost",
      "delivery_days": 2,
      "delivery_date": null,
      "delivery_date_guaranteed": false,
      "est_delivery_days": 2,
      "shipment_id": "shp_5348afb24fa545738669bdafc86b0dd5",
      "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
    },
    {
      "id": "rate_d0f4c6c481834426b760d32197e78129",
      "object": "Rate",
      "created_at": "2025-05-09T20:40:17Z",
      "updated_at": "2025-05-09T20:40:17Z",
      "mode": "test",
      "service": "Priority",
      "carrier": "USPS",
      "rate": "11.01",
      "currency": "USD",
      "retail_rate": "15.40",
      "retail_currency": "USD",
      "list_rate": "11.01",
      "list_currency": "USD",
      "billing_type": "easypost",
      "delivery_days": 2,
      "delivery_date": null,
      "delivery_date_guaranteed": false,
      "est_delivery_days": 2,
      "shipment_id": "shp_5348afb24fa545738669bdafc86b0dd5",
      "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
    },
    {
      "id": "rate_00975bda7d834c0381552a2ce14109ea",
      "object": "Rate",
      "created_at": "2025-05-09T20:40:17Z",
      "updated_at": "2025-05-09T20:40:17Z",
      "mode": "test",
      "service": "GroundAdvantage",
      "carrier": "USPS",
      "rate": "8.20",
      "currency": "USD",
      "retail_rate": "13.85",
      "retail_currency": "USD",
      "list_rate": "9.74",
      "list_currency": "USD",
      "billing_type": "easypost",
      "delivery_days": 3,
      "delivery_date": null,
      "delivery_date_guaranteed": false,
      "est_delivery_days": 3,
      "shipment_id": "shp_5348afb24fa545738669bdafc86b0dd5",
      "carrier_account_id": "ca_9685a1198a75477885a3cdca37559bac"
    }
  ],
  "refund_status": null,
  "scan_form": null,
  "selected_rate": null,
  "tracker": null,
  "to_address": {
    "id": "adr_d0f650af2d1511f0bb783cecef1b359e",
    "object": "Address",
    "created_at": "2025-05-09T20:40:17+00:00",
    "updated_at": "2025-05-09T20:40:17+00:00",
    "name": "Dr. Steve Brule",
    "company": null,
    "street1": "179 N Harbor Dr",
    "street2": null,
    "city": "Redondo Beach",
    "state": "CA",
    "zip": "90277",
    "country": "US",
    "phone": "8573875756",
    "email": "dr_steve_brule@gmail.com",
    "mode": "test",
    "carrier_facility": null,
    "residential": null,
    "federal_tax_id": null,
    "state_tax_id": null,
    "verifications": {}
  },
  "usps_zone": 4,
  "return_address": {
    "id": "adr_d0f8fb922d1511f09929ac1f6bc539aa",
    "object": "Address",
    "created_at": "2025-05-09T20:40:17+00:00",
    "updated_at": "2025-05-09T20:40:17+00:00",
    "name": "EasyPost",
    "company": null,
    "street1": "417 Montgomery Street",
    "street2": "5th Floor",
    "city": "San Francisco",
    "state": "CA",
    "zip": "94104",
    "country": "US",
    "phone": "4153334445",
    "email": "support@easypost.com",
    "mode": "test",
    "carrier_facility": null,
    "residential": null,
    "federal_tax_id": null,
    "state_tax_id": null,
    "verifications": {}
  },
  "buyer_address": {
    "id": "adr_d0f650af2d1511f0bb783cecef1b359e",
    "object": "Address",
    "created_at": "2025-05-09T20:40:17+00:00",
    "updated_at": "2025-05-09T20:40:17+00:00",
    "name": "Dr. Steve Brule",
    "company": null,
    "street1": "179 N Harbor Dr",
    "street2": null,
    "city": "Redondo Beach",
    "state": "CA",
    "zip": "90277",
    "country": "US",
    "phone": "8573875756",
    "email": "dr_steve_brule@gmail.com",
    "mode": "test",
    "carrier_facility": null,
    "residential": null,
    "federal_tax_id": null,
    "state_tax_id": null,
    "verifications": {}
  },
  "forms": [],
  "fees": [],
  "object": "Shipment",
  "tax_identifiers": [
    {
      "entity": "SENDER",
      "tax_id": "HIDDEN",
      "tax_id_type": "EORI",
      "issuing_country": "GB"
    }
  ]
}
```

---

### Example: Create Shipment with TaxIdentifiers

#### cURL

```shell
curl -X POST https://api.easypost.com/v2/shipments \
  -u "EASYPOST_API_KEY": \
  -H 'Content-Type: application/json' \
  -d '{
    "shipment": {
      "to_address": {
        "name": "Dr. Steve Brule",
        "street1": "179 N Harbor Dr",
        "city": "Redondo Beach",
        "state": "CA",
        "zip": "90277",
        "country": "US",
        "phone": "8573875756",
        "email": "dr_steve_brule@gmail.com"
      },
      "from_address": {
        "name": "EasyPost",
        "street1": "417 Montgomery Street",
        "street2": "5th Floor",
        "city": "San Francisco",
        "state": "CA",
        "zip": "94104",
        "country": "US",
        "phone": "4153334445",
        "email": "support@easypost.com"
      },
      "parcel": {
        "length": "20.2",
        "width": "10.9",
        "height": "5",
        "weight": "65.9"
      },
      "customs_info": {
        "id": "cstinfo_..."
      },
      "tax_identifiers": [
        {
          "entity": "SENDER",
          "tax_id": "GB123456789",
          "tax_id_type": "EORI",
          "issuing_country": "GB"
        }
      ]
    }
  }'
```

#### Go

```go
package example

import (
	"fmt"

	"github.com/EasyPost/easypost-go/v5"
)

func create() {
	client := easypost.New("EASYPOST_API_KEY")

	toAddress, _ := client.GetAddress("adr_...")
	fromAddress, _ := client.GetAddress("adr_...")
	parcel, _ := client.GetParcel("prcl_...")

	shipment, _ := client.CreateShipment(
		&easypost.Shipment{
			ToAddress:   toAddress,
			FromAddress: fromAddress,
			Parcel:      parcel,
			TaxIdentifiers: []*easypost.TaxIdentifier{
				&easypost.TaxIdentifier{
					Entity:         "SENDER",
					TaxId:          "GB123456789",
					IssuingCountry: "GB",
					TaxIdType:      "EORI",
				},
			},
		},
	)

	fmt.Println(shipment)
}
```

#### Java

```java
package shipments;

import com.easypost.exception.EasyPostException;
import com.easypost.model.Shipment;
import com.easypost.service.EasyPostClient;

import java.util.HashMap;

public class Create {
    public static void main(String[] args) throws EasyPostException {
        EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

        HashMap<String, Object> toAddressMap = new HashMap<String, Object>();
        toAddressMap.put("name", "Dr. Steve Brule");
        toAddressMap.put("street1", "179 N Harbor Dr");
        toAddressMap.put("city", "Redondo Beach");
        toAddressMap.put("state", "CA");
        toAddressMap.put("country", "US");
        toAddressMap.put("phone", "8573875756");
        toAddressMap.put("email", "dr_steve_brule@gmail.com");
        toAddressMap.put("zip", "90277");

        HashMap<String, Object> fromAddressMap = new HashMap<String, Object>();
        fromAddressMap.put("name", "EasyPost");
        fromAddressMap.put("street1", "417 Montgomery Street");
        fromAddressMap.put("street2", "5th Floor");
        fromAddressMap.put("city", "San Francisco");
        fromAddressMap.put("state", "CA");
        fromAddressMap.put("zip", "94104");
        fromAddressMap.put("country", "US");
        fromAddressMap.put("phone", "4153334445");
        fromAddressMap.put("email", "support@easypost.com");

        HashMap<String, Object> parcelMap = new HashMap<String, Object>();
        parcelMap.put("length", 20.2);
        parcelMap.put("width", 10.9);
        parcelMap.put("height", 5);
        parcelMap.put("weight", 65.9);

        HashMap<String, Object> customsInfoMap = new HashMap<String, Object>();
        customsInfoMap.put("id", "cstinfo_...");

        HashMap<String, Object> taxIdentifiersMap = new HashMap<String, Object>();
        taxIdentifiersMap.put("entity", "SENDER");
        taxIdentifiersMap.put("tax_id", "GB123456789");
        taxIdentifiersMap.put("tax_id_type", "EORI");
        taxIdentifiersMap.put("issuing_country", "GB");

        HashMap<String, Object> params = new HashMap<String, Object>();
        params.put("to_address", toAddressMap);
        params.put("from_address", fromAddressMap);
        params.put("parcel", parcelMap);
        params.put("customs_info", customsInfoMap);
        params.put("tax_identifiers", taxIdentifiersMap);

        Shipment shipment = client.shipment.create(params);

        System.out.println(shipment);
    }
}
```

#### C#

```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyPost;
using Newtonsoft.Json;

namespace EasyPostExamples
{
    public class Examples
    {
        public static async Task Main()
        {
            var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

            EasyPost.Parameters.Shipment.Create parameters = new()
            {
                ToAddress = new EasyPost.Parameters.Address.Create
                {
                    Name = "Dr. Steve Brule",
                    Street1 = "417 Montgomery Street",
                    Street2 = "5th Floor",
                    City = "San Francisco",
                    State = "CA",
                    Country = "US",
                    Zip = "94104"
                },
                FromAddress = new EasyPost.Parameters.Address.Create
                {
                    Company = "EasyPost",
                    Street1 = "417 Montgomery Street",
                    Street2 = "Floor 5",
                    City = "San Francisco",
                    State = "CA",
                    Country = "US",
                    Zip = "94104"
                },
                Parcel = new EasyPost.Parameters.Parcel.Create
                {
                    Length = 8,
                    Width = 6,
                    Height = 5,
                    Weight = 10
                },
                CustomsInfo = new EasyPost.Parameters.CustomsInfo.Create
                {
                    // ...
                },
                TaxIdentifiers = new List<EasyPost.Parameters.TaxIdentifiers.Create>
                {
                    new()
                    {
                        Entity = "SENDER",
                        TaxId = "GB123456789",
                        TaxIdType = "EORI",
                        IssuingCountry = "GB"
                    }
                }
            };

            EasyPost.Models.API.Shipment shipment = await client.Shipment.Create(parameters);

            Console.WriteLine(JsonConvert.SerializeObject(shipment, Formatting.Indented));
        }
    }
}
```

#### Node.js

```javascript
const EasyPostClient = require('@easypost/api');

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const shipment = await client.Shipment.create({
    parcel: {
      length: 20.2,
      width: 10.9,
      height: 5,
      weight: 65.9,
    },
    to_address: {
      name: 'Dr. Steve Brule',
      street1: '179 N Harbor Dr',
      city: 'Redondo Beach',
      state: 'CA',
      zip: '90277',
      country: 'US',
      email: 'dr_steve_brule@gmail.com',
      phone: '4155559999',
    },
    from_address: {
      street1: '417 montgomery street',
      street2: 'FL 5',
      city: 'San Francisco',
      state: 'CA',
      zip: '94104',
      country: 'US',
      company: 'EasyPost',
      phone: '415-123-4567',
    },
    customs_info: {
      id: 'cstinfo_...',
    },
    tax_identifiers: [
      {
        entity: 'SENDER',
        tax_id: 'GB123456789',
        tax_id_type: 'IOSS',
        issuing_country: 'GB',
      },
    ],
  });

  console.log(shipment);
})();
```

#### PHP

```php
<?php

$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY');

$shipment = $client->shipment->create([
    'to_address' => [
        'name' => 'Dr. Steve Brule',
        'street1' => '179 N Harbor Dr',
        'city' => 'Redondo Beach',
        'state' => 'CA',
        'zip' => '90277',
        'country' => 'US',
        'phone' => '3331114444',
        'email' => 'dr_steve_brule@gmail.com'
    ],
    'from_address' => [
        'name' => 'EasyPost',
        'street1' => '417 Montgomery Street',
        'street2' => '5th Floor',
        'city' => 'San Francisco',
        'state' => 'CA',
        'zip' => '94104',
        'country' => 'US',
        'phone' => '3331114444',
        'email' => 'support@easypost.com'
    ],
    'parcel' => [
        'length' => 20.2,
        'width' => 10.9,
        'height' => 5,
        'weight' => 65.9
    ],
    'customs_info' => ['id' => 'cstinfo_...'],
    'tax_identifiers' => [[
        'entity' => 'SENDER',
        'tax_id' => 'GB123456789',
        'tax_id_type' => 'IOSS',
        'issuing_country' => 'GB',
    ]]
]);

echo $shipment;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

shipment = client.shipment.create(
    to_address={
        "name": "Dr. Steve Brule",
        "street1": "179 N Harbor Dr",
        "city": "Redondo Beach",
        "state": "CA",
        "zip": "90277",
        "country": "US",
        "phone": "4153334444",
        "email": "dr_steve_brule@gmail.com",
    },
    from_address={
        "name": "EasyPost",
        "street1": "417 Montgomery Street",
        "street2": "5th Floor",
        "city": "San Francisco",
        "state": "CA",
        "zip": "94104",
        "country": "US",
        "phone": "4153334444",
        "email": "support@easypost.com",
    },
    parcel={
        "length": 20.2,
        "width": 10.9,
        "height": 5,
        "weight": 65.9,
    },
    customs_info={"id": "cstinfo_..."},
    tax_identifiers=[
        {
            "entity": "SENDER",
            "tax_id": "GB123456789",
            "tax_id_type": "IOSS",
            "issuing_country": "GB",
        }
    ],
)

print(shipment)
```

#### Ruby

```ruby
require 'easypost'

client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY')

shipment = client.shipment.create(
  to_address: {
    name: 'Dr. Steve Brule',
    street1: '179 N Harbor Dr',
    city: 'Redondo Beach',
    state: 'CA',
    zip: '90277',
    country: 'US',
    phone: '8573875756',
    email: 'dr_steve_brule@gmail.com',
  },
  from_address: {
    name: 'EasyPost',
    street1: '417 Montgomery Street',
    street2: '5th Floor',
    city: 'San Francisco',
    state: 'CA',
    zip: '94104',
    country: 'US',
    phone: '4153334445',
    email: 'support@easypost.com',
  },
  parcel: {
    length: 20.2,
    width: 10.9,
    height: 5,
    weight: 65.9,
  },
  customs_info: {
    id: 'cstinfo_...',
  },
  tax_identifiers: [
    {
      entity: 'SENDER',
      tax_id: 'GB123456789',
      tax_id_type: 'EORI',
      issuing_country: 'GB',
    },
  ],
)

puts shipment
```