# Nhà cung cấp

* /api/supplier/search: Tính năng này được sử dụng để lấy danh nhà cung cấp trên Nhanh, phân trang tối đa 50 tin tức/page, hỗ trợ lấy theo id nhà cung cấp > id nhà cung cấp truyền lên, hỗ trợ lọc bài viết theo danh mục.

## 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)                                    |
| icpp   | int    | Số lượng nhân viên trên 1 trang. Mặc định là 10. Tối đa không quá 50. |
| lastId | int    | Tìm kiếm nhà cung cấp có id > lastId.                                 |
| name   | string | Tìm kiếm theo tên nhà cung cấp.                                       |
| code   | string | Tìm kiếm theo mã nhà cung cấp.                                        |
| mobile | string | Tìm kiếm theo số điện thoại nhà cung cấp.                             |

## Response

* JSON decode the response to get the structure:

| Key      | Type  | Description                               |
| -------- | ----- | ----------------------------------------- |
| code     | int   | 1 = success or 0 = failed                 |
| messages | array | is an array of error messages if code = 0 |
| data     | array | is an array of suppliers                  |

```javascript
data = [
    "totalPages" => int, //tổng số page
    "page" => int, // page hiện tại
    "result" => [ // Kết quả trả về
        // supplier 1
        [
            "id" => int, // id nhà cung cấp
            "typeId" => int, // Loại: 1 = Cá nhân, 2 = Doanh nghiệp, null = Chưa xác định
            "code" => string, // Mã nhà cung cấp
            "name" => string, // Tên nhà cung cấp
            "representativeName" => string, // Tên người đại diện
            "representativePosition" => string, // Vị trí người đại diện,
            "representativeMobile" => int, // Số điện thoại người đại diện
            "address" => string, // Địa chỉ nhà cung cấp
            "mobile" => string, // Số điện thoại nhà cung cấp
            "email" => string, // Email nhà cung cấp
            "bankName" => string, // Ngân hàng
            "bankBranch" => string, // Chi nhánh
            "bankAccountNumber" => string, // Số tài khoản
            "status" => int, // Trạng thái: 1 = Active, 2 = Inactive
            "note" => string // Ghi chú
        ],
        ...
    ]
]
```


---

# 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/supplier/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.
