> For the complete documentation index, see [llms.txt](https://apidoc.247express.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidoc.247express.vn/customer/tao-dia-chi.md).

# Tạo địa chỉ gửi hàng

## Địa chỉ  <a href="#dia-chi-nguoi-nhan" id="dia-chi-nguoi-nhan"></a>

* Đối với địa chỉ có cấu trúc 3 cấp (Tỉnh/thành, quận/huyện, phường/xã theo cấu trúc địa giới Việt Nam trước ngày 01.07.2025) truyền thông tin như sau:
  * ProvinceName: tên tỉnh/thành người nhận.
  * DistrictName: tên quận/huyện người nhận.
  * WardName: tên phường/xã người nhận.
* Đối với địa chỉ có cấu trúc 2 cấp (Tỉnh/thành, phường/xã theo cấu trúc địa giới Việt Nam từ ngày 01.07.2025) truyền thông tin như sau:
  * ProvinceName: tên tỉnh/thành người nhận.
  * <mark style="color:red;">DistrictName: không truyền.</mark>
  * WardName: tên phường/xã người nhận.

## CustomerInsertClientHub

<mark style="color:green;">`POST`</mark> `/Api/Customer/CustomerInsertClientHub`

#### Request Body

| Name                                           | Type   | Description                                                                           |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------- |
| Address<mark style="color:red;">\*</mark>      | string | Địa chỉ khách hàng theo định dạng Số nhà/đường, Phường/Xã, Quận/Huyện, Tỉnh/Thành phố |
| ContactName<mark style="color:red;">\*</mark>  | string | Tên liên hệ                                                                           |
| ContactPhone<mark style="color:red;">\*</mark> | string | Số điện thoại liên hệ                                                                 |
| ProvinceName<mark style="color:red;">\*</mark> | string | Tên Tỉnh/Thành phố                                                                    |
| DistrictName<mark style="color:red;">\*</mark> | string | Tên Quận/Huyện                                                                        |
| WardName                                       | string | Tên Phường/Xã                                                                         |
| CusWarehouseID                                 | string | Mã Shop/Kho                                                                           |
| CusWarehouseName                               | string | Tên Shop/Kho                                                                          |

{% tabs %}
{% tab title="200 Cake successfully retrieved" %}

```
{
    "HubInfo": {
        "Address": "HH1, Yên Hòa, Cầu Giấy, Hà Nội",
        "WardID": "CYGYHO",
        "ClientHubID": "248",
        "ContactName": "Nguyễn Thành Trung",
        "ContactPhone": "0986226622",
        "DistrictID": "CGY",
        "IsMain": "true",
        "ProvinceID": "HNI",
        "CustomerID": "15",
        "Status": "Init",
        "StatusName": "Chờ duyệt",
        "CusWarehouseName": "Chi nhánh HN1"
    },
    "Errors": [],
    "ErrorMessage": ""
}
```

{% endtab %}
{% endtabs %}

### Mẫu ví dụ

```
{
    "HubInfo": 
	{
        "Address": "326 Võ Văn Kiệt, Phường Cầu Ông Lãnh, Hồ Chí Minh",
        "ContactName": "Nguyễn Văn A",
        "ContactPhone": "0909123456",
        "ProvinceName": "Thành phố Hồ Chí Minh",
        "WardName": "Phường cầu ông lãnh",
        "CusWarehouseID": "30984",
        "CusWarehouseName": "Chi nhánh số 3"
    }
}
```
