# Cửa hàng

## Khởi tạo cửa hàng.

<mark style="color:green;">`POST`</mark> `https://api.ghsv.vn/v1/shop/create`

#### Headers

| Name                                           | Type   | Description                                                                                                                                 |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Token<mark style="color:red;">\*</mark>        | String | <p>token-cua-ban</p><p><a data-mention href="/pages/JzLKNPHdm2CKIOz2kSff#khoi-tao-token">/pages/JzLKNPHdm2CKIOz2kSff#khoi-tao-token</a></p> |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json                                                                                                                            |

#### Request Body

| Name                                       | Type   | Description                                                                                                                                                                                                          |
| ------------------------------------------ | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark>     | String | Tên cửa hàng                                                                                                                                                                                                         |
| address<mark style="color:red;">\*</mark>  | String | Địa chỉ cửa hàng                                                                                                                                                                                                     |
| phone<mark style="color:red;">\*</mark>    | String | SĐT cửa hàng (shipper gọi lấy hàng)                                                                                                                                                                                  |
| province<mark style="color:red;">\*</mark> | String | <p>Tên tỉnh thành</p><p><a data-mention href="/pages/yagW9xG8TPo5DlsSRAeD#lay-danh-sach-cac-tinh-thanh-trong-csdl-cua-ghsv.">/pages/yagW9xG8TPo5DlsSRAeD#lay-danh-sach-cac-tinh-thanh-trong-csdl-cua-ghsv.</a></p>   |
| district<mark style="color:red;">\*</mark> | String | <p>Tên quận / huyện</p><p><a data-mention href="/pages/yagW9xG8TPo5DlsSRAeD#lay-danh-sach-cac-quan-huyen-trong-csdl-cua-ghsv.">/pages/yagW9xG8TPo5DlsSRAeD#lay-danh-sach-cac-quan-huyen-trong-csdl-cua-ghsv.</a></p> |
| ward<mark style="color:red;">\*</mark>     | String | <p>Tên xã / phường</p><p><a data-mention href="/pages/yagW9xG8TPo5DlsSRAeD#lay-danh-sach-cac-xa-phuong-trong-csdl-cua-ghsv.">/pages/yagW9xG8TPo5DlsSRAeD#lay-danh-sach-cac-xa-phuong-trong-csdl-cua-ghsv.</a></p>    |

{% tabs %}
{% tab title="200: OK Tạo cửa hàng thành công" %}

```javascript
{
    "success": true,
    "msg": "",
    "shop": {
        "id": 3
    }
}
```

{% endtab %}

{% tab title="200: OK Tạo cửa hành thất bại" %}

```javascript
{
    "success": false,
    "msg": "Tên cửa hàng không được bỏ trống."
}
```

{% endtab %}
{% endtabs %}

## Lấy danh sách cửa hàng.

<mark style="color:blue;">`GET`</mark> `https://api.ghsv.vn/v1/shop/list`

#### Headers

| Name                                    | Type   | Description                                                                                                                                 |
| --------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Token<mark style="color:red;">\*</mark> | String | <p>token-cua-ban</p><p><a data-mention href="/pages/JzLKNPHdm2CKIOz2kSff#khoi-tao-token">/pages/JzLKNPHdm2CKIOz2kSff#khoi-tao-token</a></p> |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "success": true,
    "msg": "",
    "shops": [
        {
            "id": "1",
            "name": "Cửa hàng cơ sở 1",
            "phone": "0123456789",
            "province": "Tỉnh Hải Dương",
            "district": "Thành phố Hải Dương",
            "ward": "Phường Tứ Minh",
            "address": "11 Tứ Minh"
        },
       {
            "id": "2",
            "name": "Cửa hàng cơ sở 2",
            "phone": "0223456789",
            "province": "Tỉnh Hải Dương",
            "district": "Thành phố Hải Dương",
            "ward": "Phường Tứ Minh",
            "address": "12 Tứ Minh"
        }
    ]
}
```

{% endtab %}
{% endtabs %}


---

# 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://developer.ghsv.vn/api/cua-hang.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.
