> For the complete documentation index, see [llms.txt](https://developer.ghsv.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.ghsv.vn/api/cua-hang.md).

# 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 %}
