Overview
This node manages branches ("Chi Nhánh") in the KiotViet system, a retail management platform. It supports creating new branches, retrieving branch details by ID, updating existing branches, deleting branches, and fetching multiple branches with optional filtering.
A common use case is automating branch data synchronization between KiotViet and other systems, such as CRMs or ERPs. For example, you can use this node to:
- Retrieve all active branches for reporting.
- Create a new branch when opening a new physical store.
- Update branch information like address or phone number.
- Delete branches that are no longer operational.
The "Get Many" operation (named getAll internally) allows fetching multiple branches with options to filter by status or search term, and to control whether to return all results or limit the number of items.
Properties
| Name | Meaning |
|---|---|
| Lấy Toàn Bộ | Boolean flag to either fetch all results or limit the number of returned branches. |
| Bộ Lọc | Collection of filters to narrow down the list of branches: |
| - Từ Khóa Tìm Kiếm | Search term to find branches by name or code. |
| - Trạng Thái | Filter branches by status; options are "ĐAng Hoạt ĐộNg" (Active) or "Ngừng Hoạt ĐộNg" (Inactive). |
Note: These properties apply specifically to the "Get Many" (getAll) operation.
Output
The node outputs an array of JSON objects representing branch data. Each object corresponds to a branch and includes fields such as branch ID, name, address, status, and any additional metadata provided by the KiotViet API.
If the operation is "Get Many," the output contains multiple branch objects according to the applied filters and limits.
The node does not output binary data.
Dependencies
- Requires an API key credential for authenticating with the KiotViet API.
- Uses a shared KiotViet API helper class to perform HTTP requests.
- The node expects proper configuration of the API credentials within n8n.
Troubleshooting
- Common issues:
- Authentication failures due to missing or invalid API keys.
- Invalid branch IDs causing "not found" errors when getting, updating, or deleting.
- Exceeding API rate limits if requesting too many branches without pagination.
- Error messages:
- Errors from the KiotViet API will be surfaced with their message text.
- If "Continue On Fail" is enabled, errors for individual items will be returned as JSON objects with an
errorfield.
- Resolutions:
- Verify API credentials and permissions.
- Ensure branch IDs used exist and are valid integers.
- Use the "Lấy Toàn Bộ" property carefully to avoid large data loads; prefer limiting results.
Links and References
- KiotViet Official API Documentation
- n8n documentation on Creating Custom Nodes