Overview
This node manages products in the KiotViet system, allowing users to create, update, retrieve, and delete product records. It is useful for automating inventory management, product catalog updates, and synchronization between KiotViet and other systems.
For the Update operation specifically, the node updates an existing product's details such as name, code, description, pricing, inventory levels, attributes, and images. This is beneficial when you need to keep product information current, e.g., updating prices, stock quantities, or adding new product attributes.
Practical example:
- Automatically update product details after receiving new supplier data.
- Sync product inventory levels from a warehouse management system.
- Modify product descriptions or add barcodes based on marketing updates.
Properties
| Name | Meaning |
|---|---|
| ID Sản Phẩm | The unique identifier of the product to update (required). |
| Tên Sản Phẩm | The new name of the product (required). |
| Trường Bổ Sung | Additional optional fields to update on the product: |
| - Mã Sản Phẩm | Product code identifier. |
| - Mô Tả | Description of the product. |
| - Đơn Vị | Unit of measurement for the product. |
| - Cho Phép Bán | Boolean indicating if the product is allowed to be sold. |
| - Mã Vạch | Barcode of the product (up to 16 characters). |
| - Tên Đầy Đủ | Full product name including attributes and unit. |
| - Có Thuộc Tính | Boolean indicating if the product has variants/attributes. |
| - Sản Phẩm Serial | Boolean indicating if the product is serialized. |
| - Thuộc Tính | List of attribute name-value pairs describing product variants or features. |
| - ID Hàng Hóa Cha | Parent product ID if this product is a variant. |
| - ID Đơn Vị Cơ Bản | Basic unit ID; null if this is the basic unit. |
| - Giá Trị Quy Đổi | Conversion value between units. |
| - Tồn Kho | Inventory details per branch/warehouse, including branch ID, name, quantity on hand, and cost. |
| - Trọng Lượng | Weight of the product. |
| - Hình Ảnh | URLs of product images. |
Output
The node outputs JSON data representing the updated product object returned by the KiotViet API. This includes all updated fields such as product ID, name, codes, attributes, inventory levels, and images.
If the update is successful, the output contains the full product data reflecting the changes. If the update fails and "continue on fail" is enabled, the output will contain an error message for that item.
No binary data output is produced by this node.
Dependencies
- Requires connection to the KiotViet API via an API key credential configured in n8n.
- The node uses the KiotViet API client internally to perform product operations.
- Proper API permissions are needed to update product data.
Troubleshooting
Common issues:
- Invalid or missing product ID will cause update failure.
- Incorrect data types for numeric fields (e.g., categoryId, masterProductId) may cause errors.
- Providing invalid attribute structures or image URLs can lead to API rejection.
- Network or authentication errors with the KiotViet API.
Error messages:
"Product not found": Check that the product ID exists in KiotViet."Invalid parameter": Verify all input fields conform to expected types and constraints.- Authentication errors: Ensure the API key credential is valid and has required scopes.
To resolve errors, verify input parameters carefully, ensure correct data types, and confirm API credentials.
Links and References
- KiotViet API Documentation
- n8n documentation on creating custom nodes