Overview
This node integrates with the KiotViet product management system, allowing users to manage and retrieve product data from KiotViet. Specifically, the "Lấy Tồn Kho" (Get Inventory Levels) operation fetches inventory information for products, filtered by various criteria such as branch IDs, product codes, update dates, and pagination options.
Common scenarios where this node is beneficial include:
- Monitoring stock levels across multiple branches or warehouses.
- Filtering inventory data by product codes or last update timestamps.
- Paginating through large inventories to process or analyze stock data incrementally.
For example, a retail business can use this node to automatically pull updated inventory levels from their KiotViet account for specific branches and products, enabling real-time stock monitoring and automated reorder triggers.
Properties
| Name | Meaning |
|---|---|
| Bộ Lọc Tồn Kho | Collection of filters to refine the inventory data retrieval: |
| - Bắt ĐầU Từ Item | Starting index (offset) in the inventory list to begin fetching data from (number, min 0). |
| - Chi Nhánh | Comma-separated string of branch IDs to filter inventory by specific branches. |
| - ĐếN Ngày Cập Nhật | Filter inventory updated up to this date/time (inclusive). |
| - Mã Sản Phẩm | Comma-separated product codes to filter inventory for specific products. |
| - Sắp Xếp Theo | Field name to sort the inventory results by (e.g., Code, Name). |
| - Số Lượng Mỗi Trang | Number of items per page to fetch; default is 20, maximum 100. |
| - Từ Ngày Cập Nhật | Filter inventory updated starting from this date/time (inclusive). |
Output
The output JSON contains an array of inventory level objects matching the specified filters. Each object typically includes details such as product identifiers, branch information, stock quantities, and possibly cost data.
If binary data were involved (not in this case), it would represent files or media related to the inventory or products.
Dependencies
- Requires an API key credential for authenticating with the KiotViet API.
- The node depends on the KiotViet API client implemented in the shared module.
- Proper configuration of the API credentials within n8n is necessary for successful communication.
Troubleshooting
Common Issues:
- Invalid or missing API credentials will cause authentication failures.
- Incorrectly formatted branch IDs or product codes (e.g., non-numeric branch IDs or malformed strings) may result in empty or error responses.
- Requesting too many items per page (above 100) will be rejected by the API.
Error Messages:
- Authentication errors indicate issues with the provided API key; verify and re-enter credentials.
- Validation errors on input parameters suggest checking the format and types of filters.
- Network or timeout errors require checking connectivity and API availability.
Links and References
- KiotViet Official API Documentation
- n8n documentation on Creating Custom Nodes