Actions11
Overview
This node manages product collections on the Sapo e-commerce platform. It supports creating, updating, retrieving, deleting, and organizing both custom and smart collections of products. Users can add or remove products from collections, reorder products within a collection, and count total collections.
Common scenarios include:
- Automating the creation of themed product collections (e.g., seasonal sales).
- Updating collection details or rules dynamically based on inventory or marketing needs.
- Managing product placement within collections to optimize customer browsing experience.
- Retrieving collection data for reporting or synchronization with other systems.
Example: Automatically create a new custom collection titled "Summer Sale" with a description and publish it, then add specific products to this collection.
Properties
| Name | Meaning |
|---|---|
| Thao Tác (operation) | The action to perform on collections. Options: Add Product, Count, Create Custom Collection, Create Smart Collection, Delete Custom Collection, Delete Smart Collection, Get Details, Get List, Remove Product, Set Product Order, Update Custom Collection, Update Smart Collection. |
| ID Bộ Sưu Tập (collectionId) | Numeric ID of the target collection for operations that require specifying a collection. |
| ID Sản Phẩm (productId) | Numeric ID of the product to add or remove from a collection. |
| Danh Sách ID Sản Phẩm (productIds) | Comma-separated list of product IDs defining the desired order in a collection. |
| Trả Về Tất Cả (returnAll) | Boolean indicating whether to return all collections or limit the number of results. |
| Giới Hạn (limit) | Maximum number of collections to return when not returning all. |
| Thông Tin Bổ Sung (additionalFields) | Additional filters for listing collections, such as handle, published status, updated date range. |
| Dữ Liệu Bộ Sưu Tập Tùy Chỉnh (data) | JSON object containing data to create or update a custom collection, including title, HTML description, and published status. |
| Dữ Liệu Bộ Sưu Tập Thông Minh (data) | JSON object containing data to create or update a smart collection, including title and rules for automatic product inclusion. |
Output
The node outputs an array with one item containing a json field representing the result of the operation:
- For create, update, get, and list operations, the output contains the collection data returned by the API.
- For delete, addProduct, removeProduct operations, the output contains
{ success: true }upon successful completion. - For setProductOrder, the output contains the updated collection data reflecting the new product order.
- For count operation, the output contains
{ count: <number> }indicating the total number of collections. - In case of errors (if continueOnFail 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 interact with collections endpoints.
- No additional external dependencies beyond the Sapo API and n8n environment.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Providing incorrect collection or product IDs may result in "not found" errors.
- Malformed JSON in the
dataproperty can cause request validation errors. - Attempting unsupported operations or missing required parameters will throw errors.
Error messages:
- Authentication errors: Verify API key validity and permissions.
- Validation errors: Check JSON structure and required fields in input data.
- Not found errors: Confirm that collection and product IDs exist in the Sapo store.
- Rate limiting or network errors: Retry after some time or check connectivity.
Enabling "Continue On Fail" allows the workflow to proceed even if some operations fail, capturing error details in the output.
Links and References
- Sapo API Documentation (official API docs for collections)
- n8n Documentation (for configuring credentials and using nodes)