Actions11
Overview
This node manages product collections on the Sapo e-commerce platform. It supports various operations such as creating, updating, deleting, and retrieving both custom and smart collections, as well as managing products within those collections.
The "Tạo Bộ Sưu Tập Thông Minh" (Create Smart Collection) operation specifically allows users to create a smart collection based on defined rules that automatically include products matching certain criteria. This is useful for dynamically grouping products without manual updates, for example, creating a collection of all products whose titles contain the word "shirt".
Practical examples:
- Automatically group all products with "shirt" in their title into a smart collection.
- Create a smart collection that includes products based on price or inventory rules.
- Use smart collections to organize products for marketing campaigns or storefront displays without manual maintenance.
Properties
| Name | Meaning |
|---|---|
| Dữ Liệu Bộ Sưu Tập Thông Minh (data) | JSON object defining the smart collection's properties, including: - title: The name of the smart collection.- rules: An array of rule objects specifying conditions products must meet to be included. Each rule has:• column: The product attribute to evaluate (e.g., "title").• relation: The condition type (e.g., "contains").• condition: The value to match (e.g., "shirt"). |
Example of the data property value:
{
"title": "My Smart Collection",
"rules": [
{
"column": "title",
"relation": "contains",
"condition": "shirt"
}
]
}
Output
The node outputs an array with one item containing a json field representing the result of the operation:
- For creation (
createSmart), update, retrieval, or listing operations, the output JSON contains the details of the smart collection(s) as returned by the Sapo API. - For deletion or product management operations (add/remove/set order), the output JSON contains a success confirmation object, e.g.,
{ "success": true }. - For count operation, the output JSON contains an object with the total count of collections, e.g.,
{ "count": 123 }.
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. - Proper permissions on the Sapo account are necessary to manage collections and products.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication errors.
- Providing malformed JSON in the
dataproperty can lead to request failures. - Using incorrect collection IDs or product IDs may result in "not found" errors.
- Network connectivity problems can cause timeouts or unreachable service errors.
Error messages:
- Errors from the Sapo API are caught and reported with their message. If
continueOnFailis enabled, errors appear in the output JSON under anerrorfield. - Typical error messages include invalid parameter errors, permission denied, or resource not found.
- Errors from the Sapo API are caught and reported with their message. If
Resolution tips:
- Verify API credentials and permissions.
- Validate JSON input syntax before execution.
- Confirm that collection and product IDs exist in the Sapo store.
- Check network connectivity and retry if transient errors occur.
Links and References
- Sapo API Documentation (official API docs for collections and products)
- n8n Documentation (for configuring credentials and using nodes)