Actions11
Overview
This node manages product collections on the Sapo e-commerce platform. It supports creating, updating, deleting, and retrieving both custom and smart collections, as well as managing products within those collections. Typical use cases include automating collection management workflows such as dynamically updating smart collections based on rules, organizing products into collections, or syncing collection data with other systems.
For example, you can:
- Create a smart collection that automatically includes all products with titles containing "shirt".
- Update an existing custom collection’s details.
- Add or remove specific products from a collection.
- Retrieve detailed information about a particular collection.
- Set the order of products within a collection.
Properties
| Name | Meaning |
|---|---|
| ID Bộ Sưu Tập | The numeric ID of the collection to operate on (required for operations like get, update, delete, add/remove product, set product order). |
| Dữ Liệu Bộ Sưu Tập Thông Minh | JSON data defining the properties of a smart collection, including title and rules for automatic product inclusion. Used when creating or updating smart collections. Example: { "title": "My Smart Collection", "rules": [ { "column": "title", "relation": "contains", "condition": "shirt" } ] } |
Output
The node outputs a JSON object representing the result of the performed operation:
- For create, update, get, and list operations, the output contains the collection data returned by the Sapo API.
- For delete, addProduct, removeProduct operations, the output is a simple success confirmation object:
{ "success": true }. - For setProductOrder, the output contains the updated collection data reflecting the new product order.
- For count operation, the output contains an object with the total number of collections:
{ "count": <number> }.
No binary data output is produced by this node.
Dependencies
- Requires an active connection to the Sapo API via an API key credential configured in n8n.
- The node depends on the bundled
SapoApiBaseclass which handles communication with the Sapo API endpoints related to collections.
Troubleshooting
Common issues:
- Invalid or missing collection ID when required will cause errors.
- Malformed JSON in the "Dữ Liệu Bộ Sưu Tập Thông Minh" property may lead to API request failures.
- Network or authentication errors if the API key credential is not properly configured or expired.
Error messages:
- Errors from the Sapo API are caught and reported with their message. If "Continue On Fail" is disabled, the node execution stops on error.
- Common error:
"Collection not found"indicates the specified collection ID does not exist. "Invalid JSON data"suggests the input JSON for collection data is malformed or missing required fields.
To resolve these, verify the collection IDs, ensure JSON inputs are valid, and confirm API credentials are correctly set up.
Links and References
- Sapo API Documentation (official API docs for collections)
- n8n documentation on creating custom nodes