# Danh sách gian hàng

* /api/ecom/shops: Tính năng này dùng để lấy danh sách gian hàng sàn TMĐT

## Request

* Xem các [common request params](/v2/readme.md#request-params)
* Các key của mảng **data array** dùng để tạo **data** json string:

| Key   | Type | Description                                                                          |
| ----- | ---- | ------------------------------------------------------------------------------------ |
| page  | int  | Phân trang (giá trị mặc định là 1)                                                   |
| appId | int  | ID sàn TMĐT (8195 = Shopee, 8855 = Tiktok, 8142 = Lazada, 8237 = Sendo, 8238 = Tiki) |

## Response:

* JSON decode the response to get the structure:

| Key      | Type | Description                               |
| -------- | ---- | ----------------------------------------- |
| code     | int  | 1 = success or 0 = failed                 |
| messages | \[ ] | is an array of error messages if code = 0 |
| data     | \[ ] | is an array of shop list                  |

```javascript
[
    "totalPages" => int,
    "page" => int,
    "shops" => [ // maximum 100 shops per page
        // shop 1
        [
            // see properties in the table below
        ],
        ...
    ]
]
```

| Key       | Type        | Description                                                                          |
| --------- | ----------- | ------------------------------------------------------------------------------------ |
| shopId    | string (64) | ID gian hàng trên sàn TMĐT                                                           |
| appId     | int         | ID sàn TMĐT (8195 = Shopee, 8855 = Tiktok, 8142 = Lazada, 8237 = Sendo, 8238 = Tiki) |
| shopName  | string      | Tên gian hàng trên sàn TMĐT                                                          |
| createdAt | int         | Ngày tạo gian hàng trên Nhanh.vn (định dạng timestamp)                               |
| expiredAt | int         | Ngày hết hạn gian hàng trên Nhanh.vn (định dạng timestamp)                           |


---

# 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://apidocs.nhanh.vn/v2/ecommerce/index.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.
