Actions11
Overview
This node manages product collections on the Sapo e-commerce platform. It allows users to create, update, delete, and retrieve both custom and smart collections, as well as manipulate products within those collections. A key feature is the ability to reorder products inside a collection.
Common scenarios include:
- Organizing products into themed collections for marketing campaigns.
- Automatically updating collections based on product attributes (smart collections).
- Managing product order within collections to control display priority.
- Adding or removing specific products from collections.
Practical example: An online store owner can use this node to create a "Summer Sale" collection, add selected products to it, and set their display order to highlight bestsellers first.
Properties
| Name | Meaning |
|---|---|
| ID Bộ Sưu Tập | The numeric ID of the collection to operate on (required for most operations). |
| Danh Sách ID Sản Phẩm | Comma-separated list of product IDs specifying the desired order within the collection. |
Note: The above properties are relevant specifically for the "Sắp Xếp Sản Phẩm" (Set Product Order) operation under the Default resource.
Output
The node outputs a JSON object representing the result of the requested operation:
- For "setProductOrder", the output contains the updated collection data reflecting the new product order.
- For other operations, the output varies accordingly (e.g., collection details, success confirmation, count).
- If an operation returns a success status without additional data, the output JSON includes
{ success: true }. - In case of errors, if "Continue On Fail" is enabled, the output JSON contains an
errorfield with the error message.
No binary data output is produced by this node.
Dependencies
- Requires an API authentication credential for the Sapo platform.
- Depends on the internal
SapoApiBaseclass to interact with Sapo's API endpoints. - No additional external services beyond Sapo's API are required.
Troubleshooting
Common issues:
- Invalid or missing collection ID or product IDs will cause API errors.
- Incorrectly formatted product ID list (e.g., non-numeric values) in the "Danh Sách ID Sản Phẩm" property may lead to failures.
- Network or authentication errors when connecting to the Sapo API.
Error messages:
- Errors returned from the Sapo API are surfaced with their message and stack trace.
- To handle errors gracefully, enable "Continue On Fail" to receive error details in the output JSON instead of stopping execution.
Resolution tips:
- Verify that all required IDs are correct and exist in the Sapo system.
- Ensure the API credential is valid and has necessary permissions.
- Confirm the product ID list is a comma-separated string of valid numbers without extra spaces or invalid characters.
Links and References
- Sapo Official API Documentation (for detailed API capabilities and data formats)
- n8n documentation on Creating Custom Nodes