# KiotViet

KiotViet Public API was developed to support the integration and exchange of data between KiotViet and website, e-commerce, CRM platforms... KiotViet Public API provides a mechanism to read and write the following objects: Product, customer , invoice, surcharge,...

On this page, you'll find a list of operations the KiotViet node supports and links to more resources.

{% hint style="info" %}
**Authentication and terms:** Refer to [KiotViet Public API ](https://www.kiotviet.vn/huong-dan-su-dung-public-api-retail/)for guidance on setting up authentication and terms about KiotViet Public API.
{% endhint %}

## Basic Operations&#x20;

* Product
  * Lấy Chi Tiết Hàng Hóa
  * Thêm Hàng Hóa Mới
  * Cập Nhật Hàng Hóa
  * Xóa Hàng Hóa
  * Danh Sách Hàng Hóa
  * Lấy Thông Tin Thuộc Tính Hàng Hóa
  * Thêm Mới Danh Sách Hàng Hóa
  * Cập Nhật Danh Sách Hàng Hóa
  * Lấy Danh Sách Hàng Hóa Tồn Kho
* Customer
  * Lấy Chi Tiết Khách Hàng
  * Thêm Mới Khách Hàng
  * Cập Nhật Khách Hàng
  * Xóa Khách Hàng
  * Lấy Danh Sách Khách Hàng
* Order Product
  * Lấy Chi Tiết Đặt Hàng
  * Thêm Mới Đặt Hàng
  * Cập Nhật Đặt Hàng
  * Xóa Đặt Hàng
  * Lấy Danh Sách Đặt Hàng
* Cash Flow
  * Danh Sách Sổ Quỷ
* Commodity Group
  * Lấy Chi Tiết Nhóm Hàng
  * Thêm Mới Nhóm Hàng
  * Cập Nhật Nhóm Hàng
  * Xóa Nhóm Hàng
  * Lấy Danh Sách Nhóm Hàng
* Surcharge
  * Thêm Mới Thu Khác
  * Cập Nhật Thu Khác
  * Ngừng Hoạt Động Thu Khác
  * Lấy Danh Sách Thu Khác
* Invoice
  * Lấy Chi Tiết Hóa Đơn
  * Thêm Hóa Đơn Mới
  * Cập Nhật Hóa Đơn
  * Xóa Hóa Đơn
  * Lấy Danh Sách Hóa Đơn
* Sale Channel
  * Lấy Danh Sách Kênh Bán Hàng
* Price Books
  * Lấy Chi Tiết Bảng Giá
  * Cập Nhật Chi Tiết Bảng Giá
  * Lấy Danh Sách Bảng Giá
* Group
  * Lấy Danh Sách Nhóm Khách Hàng

## Example Usage

This workflow allows you can create a product for your retailer. This example usage workflow would use the following nodes. - Start - KiotViet

<figure><img src="/files/dxQJFYr8mqBn28AF51Xa" alt=""><figcaption><p>Workflow</p></figcaption></figure>

Start node

&#x20; The start node exists by default when you create a new workflow.

2. KiotViet node (Append)

To use KiotViet node, register for a seller account at <https://www.kiotviet.vn/dang-ky/>. After creating an account, go to "Thiết lập cửa hàng" and select "Thiết lập kết nối API" to get Client ID, Client Secret and Retailer. Instructions are available at <https://www.kiotviet.vn/huong-dan-su-dung-public-api-retail/>

<figure><img src="/files/g7Ppj8qXf8OJlf6vE3vY" alt=""><figcaption><p>Select "Thiết lập của hàng"</p></figcaption></figure>

<figure><img src="/files/KxGwL0VtuJeK1SpF9YgU" alt=""><figcaption><p>Select "Thiết lập kết nối API"</p></figcaption></figure>

<figure><img src="/files/1BFQrD8CmIaa5FQjtrCR" alt=""><figcaption><p>Get Retailer, Client ID and Client Secret</p></figcaption></figure>

We will use the **Thêm Mới Hàng Hóa** action in the KiotViet node to set the values for needed fields.

* Click on the Add node or drag to connect button and enter KiotViet in the search nodes box.
* Search **Thêm Mới Hàng Hóa** in the KiotViet Actions search box.
* Select **Create new credential** at **Credential to connect with** field.

<figure><img src="/files/cIAtNJiJAREn410zCP5o" alt=""><figcaption><p>Create new credential</p></figcaption></figure>

Provide your Client ID, Client Secret and Retailer. After that, you can click save to finish creating credentials.

<figure><img src="/files/MEBmDTDniVxkcrG0NF99" alt=""><figcaption><p>Enter Client ID, Client Secret and Retailer to create credentials</p></figcaption></figure>

Now you can start creating a new product.

* You will see all the fields needed to create a product. You must enter the necessary fields before you can create the product. However, when creating a product, if you select true for **Is Product Serial**, you cannot update it later because the API does not yet support this type of product.

<figure><img src="/files/bxXbl9FqnFqY62x5oD6o" alt=""><figcaption><p>Enter fields</p></figcaption></figure>

<figure><img src="/files/97thum7tGIaipQYKR0w4" alt=""><figcaption><p>Enter Field</p></figcaption></figure>

After you have entered all the necessary fields, you can press the **Execute node** button to run KiotViet node

<figure><img src="/files/cv7xmdqFKBECIhUXTXD0" alt=""><figcaption><p>Click Execute node button</p></figcaption></figure>

After completing the run, KiotViet node will return results like this if run successfully.

<figure><img src="/files/A3W8yhAAVe8catHlgBpg" alt=""><figcaption><p>Create successful</p></figcaption></figure>


---

# 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://docs-tech.n8n.vn/kiotviet.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.
