Overview
This node manages customer information in the KiotViet system. It supports creating new customers, retrieving customer details by ID, listing multiple customers with optional filters, and updating existing customer records.
Typical use cases include:
- Adding new customers to your KiotViet database automatically from form submissions or other sources.
- Fetching detailed customer data for processing or reporting.
- Retrieving lists of customers based on search criteria or group membership.
- Updating customer information such as contact details or group assignments.
For example, you could use this node to create a new customer record when a user signs up on your website, or to update customer contact info after receiving updated data from a CRM.
Properties
| Name | Meaning |
|---|---|
| Thao Tác (operation) | The action to perform: - Tạo Mới (create): Create a new customer - Lấy Theo ID (get): Get customer by ID - Get Many (getAll): List multiple customers - Cập Nhật (update): Update an existing customer |
| ID Khách Hàng (customerId) | The unique identifier of the customer (required for get and update operations) |
| Lấy toàn Bộ (returnAll) | Whether to return all results when listing customers (true/false) |
| Giới Hạn (limit) | Maximum number of customers to return when not returning all (minimum 1) |
| Tên Khách Hàng (name) | Full name of the customer (required for create and update) |
| Trường Bổ Sung (additionalFields) | Additional optional fields for create and update: - Số Điện Thoại (contactNumber): Customer phone number - Email: Customer email address - Địa Chỉ (address): Customer address - Giới Tính (gender): Gender, true for male, false for female - Ngày Sinh (birthDate): Birth date in YYYY-MM-DD format - Nhóm Khách Hàng (groupIds): Comma-separated list of customer group IDs |
| Bộ Lọc (filters) | Filters for listing customers (getAll operation): - Từ khóa Tìm Kiếm (searchTerm): Search by name, phone, or customer code - ID Nhóm (groupId): Filter by customer group ID - Sửa đổi Từ Ngày (lastModifiedFrom): Filter customers modified since this date (YYYY-MM-DD) |
Output
The node outputs JSON data representing customer information returned from the KiotViet API:
- For create and update operations, the output contains the newly created or updated customer object.
- For get operation, the output is the customer object matching the specified ID.
- For getAll, the output includes an array of customer objects under
data, along with pagination metadata such astotal,pageSize, andcurrentItem.
Each customer object includes fields like id, name, contactNumber, email, address, gender, birthDate, and groupIds depending on what was provided or retrieved.
The node does not output binary data.
Dependencies
- Requires an API key credential to authenticate with the KiotViet API.
- Uses the KiotViet API client internally to perform customer-related requests.
- No additional external dependencies beyond the KiotViet API service.
Troubleshooting
- Failed to fetch customers: This error occurs if the node cannot retrieve customer data from the API, possibly due to network issues, invalid credentials, or API downtime. Verify your API key and network connectivity.
- Update operation is not supported: If the KiotViet API client does not support updating customers, this error will be thrown. Ensure your API version supports updates.
- Invalid customer ID: Providing a non-numeric or missing customer ID for get or update operations will cause errors. Always provide a valid numeric ID.
- Group IDs parsing: When specifying customer groups, ensure the IDs are comma-separated numbers without extra spaces or invalid characters to avoid parsing errors.
If the node is set to continue on failure, errors for individual items will be returned in the output JSON under an error field.