# Thêm nhà cung cấp

* API này dùng để [thêm mới nhà cung cấp](https://nhanh.vn/supplier/manage/add).

## Request

* Xem [common request params](/v3/readme.md#request-params).

```curl
curl --location --globoff 'https://pos.open.nhanh.vn/v3.0/business/addsupplier?appId={{appId}}&businessId={{businessId}}' \
--header 'Authorization: {{accessToken}}' \
--header 'Content-Type: application/json' \
--data '{
    "name": "Test API V3",
    "code": "",
    "mobile": "",
    "email": "",
    "address": "",
    "taxCode": "",
    "typeId": 1,
    "personalId": "",
    "status": 1,
    "bank" : {
        "name": "VP Bank",
        "branch": "Hoàn Kiếm",
        "accountNumber": "6868686",
        "accountHolder": "Lê Văn A"
    },
    "note": ""
}'
```

* Thông tin nhập nhà cung cấp:

| Key        | Type                          | Description                                                 |
| ---------- | ----------------------------- | ----------------------------------------------------------- |
| name       | string $$^{{\color{red}\*}}$$ | Tên nhà cung cấp                                            |
| code       | string                        | Mã code nhà cung cấp                                        |
| mobile     | string                        | Số điện thoại nhà cung cấp                                  |
| email      | string                        | Email nhà cung cấp                                          |
| address    | string                        | Địa chỉ nhà cung cấp                                        |
| taxCode    | string                        | Mã số thuế nhà cung cấp                                     |
| typeId     | int                           | <p>Loại nhà cung cấp<br>1 = Cá nhân<br>2 = Doanh nghiệp</p> |
| personalId | string                        | Số căn cước công dân hoặc CMND                              |
| note       | string                        | Ghi chú                                                     |
| bank       | object                        | [Thông tin thanh toán](#payment)                            |

### payment

* Thông tin thanh toán

| Key           | Type   | Description                 |
| ------------- | ------ | --------------------------- |
| name          | string | Tên ngân hàng NCC           |
| branch        | string | Tên chi nhánh ngân hàng NCC |
| accountNumber | string | Số tài khoản NCC            |
| accountHolder | string | Tên người đại diện          |

## Response

* Xem cấu trúc chung [tại đây](/v3/readme.md#response).

### Failed response

* Xem các mã lỗi chung [tại đây](/v3/readme.md#failed-response).

### Successful response

```json
{
    "code": 1,
        "data": {
            "id": "(int) ID nhà cung cấp",
            "status": "(int) Trạng thái nhà cung cấp (1: Đang giao dịch, 2: Ngừng giao dị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/v3/business/addsupplier.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.
