# Address

`Address` objects represent people, places, and organizations and are used in multiple
contexts across the EasyPost API. For example, a `Shipment` requires both a `to_address`
and `from_address` to calculate rates and generate postage.

Address objects support both domestic and international addresses, identified using ISO 3166 country codes. EasyPost also
provides address verification tools to detect deliverability issues, correct minor spelling or formatting errors, and determine
whether an address is residential—an important factor in rate calculation for many carriers.

---

## Address object

| Property | Type | Description |
|----------|------|-------------|
| id | string | Unique identifier, begins with "adr_" |
| object | string | "Address" |
| street1 | string | First line of the address. Note: For U.S. and CA addresses, if street1 exceeds 35 characters, street2 is empty, and the end of street1 contains a recognized unit number format (e.g., “Apt 10”, or “Unit #99833”), the unit number is moved to street2. |
| street2 | string | Second line of the address. Note: May be automatically populated if a unit number is moved from street1 during address verification. |
| city | string | City the address is located in |
| state | string | State or province the address is located in |
| zip | string | ZIP or postal code the address is located in |
| country | string | ISO 3166 country code for the country the address is located in |
| residential | boolean | Whether or not this address would be considered residential |
| carrier_facility | string | The specific designation for the address (only relevant if the address is a carrier facility). |
| name | string | Name of the person. Both name and company can be included. |
| company | string | Name of the organization. Both name and company can be included. |
| phone | string | Phone number to reach the person or organization |
| email | string | Email to reach the person or organization |
| federal_tax_id | string | Federal tax identifier of the person or organization |
| state_tax_id | string | State tax identifier of the person or organization |
| verifications | Verifications | The result of any verifications requested |

Example Object:

```json
{
  "id": "adr_7c2f357c2d1511f087fbac1f6bc539ae",
  "object": "Address",
  "created_at": "2025-05-09T20:37:54+00:00",
  "updated_at": "2025-05-09T20:37:54+00:00",
  "name": null,
  "company": "EasyPost",
  "street1": "417 MONTGOMERY ST",
  "street2": "FLOOR 5",
  "city": "SAN FRANCISCO",
  "state": "CA",
  "zip": "94104",
  "country": "US",
  "phone": "4151234567",
  "email": null,
  "mode": "test",
  "carrier_facility": null,
  "residential": null,
  "federal_tax_id": null,
  "state_tax_id": null,
  "verifications": {}
}
```

---

## Verifications object

| Property | Type | Description |
|----------|------|-------------|
| zip4 | Verification | Only applicable to US addresses - checks and sets the ZIP+4 |
| delivery | Verification | Checks that the address is deliverable and makes minor corrections to spelling or format. US addresses will also have their residential status checked and set. |

Example Object:

```json
{
  "address": {
    "id": "adr_7cac5ead2d1511f08839ac1f6bc539ae",
    "object": "Address",
    "created_at": "2025-05-09T20:37:55+00:00",
    "updated_at": "2025-05-09T20:37:55+00:00",
    "name": null,
    "company": "EASYPOST",
    "street1": "417 MONTGOMERY ST FL 5",
    "street2": "",
    "city": "SAN FRANCISCO",
    "state": "CA",
    "zip": "94104-1129",
    "country": "US",
    "phone": "4151234567",
    "email": null,
    "mode": "test",
    "carrier_facility": null,
    "residential": false,
    "federal_tax_id": null,
    "state_tax_id": null,
    "verifications": {
      "zip4": {
        "success": true,
        "errors": [],
        "details": null
      },
      "delivery": {
        "success": true,
        "errors": [],
        "details": {
          "latitude": 37.79342,
          "longitude": -122.40288,
          "time_zone": "America/Los_Angeles"
        }
      }
    }
  }
}
```

---

## Verification object

| Property | Type | Description |
|----------|------|-------------|
| success | boolean | The success of the verification |
| errors | AddressVerificationFieldError array | All errors that caused the verification to fail |
| details | VerificationDetails | Extra data related to the verification |

Example Object:

```json
{
  "address": {
    "id": "adr_7cac5ead2d1511f08839ac1f6bc539ae",
    "object": "Address",
    "created_at": "2025-05-09T20:37:55+00:00",
    "updated_at": "2025-05-09T20:37:55+00:00",
    "name": null,
    "company": "EASYPOST",
    "street1": "417 MONTGOMERY ST FL 5",
    "street2": "",
    "city": "SAN FRANCISCO",
    "state": "CA",
    "zip": "94104-1129",
    "country": "US",
    "phone": "4151234567",
    "email": null,
    "mode": "test",
    "carrier_facility": null,
    "residential": false,
    "federal_tax_id": null,
    "state_tax_id": null,
    "verifications": {
      "zip4": {
        "success": true,
        "errors": [],
        "details": null
      },
      "delivery": {
        "success": true,
        "errors": [],
        "details": {
          "latitude": 37.79342,
          "longitude": -122.40288,
          "time_zone": "America/Los_Angeles"
        }
      }
    }
  }
}
```

---

## VerificationDetails object

| Property | Type | Description |
|----------|------|-------------|
| latitude | number | The latitude |
| longitude | number | The longitude |
| time_zone | TZ (string) | The time zone the address is located in, e.g. America/Los_Angeles |

Example Object:

```json
{
  "address": {
    "id": "adr_7cac5ead2d1511f08839ac1f6bc539ae",
    "object": "Address",
    "created_at": "2025-05-09T20:37:55+00:00",
    "updated_at": "2025-05-09T20:37:55+00:00",
    "name": null,
    "company": "EASYPOST",
    "street1": "417 MONTGOMERY ST FL 5",
    "street2": "",
    "city": "SAN FRANCISCO",
    "state": "CA",
    "zip": "94104-1129",
    "country": "US",
    "phone": "4151234567",
    "email": null,
    "mode": "test",
    "carrier_facility": null,
    "residential": false,
    "federal_tax_id": null,
    "state_tax_id": null,
    "verifications": {
      "zip4": {
        "success": true,
        "errors": [],
        "details": null
      },
      "delivery": {
        "success": true,
        "errors": [],
        "details": {
          "latitude": 37.79342,
          "longitude": -122.40288,
          "time_zone": "America/Los_Angeles"
        }
      }
    }
  }
}
```

---

## Address Verification by Country

The address verification service supports over 240 countries and territories. Verification levels vary by country. Coverage is continuously expanding to support more global addresses.

---

## Create an Address

### Example: POST /addresses

#### cURL

```shell
curl -X POST https://api.easypost.com/v2/addresses \
  -u "EASYPOST_API_KEY": \
  -H 'Content-Type: application/json' \
  -d '{
    "address": {
      "street1": "417 MONTGOMERY ST",
      "street2": "FLOOR 5",
      "city": "SAN FRANCISCO",
      "state": "CA",
      "zip": "94104",
      "country": "US",
      "company": "EasyPost",
      "phone": "415-123-4567"
    }
  }'
```

#### Go

```go
package example

import (
	"fmt"

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

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

	address, _ := client.CreateAddress(
		&easypost.Address{
			Street1: "417 MONTGOMERY ST",
			Street2: "FLOOR 5",
			City:    "SAN FRANCISCO",
			State:   "CA",
			Zip:     "94104",
			Country: "US",
			Company: "EasyPost",
			Phone:   "415-123-4567",
		},
		&easypost.CreateAddressOptions{},
	)

	fmt.Println(address)
}
```

#### Java

```java
package addresses;

import com.easypost.exception.EasyPostException;
import com.easypost.model.Address;
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> params = new HashMap<String, Object>();

        params.put("street1", "417 MONTGOMERY ST");
        params.put("street2", "FLOOR 5");
        params.put("city", "SAN FRANCISCO");
        params.put("state", "CA");
        params.put("zip", "94104");
        params.put("country", "US");
        params.put("company", "EasyPost");
        params.put("phone", "415-123-4567");

        Address address = client.address.create(params);

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

#### 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.Address.Create parameters = new()
            {
                Street1 = "417 MONTGOMERY ST",
                Street2 = "FLOOR 5",
                City = "SAN FRANCISCO",
                State = "CA",
                Zip = "94104",
                Country = "US",
                Company = "EasyPost",
                Phone = "415-123-4567",
            };

            EasyPost.Models.API.Address address = await client.Address.Create(parameters);

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

#### Node.js

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

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const address = await client.Address.create({
    street1: '417 MONTGOMERY ST',
    street2: 'FLOOR 5',
    city: 'SAN FRANCISCO',
    state: 'CA',
    zip: '94104',
    country: 'US',
    company: 'EasyPost',
    phone: '415-123-4567',
  });

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

#### PHP

```php
<?php

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

$address = $client->address->create([
    'street1' => '417 MONTGOMERY ST',
    'street2' => 'FLOOR 5',
    'city'    => 'San Francisco',
    'state'   => 'CA',
    'zip'     => '94104',
    'country' => 'US',
    'company' => 'EasyPost',
    'phone'   => '415-123-4567'
]);

echo $address;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

address = client.address.create(
    street1="417 MONTGOMERY ST",
    street2="FLOOR 5",
    city="SAN FRANCISCO",
    state="CA",
    zip="94104",
    country="US",
    company="EasyPost",
    phone="415-123-4567",
)

print(address)
```

#### Ruby

```ruby
require 'easypost'

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

address = client.address.create(
  street1: '417 MONTGOMERY ST',
  street2: 'FLOOR 5',
  city: 'SAN FRANCISCO',
  state: 'CA',
  zip: '94104',
  country: 'US',
  company: 'EasyPost',
  phone: '415-123-4567',
)

puts address
```

Depending on your use case an `Address` can be used in many different ways. Certain carriers allow rating between two zip codes, but full addresses are required to purchase postage. It is recommended to provide as much information as possible during creation and to reuse these objects whenever possible.

`Address` objects can also be created inline while creating another object, for example during `Shipment` creation.

[Note: This object is immutable after creation. Review the rendered documentation for details.]

---

### Verify an Address

> Important: Address verification is triggered when the `verify` or `verify_strict` parameter is included in the
  request, **even if the value is `false`**. To prevent verification, omit these parameters entirely.

Verifying an `Address` before shipping is a great way to reduce issues with delivery.

An address can be verified by including one of the following parameters during creation:

- `verify`: Performs standard delivery and ZIP+4 checks.
- `verify_strict`: Performs strict verification. If any check fails, the request will return an error.
- `verify_carrier`: Allows carrier-grade verification with UPS or FedEx. Must be set to `"ups"` or `"fedex"` and used in combination with `verify` or `verify_strict` (`true`).

The most effective time to perform address verification is when the delivery address is entered. If verification fails, request confirmation from the person entering the data, as they may know their
address more accurately than the verification process.

The examples below demonstrate different verification options, including delivery checks and strict verification.

> Note: As of August 25, 2025, EasyPost only abbreviates street names for **USPS** address verification when the
  validated `street1` field **exceeds 40 characters**.

### Example: Create and Verify

#### cURL

```shell
curl -X POST https://api.easypost.com/v2/addresses/create_and_verify \
  -u "EASYPOST_API_KEY": \
  -H 'Content-Type: application/json' \
  -d '{
    "address": {
      "street1": "000 unknown street",
      "city": "Not A City",
      "state": "ZZ",
      "zip": "00001",
      "country": "US",
      "email": "test@example.com",
      "phone": "5555555555"
    }
  }'
```

#### Go

```go
package example

import (
	"fmt"

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

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

	address, _ := client.CreateAndVerifyAddress(
		&easypost.Address{
			Street1: "000 unknown street",
			City:    "Not A City",
			State:   "ZZ",
			Zip:     "00001",
			Country: "US",
			Email:   "test@example.com",
			Phone:   "5555555555",
		},
		&easypost.CreateAddressOptions{},
	)

	fmt.Println(address)
}
```

#### Java

```java
package addresses;

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

import java.util.HashMap;

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

        HashMap<String, Object> params = new HashMap<String, Object>();

        params.put("street1", "000 unknown street");
        params.put("city", "Not A City");
        params.put("state", "ZZ");
        params.put("zip", "00001");
        params.put("country", "US");
        params.put("email", "test@example.com");
        params.put("phone", "5555555555");

        Address address = client.address.createAndVerify(params);

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

#### 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.Address.Create parameters = new()
            {
                Street1 = "000 unknown street",
                City = "Not A City",
                State = "ZZ",
                Zip = "00001",
                Country = "US",
                Email = "test@example.com",
                Phone = "5555555555",
            };

            EasyPost.Models.API.Address address = await client.Address.CreateAndVerify(parameters);

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

#### Node.js

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

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const address = await client.Address.createAndVerify({
    street1: '000 unknown street',
    city: 'Not A City',
    state: 'ZZ',
    zip: '00001',
    country: 'US',
    email: 'test@example.com',
    phone: '5555555555',
  });

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

#### PHP

```php
<?php

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

$address = $client->address->createAndVerify([
    'street1' => '000 unknown street',
    'city'    => 'Not a City',
    'state'   => 'ZZ',
    'zip'     => '00001',
    'country' => 'US',
    'email' => 'test@example.com',
    'phone'   => '5555555555',
]);

echo $address;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

address = client.address.create_and_verify(
    street1="000 unknown street",
    city="Not A City",
    state="ZZ",
    zip="00001",
    country="US",
    email="test@example.com",
    phone="5555555555",
)

print(address)
```

#### Ruby

```ruby
require 'easypost'

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

address = client.address.create_and_verify(
  street1: '000 unknown street',
  city: 'Not A City',
  state: 'ZZ',
  zip: '00001',
  country: 'US',
  email: 'test@example.com',
  phone: '5555555555',
)

puts address
```

### Example: Verifying an Address

#### cURL

```shell
curl -X GET https://api.easypost.com/v2/addresses/adr_.../verify \
  -u "EASYPOST_API_KEY":
```

#### Go

```go
package example

import (
	"fmt"

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

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

	address, _ := client.VerifyAddress("adr_...")

	fmt.Println(address)
}
```

#### Java

```java
package addresses;

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

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

        Address address = client.address.verify("adr_...");

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

#### 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"));

            address = await client.Address.Verify("adr_...");

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

#### Node.js

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

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const address = await client.Address.verifyAddress('adr_...');

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

#### PHP

```php
<?php

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

$address = $client->address->verify('adr_...');

echo $address;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

address = client.address.verify("adr_...")

print(address)
```

#### Ruby

```ruby
require 'easypost'

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

address = client.address.verify('adr_...')

puts address
```

### Example: Strict-Verifying an Address

#### cURL

```shell
curl -X POST https://api.easypost.com/v2/addresses \
  -u "EASYPOST_API_KEY": \
  -H 'Content-Type: application/json' \
  -d '{
    "address": {
      "street1": "000 unknown street",
      "city": "Not A City",
      "state": "ZZ",
      "zip": "00001",
      "country": "US",
      "email": "test@example.com",
      "phone": "5555555555"
    },
    "verify_strict": true
  }'
```

#### Go

```go
package example

import (
	"fmt"

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

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

	address, _ := client.CreateAddress(
		&easypost.Address{
			Street1: "000 unknown street",
			City:    "Not A City",
			State:   "ZZ",
			Zip:     "00001",
			Country: "US",
			Email:   "test@example.com",
			Phone:   "5555555555",
		},
		&easypost.CreateAddressOptions{
			VerifyStrict: true,
		},
	)

	fmt.Println(address)
}
```

#### Java

```java
package addresses;

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

import java.util.HashMap;

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

        HashMap<String, Object> params = new HashMap<String, Object>();

        params.put("street1", "000 unknown street");
        params.put("city", "Not A City");
        params.put("state", "ZZ");
        params.put("zip", "00001");
        params.put("country", "US");
        params.put("email", "test@example.com");
        params.put("phone", "5555555555");
        params.put("verify_strict", true);

        Address address = client.address.create(params);

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

#### 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.Address.Create parameters = new()
            {
                Street1 = "000 unknown street",
                City = "Not A City",
                State = "ZZ",
                Zip = "00001",
                Country = "US",
                Email = "test@example.com",
                Phone = "5555555555",
                VerifyStrict = true
            };

            EasyPost.Models.API.Address address = await client.Address.Create(parameters);

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

#### Node.js

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

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const address = await client.Address.create({
    verify_strict: true,
    street1: '000 unknown street',
    city: 'Not A City',
    state: 'ZZ',
    zip: '00001',
    country: 'US',
    email: 'test@example.com',
    phone: '5555555555',
  });

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

#### PHP

```php
<?php

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

$address = $client->address->create([
    'verify_strict'  => true,
    'street1' => '000 unknown street',
    'city'    => 'Not a City',
    'state'   => 'ZZ',
    'zip'     => '00001',
    'country' => 'US',
    'email' => 'test@example.com',
    'phone'   => '5555555555',
]);

echo $address;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

address = client.address.create(
    verify_strict=True,
    street1="000 unknown street",
    city="Not A City",
    state="ZZ",
    zip="00001",
    country="US",
    email="test@example.com",
    phone="5555555555",
)

print(address)
```

#### Ruby

```ruby
require 'easypost'

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

address = client.address.create(
  verify_strict: true,
  street1: '000 unknown street',
  city: 'Not A City',
  state: 'ZZ',
  zip: '00001',
  country: 'US',
  email: 'test@example.com',
  phone: '5555555555',
)

puts address
```

### Example: Verify an Existing Address

#### cURL

```shell
curl -X POST https://api.easypost.com/v2/addresses \
  -u "EASYPOST_API_KEY": \
  -H 'Content-Type: application/json' \
  -d '{
    "address": {
      "street1": "000 unknown street",
      "city": "Not A City",
      "state": "ZZ",
      "zip": "00001",
      "country": "US",
      "email": "test@example.com",
      "phone": "5555555555"
    },
    "verify": true
  }'
```

#### Go

```go
package example

import (
	"fmt"

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

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

	address, _ := client.CreateAddress(
		&easypost.Address{
			Street1: "000 unknown street",
			City:    "Not A City",
			State:   "ZZ",
			Zip:     "00001",
			Country: "US",
			Email:   "test@example.com",
			Phone:   "5555555555",
		},
		&easypost.CreateAddressOptions{
			Verify: true,
		},
	)

	fmt.Println(address)
}
```

#### Java

```java
package addresses;

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

import java.util.HashMap;

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

        HashMap<String, Object> params = new HashMap<String, Object>();

        params.put("street1", "000 unknown street");
        params.put("city", "Not A City");
        params.put("state", "ZZ");
        params.put("zip", "00001");
        params.put("country", "US");
        params.put("email", "test@example.com");
        params.put("phone", "5555555555");
        params.put("verify", true);

        Address address = client.address.create(params);

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

#### 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.Address.Create parameters = new()
            {
                Street1 = "000 unknown street",
                City = "Not A City",
                State = "ZZ",
                Zip = "00001",
                Country = "US",
                Email = "test@example.com",
                Phone = "5555555555",
                Verify = true
            };

            EasyPost.Models.API.Address address = await client.Address.Create(parameters);

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

#### Node.js

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

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const address = await client.Address.create({
    verify: true,
    street1: '000 unknown street',
    city: 'Not A City',
    state: 'ZZ',
    zip: '00001',
    country: 'US',
    email: 'test@example.com',
    phone: '5555555555',
  });

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

#### PHP

```php
<?php

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

$address = $client->address->create([
    'verify'  => true,
    'street1' => '000 unknown street',
    'city'    => 'Not a City',
    'state'   => 'ZZ',
    'zip'     => '00001',
    'country' => 'US',
    'email' => 'test@example.com',
    'phone'   => '5555555555',
]);

echo $address;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

address = client.address.create(
    verify=True,
    street1="000 unknown street",
    city="Not A City",
    state="ZZ",
    zip="00001",
    country="US",
    email="test@example.com",
    phone="5555555555",
)

print(address)
```

#### Ruby

```ruby
require 'easypost'

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

address = client.address.create(
  verify: true,
  street1: '000 unknown street',
  city: 'Not A City',
  state: 'ZZ',
  zip: '00001',
  country: 'US',
  email: 'test@example.com',
  phone: '5555555555',
)

puts address
```

---

## Retrieve all Addresses

### Example: GET /addresses

#### cURL

```shell
curl -X GET "https://api.easypost.com/v2/addresses?page_size=5" \
  -u "EASYPOST_API_KEY":
```

#### Go

```go
package example

import (
	"fmt"

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

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

	addresses, _ := client.ListAddresses(
		&easypost.ListOptions{
			PageSize: 5,
		},
	)

	fmt.Println(addresses)
}
```

#### Java

```java
package addresses;

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

import java.util.HashMap;

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

        HashMap<String, Object> params = new HashMap<>();

        params.put("page_size", 5);

        AddressCollection addresses = client.address.all(params);

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

#### 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.Address.All parameters = new()
            {
                PageSize = 5
            };

            EasyPost.Models.API.AddressCollection addressCollection = await client.Address.All(parameters);

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

#### Node.js

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

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const addresses = await client.Address.all({
    page_size: 5,
  });

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

#### PHP

```php
<?php

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

$addresses = $client->address->all([
    'page_size' => 5
]);

echo $addresses;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

addresses = client.address.all(page_size=5)

print(addresses)
```

#### Ruby

```ruby
require 'easypost'

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

addresses = client.address.all(
  page_size: 5,
)

puts addresses
```

A list of all `Address` objects associated with the given `API Key` can also be retrieved. See the Pagination section of our docs for more details on retrieving all records when multiple pages are available.

---

## Retrieve an Address

### Example: GET /addresses/:id

#### cURL

```shell
curl -X GET https://api.easypost.com/v2/addresses/adr_... \
  -u "EASYPOST_API_KEY":
```

#### Go

```go
package example

import (
	"fmt"

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

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

	address, _ := client.GetAddress("adr_...")

	fmt.Println(address)
}
```

#### Java

```java
package addresses;

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

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

        Address address = client.address.retrieve("adr_...");

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

#### 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.Models.API.Address address = await client.Address.Retrieve("adr_...");

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

#### Node.js

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

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const address = await client.Address.retrieve('adr_...');

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

#### PHP

```php
<?php

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

$address = $client->address->retrieve('adr_...');

echo $address;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

address = client.address.retrieve("adr_...")

print(address)
```

#### Ruby

```ruby
require 'easypost'

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

address = client.address.retrieve('adr_...')

puts address
```

An `Address` can be retrieved by its `id`.