Overview
This node integrates with the KiotViet platform to manage product data. It supports various operations such as creating new products, deleting products, retrieving product details by ID or code, listing multiple products with filtering options, updating existing products, and fetching inventory levels.
A common use case is automating product management workflows in e-commerce or retail businesses that use KiotViet for inventory and sales management. For example, you can bulk retrieve active products filtered by category or search term, update product prices or descriptions, or synchronize inventory levels across branches.
Specifically, the "Lấy Nhiều" (Get Many) operation allows users to fetch a list of products with optional filters and limits, which is useful for reporting, synchronization, or batch processing scenarios.
Properties
| Name | Meaning |
|---|---|
| Lấy Toàn Bộ (returnAll) | Boolean flag to either fetch all matching products or limit the number of results returned. |
| Giới Hạn (limit) | Maximum number of products to retrieve when not returning all. Must be at least 1. |
| Bộ Lọc (filters) | Collection of filters to narrow down the product list: |
| - ID Danh Mục (categoryId) | Filter products by category ID. |
| - Từ Khóa Tìm Kiếm (searchTerm) | Search products by name or code using a keyword. |
| - Trạng Thái (status) | Filter products by status; options are "Đang Hoạt Động" (Active) or "Ngừng Hoạt Động" (Inactive). |
Output
The node outputs an array of product objects in JSON format. Each product object contains detailed information as provided by the KiotViet API, including but not limited to:
- Product identifiers (ID, code)
- Name and description
- Pricing details (base price, retail price)
- Category information
- Status and availability flags
- Attributes and variants if any
- Inventory details per branch (if applicable)
- Images URLs
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential for authenticating with the KiotViet API.
- The node depends on the internal KiotViet API client library bundled within the node's shared code.
- Proper configuration of the API credential in n8n is necessary for successful communication.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Providing invalid filter values (e.g., non-numeric category IDs) may result in API errors.
- Requesting too many records without enabling "Lấy Toàn Bộ" might lead to incomplete data retrieval.
Error messages:
- Errors from the KiotViet API are propagated and typically include descriptive messages.
- If the node is set to continue on failure, error details are returned in the output JSON under an
errorfield.
Resolutions:
- Verify API credentials and permissions.
- Ensure filter inputs conform to expected types and formats.
- Use the "Lấy Toàn Bộ" option when needing full datasets, or set reasonable limits to avoid timeouts.
Links and References
- KiotViet Official Website
- KiotViet API Documentation (may require login)
- n8n documentation on creating custom nodes