**版本：202201**

# 创建地址

**POST** `/openapi/2022-01/customers/:customer_id/addresses`

使用提供的详情创建新地址。

## 请求

**Path参数**

- `customer_id` string (required)

  顾客 ID。

**application/json**

**请求体 | 示例**

**请求体**

- `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`
- `phone_area_code` string

  Area code, for example: `+86`
- `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: `NM`
- `country` string (required)

  Country, for example: `United States`
- `country_code` string (required)

  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",
  "phone_area_code": "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
}
```

## 响应

**200 | 422**

200

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `address` object

  - `id` string

    **示例：** `2490dc6a-d511-4e5e-bbcb-d58e913243ad`
  - `customer_id` string

    **示例：** `2dd957e3-2051-4cdf-8584-9c0046b4d1ae`
  - `first_name` string

    **示例：** `Ryan`
  - `last_name` string

    **示例：** `zhang`
  - `company` string

    **示例：** `ABC Limited`
  - `city` string

    **示例：** `SAN JOSE`
  - `province` string

    **示例：** `New Mexico`
  - `country` string

    **示例：** `United States`
  - `zip` string

    **示例：** `87036`
  - `province_code` string

    **示例：** `NM`
  - `country_code` string

    **示例：** `US`
  - `gender` string

    **示例：** `male`
  - `phone` string

    **示例：** `+8615015570043`
  - `phone_area_code` string

    **示例：** `+86`
  - `area` string

    **示例：** `Bay area`
  - `email` string

    **示例：** `ryan@shoplazza.com`
  - `name` string

    **示例：** `Ryan zhang`
  - `address1` string

    **示例：** `1 Rue des Carrieres`
  - `address2` string

    **示例：** `Suite 1234`
  - `country_name` string

    **示例：** `United States`
  - `default` boolean

    **默认值：** `true`

    **示例：** `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
    }
}
```

422

**application/json**

无 Schema
