Overview
This node integrates with the KiotViet invoicing system to manage invoices programmatically. It supports creating new invoices, retrieving invoices by ID or code, listing multiple invoices with filters, updating existing invoices, and deleting invoices.
Typical use cases include automating sales workflows, synchronizing invoice data between KiotViet and other systems, and managing product sales records efficiently. For example, a business can automatically create an invoice in KiotViet when a sale is made on their e-commerce platform, including detailed product information and payment details.
Properties
| Name | Meaning |
|---|---|
| ID Chi Nhánh | Branch ID where the invoice is created (required for creation). |
| Sản Phẩm Trong Hóa Đơn | List of products included in the invoice. Each product includes: Product ID, Product Code, Product Name, Quantity, Price, Discount amount, Discount ratio (%), Note, and Serial Numbers. |
| Trường Bổ Sung | Additional fields for the invoice such as: |
| - Tổng Thanh Toán: Total payment amount (required). | |
| - ID Khách Hàng: Customer ID. | |
| - Ngày Mua Hàng: Purchase date (format YYYY-MM-DD). | |
| - Giảm Giá: Total discount amount for the entire invoice. | |
| - Phương Thức Thanh Toán: Payment method. Options: Tiền Mặt (Cash), Thẻ (Card), Chuyển Khoản (Bank Transfer), Thanh Toán Di Động (Mobile Payment), Kết Hợp (Mixed). | |
| - ID Tài Khoản: Bank account ID (required if payment method is Card or Bank Transfer). | |
| - Sử Dụng COD: Whether to use Cash On Delivery payment. | |
| - ID Nhân Viên Bán: Salesperson ID. | |
| - ID Đơn Hàng: Related order ID. | |
| - ID Kênh Bán: Sales channel ID. | |
| - Áp Dụng Voucher: Whether a voucher is applied. |
Output
The node outputs JSON data representing the result of the requested operation:
- For create: The newly created invoice object with all its details.
- For get or getByCode: The invoice object matching the specified ID or code.
- For getAll: A paginated list of invoices including metadata like total count, page size, and current page.
- For update: The updated invoice object.
- For delete: A success message confirming deletion.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential to authenticate with the KiotViet API.
- Uses the KiotViet API client internally to perform operations.
- No additional environment variables are explicitly required beyond the API credential setup.
Troubleshooting
- Missing Required Fields: Creating or updating an invoice requires mandatory fields such as branch ID and total payment. Omitting these will cause errors.
- Unsupported Operations: If the KiotViet API does not support update or delete operations, the node throws an error indicating the operation is unsupported.
- Invalid IDs or Codes: Providing invalid invoice IDs or codes will result in errors or empty results.
- API Authentication Failures: Ensure the API key credential is correctly configured and has sufficient permissions.
- Pagination Issues: When fetching many invoices, improper pagination parameters may lead to incomplete data retrieval.
To resolve errors:
- Verify all required input properties are provided and correctly formatted.
- Check API credentials and permissions.
- Use valid invoice identifiers.
- Review pagination settings when retrieving multiple invoices.
Links and References
- KiotViet Official Website
- KiotViet API Documentation (for detailed API capabilities and limitations)