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 a specific customer, updating existing customer information, deleting customers, counting total customers, and listing multiple customers with optional filters.
Common scenarios include:
- Adding new customers to your Sapo store database.
- Fetching detailed information about a particular customer by their ID.
- Updating customer records when their information changes.
- Removing customers who are no longer active or relevant.
- Counting the total number of customers for reporting purposes.
- Retrieving lists of customers with filtering options like creation date or email.
Practical example: You could use this node to automate syncing customer data from another CRM into Sapo, ensuring your store always has up-to-date customer information.
Properties
| Name | Meaning |
|---|---|
| Operation | The action to perform on customer data. Options: Create, Get (retrieve one), Get Many (list), Update, Delete, Count. |
| ID Khách Hàng | Customer ID number. Required for Get, Update, and Delete operations. |
| Trả Về Tất Cả | Boolean flag to return all customers when listing (Get Many). If false, limits results. |
| Giới Hạn | Maximum number of customers to return when listing and not returning all. |
| Thông Tin Bổ Sung | Additional filter fields for listing customers, including created/updated date ranges, email, and phone. |
| Dữ Liệu | JSON object containing customer data to send when creating or updating a customer. |
Output
The node outputs an array with a single item containing a json field:
- For Create, Get, Update operations: The
jsoncontains the customer object returned by the API. - For Delete operation: The
jsoncontains{ success: true }if deletion was successful. - For Count operation: The
jsoncontains{ count: <number> }representing the total number of customers. - For Get Many operation: The
jsoncontains a list of customers matching the query parameters.
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for authenticating with the Sapo platform.
- Depends on the internal
SapoApiBaseclass to handle API requests to Sapo's customer endpoints. - No additional external services beyond Sapo's API are required.
Troubleshooting
Common issues:
- Providing an invalid or missing customer ID for operations that require it (Get, Update, Delete) will cause errors.
- Incorrectly formatted JSON in the "Dữ Liệu" property for create/update can lead to API rejections.
- Exceeding rate limits or network issues may cause request failures.
Error messages:
- Errors from the Sapo API will be surfaced with their message and stack trace unless "Continue On Fail" is enabled, in which case errors are returned as JSON objects with an
errorfield. - Typical error: "Customer not found" when using an invalid ID.
- Resolution: Verify IDs, ensure proper JSON formatting, and check API credentials.
- Errors from the Sapo API will be surfaced with their message and stack trace unless "Continue On Fail" is enabled, in which case errors are returned as JSON objects with an
Links and References
- Sapo Official API Documentation (for detailed API specs)
- n8n documentation on creating custom nodes