**Version: 202201**

# Update Address

**PUT** `/openapi/2022-01/customers/:customer_id/addresses/:address_id`

Update the details of an existing address using its unique identifier.

## Request

**Path Parameters**

- `customer_id` string (required)

  Cusomer's ID
- `address_id` string (required)

  Address's ID

**application/json**

**Body | Example**

**Body**

- `first_name` string

  First name of consignee.
- `last_name` string

  Last name of consignee.
- `gender` string

  Gender of consignee, acceptable value: `female`, `male`
- `email` string
- `phone` string

  Phone number, for example: `+86 150 1447 1143`
- `address1` string

  Street address, for example: `1 Rue des Carrieres`
- `address2` string

  Apartment/floor/room number, for example: `Suite 1234`
- `area` string

  Area, for example: `Bay area`
- `city` string

  City, for example: `SAN JOSE`
- `province` string

  Province, for example: `New Mexico`
- `province_code` string

  Province Code, for example: `US-NM`
- `country` string

  Country, for example: `United States`
- `country_code` string

  Country code, for example: `US`
- `zip` string

  ZIP code, for example: `87036`
- `company` string

  Company, for example: `ABC Limited`
- `default` boolean

  Default address or not

```json
{
  "first_name": "string",
  "last_name": "string",
  "gender": "string",
  "email": "string",
  "phone": "string",
  "address1": "string",
  "address2": "string",
  "area": "string",
  "city": "string",
  "province": "string",
  "province_code": "string",
  "country": "string",
  "country_code": "string",
  "zip": "string",
  "company": "string",
  "default": true
}
```

## Responses

**200 | 404 | 422**

200

**application/json**

**Schema | Example | Result**

**Schema**

- `address` object

  - `id` string

    **Example:** `2490dc6a-d511-4e5e-bbcb-d58e913243ad`
  - `customer_id` string

    **Example:** `2dd957e3-2051-4cdf-8584-9c0046b4d1ae`
  - `first_name` string

    **Example:** `Ryan`
  - `last_name` string

    **Example:** `zhang`
  - `company` string

    **Example:** `ABC Limited`
  - `city` string

    **Example:** `SAN JOSE`
  - `province` string

    **Example:** `New Mexico`
  - `country` string

    **Example:** `United States`
  - `zip` string

    **Example:** `87036`
  - `province_code` string

    **Example:** `NM`
  - `country_code` string

    **Example:** `US`
  - `gender` string

    **Example:** `male`
  - `phone` string

    **Example:** `+8615015570043`
  - `phone_area_code` string

    **Example:** `+86`
  - `area` string

    **Example:** `Bay area`
  - `email` string

    **Example:** `ryan@shoplazza.com`
  - `name` string

    **Example:** `Ryan zhang`
  - `address1` string

    **Example:** `1 Rue des Carrieres`
  - `address2` string

    **Example:** `Suite 1234`
  - `country_name` string

    **Example:** `United States`
  - `default` boolean

    **Default value:** `true`

    **Example:** `true`

```json
{
  "address": {
    "id": "2490dc6a-d511-4e5e-bbcb-d58e913243ad",
    "customer_id": "2dd957e3-2051-4cdf-8584-9c0046b4d1ae",
    "first_name": "Ryan",
    "last_name": "zhang",
    "company": "ABC Limited",
    "city": "SAN JOSE",
    "province": "New Mexico",
    "country": "United States",
    "zip": "87036",
    "province_code": "NM",
    "country_code": "US",
    "gender": "male",
    "phone": "+8615015570043",
    "phone_area_code": "+86",
    "area": "Bay area",
    "email": "ryan@shoplazza.com",
    "name": "Ryan zhang",
    "address1": "1 Rue des Carrieres",
    "address2": "Suite 1234",
    "country_name": "United States",
    "default": true
  }
}
```

```json
{
    "address": {
        "id": "2490dc6a-d511-4e5e-bbcb-d58e913243ad",
        "customer_id": "2dd957e3-2051-4cdf-8584-9c0046b4d1ae",
        "first_name": "Ryan",
        "last_name": "zhang",
        "company": "ABC Limited",
        "city": "SAN JOSE",
        "province": "New Mexico",
        "country": "United States",
        "zip": "87036",
        "province_code": "NM",
        "country_code": "US",
        "gender": "male",
        "phone": "+8615015570043",
        "phone_area_code": "+86",
        "area": "Bay area",
        "email": "ryan@shoplazza.com",
        "name": "Ryan zhang",
        "address1": "1 Rue des Carrieres",
        "address2": "Suite 1234",
        "country_name": "United States",
        "default": true
    }
}
```

404

**application/json**

No schema

422

**application/json**

**Schema | Example | Result**

**Schema**

- `errors` string[]

```json
{
  "errors": [
    "Gender is not included in the list"
  ]
}
```

```json
   {
  "errors": [
     "Gender is not included in the list",
     "Email is invalid"
  ]
}
```
