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, updating existing ones, retrieving single or multiple customer records, counting customers, and deleting customers.
Typical use cases include:
- Adding new customers to Sapo from external sources or forms.
- Synchronizing customer updates between systems.
- Fetching customer details for reporting or processing.
- Cleaning up customer records by deletion.
- Counting total customers for analytics.
For example, you might use this node to automatically create a new customer in Sapo when a user signs up on your website, or to update customer information after a purchase.
Properties
| Name | Meaning |
|---|---|
| Operation | The action to perform on customer data. Options: Create, Update, Count, Get, Get Many, Delete |
| ID Khách Hàng (Customer ID) | The unique numeric identifier of the customer. Required for Get, Update, and Delete operations. |
| Trả Về Tất Cả (Return All) | Boolean flag indicating whether to return all customer records (true) or limit the number of results (false). Used with Get Many operation. |
| Giới Hạn (Limit) | Maximum number of customer records to return when Return All is false. Minimum value is 1. Used with Get Many operation. |
| Thông Tin Bổ Sung (Additional Fields) | Optional filters for listing customers, including creation date range, update date range, email, and phone number. Used with Get Many operation. |
| Dữ Liệu (Data) | JSON object containing customer data to send to Sapo. Required for Create and Update operations. |
Output
The node outputs an array with one item containing a json field representing the result of the performed operation:
- For Create and Update, the output contains the newly created or updated customer data as returned by Sapo.
- For Get, it returns the detailed data of the specified customer.
- For Get Many, it returns a list of customers matching the criteria or limited by the specified count.
- For Delete, it returns a success confirmation object
{ success: true }. - For Count, it returns an object with the total number of customers, e.g.,
{ count: 123 }. - In case of errors, if "Continue On Fail" is enabled, the output includes an error message in the
json.errorfield.
The node does not output binary data.
Dependencies
- Requires an API key credential for authenticating with the Sapo API.
- Depends on the internal
SapoApiBaseclass to handle API requests related to customers. - No additional environment variables are explicitly required beyond the API authentication setup.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Providing incorrect or incomplete customer IDs for operations like Get, Update, or Delete will result in errors.
- Malformed JSON in the Data property can cause request failures.
- Exceeding API rate limits may lead to temporary blocking or errors.
Error messages:
- Errors thrown by the node include the message from the Sapo API or network layer.
- If "Continue On Fail" is disabled, the node execution stops on the first error.
- To resolve errors, verify API credentials, ensure correct input parameters, and validate JSON data format.
Links and References
- Sapo Official API Documentation (general reference for API endpoints and data formats)
- n8n documentation on creating custom nodes