Overview
This node manages orders in the KiotViet system, a popular retail and inventory management platform. It supports creating new orders, retrieving existing orders by ID or code, updating orders, canceling orders, and listing multiple orders with filtering options.
Typical use cases include:
- Automating order creation from external systems or forms.
- Synchronizing order data between KiotViet and other platforms.
- Updating order details such as products, quantities, discounts, or customer information.
- Canceling orders programmatically with reasons.
- Fetching order lists for reporting or processing workflows.
For example, you could use this node to update an existing order’s product list and pricing after receiving changes from a sales channel, or to cancel an order automatically if payment fails.
Properties
| Name | Meaning |
|---|---|
| ID ĐơN Hàng | The unique identifier of the order (required for get, update, cancel operations). |
| Sản Phẩm Trong ĐơN | List of products in the order. Each product includes: |
| - ID Sản Phẩm: Product identifier (required) | |
| - Số Lượng: Quantity of the product (required) | |
| - Giá Bán: Selling price of the product (required) | |
| - Giảm Giá: Discount amount on the product | |
| - Ghi Chú: Notes related to the product | |
| Trường Bổ Sung | Additional fields for the order including: |
| - ID Khách Hàng: Customer identifier | |
| - Mô Tả: Description of the order | |
| - Giảm Giá: Total discount amount for the entire order |
These properties are used when creating or updating orders.
Output
The node outputs JSON data representing the result of the performed operation:
- For create and update, it returns the updated order object including all details.
- For get and getByCode, it returns the specific order data.
- For getAll, it returns a paginated list of orders with metadata such as total count and page size.
- For cancel, it returns confirmation or status of the cancellation.
The output is structured as an array of JSON objects, each corresponding to an input item processed.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating with the KiotViet API.
- The node depends on the KiotViet API service being accessible.
- Proper configuration of the API credentials in n8n is necessary.
Troubleshooting
Common issues:
- Invalid or missing order IDs when performing get, update, or cancel operations will cause errors.
- Providing incomplete product details (e.g., missing productId or quantity) during create or update may lead to API rejections.
- Network or authentication failures with the KiotViet API can interrupt execution.
Error messages:
- "Update operation is not supported by the KiotViet API": This indicates the API client does not support updating orders; ensure your API version supports this.
- "Cancel operation is not supported by the KiotViet API": Similar to above, check API capabilities.
- General API errors will be returned with their message; verify credentials and input parameters.
To resolve errors, verify that required fields are correctly set, credentials are valid, and the KiotViet API is reachable.
Links and References
- KiotViet Official Website
- KiotViet API Documentation (for detailed API usage and capabilities)