Chi Nhánh KiotViet icon

Chi Nhánh KiotViet

Quản lý chi nhánh từ KiotViet

Overview

This node manages branches ("Chi Nhánh") in the KiotViet system, a retail management platform. It allows users to create, retrieve, update, and delete branch records programmatically within an n8n workflow. Typical use cases include automating branch data synchronization between KiotViet and other systems, managing branch information centrally, or integrating branch operations into larger business processes.

For example, you can use this node to:

  • Automatically create new branches when onboarding new stores.
  • Retrieve branch details for reporting or auditing.
  • Update branch information such as address or phone number.
  • Delete branches that are no longer active.

Properties

Name Meaning
Thao Tác (operation) The action to perform on the branch resource. Options: Tạo Mới (create), Xóa (delete), Lấy Theo ID (get), Get Many (getAll), Cập Nhật (update).
ID Chi Nhánh (branchId) The unique identifier of the branch. Required for get, update, and delete operations.
Lấy Toàn Bộ (returnAll) Boolean flag to return all results without limit when listing branches (getAll operation).
Tên Chi Nhánh (name) The name of the branch. Required for create and update operations.
Địa Chỉ (address) The address of the branch. Required for create and update operations.
Trường Bổ Sung (additionalFields) Additional optional fields for the branch:
- Số Điện Thoại (phoneNumber): Branch phone number
- Mã Chi Nhánh (code): Branch code identifier
- Ghi Chú (description): Notes about the branch
Bộ Lọc (filters) Filters for listing branches (getAll operation):
- Từ Khóa Tìm Kiếm (searchTerm): Search by branch name or code
- Trạng Thái (status): Filter by status, options are "Đang Hoạt Động" (Active) or "Ngừng Hoạt Động" (Inactive)

Output

The node outputs JSON data representing the branch or branches affected by the operation:

  • For create, get, update, and delete operations, the output is a JSON object with the branch details or confirmation of deletion.
  • For getAll, the output is an array of branch objects matching the filter criteria or limited by pagination.
  • If an error occurs and "Continue On Fail" is enabled, the output will contain an error message object instead.

The output does not include binary data.

Dependencies

  • Requires an API key credential for authenticating with the KiotViet API.
  • The node depends on the KiotViet API service being accessible.
  • No additional environment variables are required beyond the API authentication setup.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Providing an invalid or non-existent branch ID for get, update, or delete operations will result in errors.
    • Missing required fields like "Tên Chi Nhánh" or "Địa Chỉ" during creation or update will cause validation errors.
    • Network connectivity issues may prevent communication with the KiotViet API.
  • Error messages:

    • Errors returned from the KiotViet API are passed through; typical messages include "Branch not found" or "Invalid input".
    • To resolve, verify the correctness of input parameters and ensure the API credentials are valid.
    • Enable "Continue On Fail" in the node settings to handle errors gracefully within workflows.

Links and References

Discussion