Overview
This node integrates with the Sapo platform to manage products. It supports operations such as retrieving product details, creating new products, updating existing ones, deleting products, counting total products, and listing multiple products with optional filters.
A common use case is automating product management workflows in e-commerce setups using Sapo, for example:
- Fetching detailed information about a specific product by its ID.
- Updating product data programmatically based on external inputs.
- Creating new products from other systems or data sources.
- Deleting obsolete products automatically.
- Retrieving lists of products with filtering options like creation or update date ranges.
- Counting the total number of products for reporting or synchronization purposes.
Properties
| Name | Meaning |
|---|---|
| Thao Tác (operation) | The action to perform: create, get (retrieve details), getMany (list), update, delete, or count. |
| ID Sản Phẩm (productId) | The unique numeric identifier of the product. Required for get, update, and delete operations. |
| Trả Về Tất Cả (returnAll) | Boolean flag indicating whether to return all products when listing (getMany) or limit the results. |
| Giới Hạn (limit) | Maximum number of products to return when listing (getMany) if returnAll is false. Minimum value is 1. |
| Thông Tin Bổ Sung (additionalFields) | Optional filters for listing products (getMany), including: - Tạo Sau (created_at_min): Return products created after this date/time. - Tạo Trước (created_at_max): Return products created before this date/time. - Cập Nhật Sau (updated_at_min): Return products updated after this date/time. - Cập Nhật Trước (updated_at_max): Return products updated before this date/time. |
| Dữ Liệu (data) | JSON object containing product data to send when creating or updating a product. Required for create and update operations. |
Output
The node outputs an array with one item containing a json property:
- For
get(Lấy Chi Tiết), thejsoncontains the detailed product information retrieved from Sapo for the specified product ID. - For
create,update, anddelete, thejsoncontains the response from the respective API call, e.g., confirmation of success or the updated product data. - For
getMany(Lấy Danh Sách), thejsoncontains a list of products matching the criteria, possibly filtered by date or limited in count. - For
count, thejsoncontains an object with acountfield representing the total number of products. - 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 active connection to the Sapo API via an API key credential configured in n8n.
- Uses the internal Sapo API base class to perform HTTP requests to Sapo's product endpoints.
- No additional environment variables are required beyond the API authentication setup.
Troubleshooting
Common issues:
- Invalid or missing product ID when performing
get,update, ordeleteoperations will cause errors. - Providing malformed JSON in the
dataproperty for create/update can result in API validation errors. - Network or authentication failures with the Sapo API will cause request errors.
- Exceeding rate limits or permissions issues on the Sapo account may also cause failures.
- Invalid or missing product ID when performing
Error messages:
- Errors thrown include the message from the underlying API or network layer.
- If "Continue On Fail" is disabled, the node execution stops on the first error.
- To resolve errors, verify the correctness of input parameters, ensure valid API credentials, and check network connectivity.
Links and References
- Sapo API Documentation (official API docs for product management)
- n8n documentation on creating custom nodes