Overview
This node manages customer data on the Sapo platform, a popular e-commerce and retail management system. It supports operations such as creating new customers, retrieving details of existing customers, updating customer information, deleting customers, counting total customers, and listing multiple customers with optional filters.
Typical use cases include:
- Synchronizing customer records from other systems into Sapo.
- Fetching customer details for order processing or marketing.
- Updating customer profiles based on recent interactions.
- Cleaning up or removing outdated customer entries.
- Generating reports on customer counts or filtered lists.
For example, you might use this node to update a customer's contact information after they submit a form, or to retrieve a list of customers created within a specific date range.
Properties
| Name | Meaning |
|---|---|
| Operation | The action to perform: Cập Nhật (update), Count, Lấy Chi Tiết (get), Lấy Danh Sách (getMany), Tạo Mới (create), Xóa (delete) |
| ID Khách Hàng | Customer ID number; required for get, update, and delete operations |
| Dữ Liệu | JSON object containing customer data to send to Sapo; required for create and update operations |
| Trả Về Tất Cả | Boolean flag for getMany operation indicating whether to return all results or limit them |
| Giới Hạn | Number specifying max results to return when Trả Về Tất Cả is false in getMany |
| Thông Tin Bổ Sung | Additional filter fields for getMany operation, including creation/update date ranges, email, and phone |
Output
The node outputs an array with one item containing a json field representing the result of the selected operation:
- For
create,get,update: The JSON contains the customer object returned by Sapo. - For
getMany: The JSON contains a list of customers matching the criteria. - For
delete: The JSON contains{ success: true }if deletion succeeded. - For
count: The JSON contains{ count: <number> }representing the total number of customers. - On error (if "Continue On Fail" is enabled), the JSON contains
{ error: "<error message>" }.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential configured in n8n to authenticate with the Sapo API.
- Depends on the internal
SapoApiBaseclass to handle API requests related to customers. - No additional external services are needed beyond access to the Sapo platform.
Troubleshooting
Common issues:
- Invalid or missing customer ID for operations that require it (
get,update,delete) will cause errors. - Malformed JSON in the
Dữ Liệuproperty can lead to request failures. - Network or authentication errors if the API key is invalid or expired.
- Exceeding rate limits imposed by the Sapo API.
- Invalid or missing customer ID for operations that require it (
Error messages:
- Errors thrown by the node include the original API error message.
- If "Continue On Fail" is disabled, the node execution stops on error.
- To resolve errors, verify input parameters, ensure valid credentials, and check API status.
Links and References
- Sapo Official API Documentation (for detailed API specs)
- n8n documentation on Creating Custom Nodes
- General info on Sapo eCommerce Platform