# 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"
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidoc.247express.vn/customer/tao-dia-chi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
