Sapo Bộ Sưu Tập icon

Sapo Bộ Sưu Tập

Quản lý bộ sưu tập sản phẩm trên Sapo

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 manage products within those collections. Common scenarios include organizing products into thematic groups for marketing campaigns, updating collection details dynamically, or controlling product order within a collection.

Practical examples:

  • Adding a specific product to an existing collection to promote it.
  • Creating a new smart collection that automatically includes products matching certain criteria (e.g., all shirts).
  • Reordering products in a collection to highlight bestsellers first.
  • Deleting obsolete collections to keep the store organized.

Properties

Name Meaning
Thao Tác (operation) The action to perform on collections. Options: "Thêm Sản Phẩm" (addProduct), "Đếm" (count), "Tạo Bộ Sưu Tập Tùy Chỉnh" (createCustom), "Tạo Bộ Sưu Tập Thông Minh" (createSmart), "Xóa Bộ Sưu Tập Tùy Chỉnh" (deleteCustom), "Xóa Bộ Sưu Tập Thông Minh" (deleteSmart), "Lấy Chi Tiết" (get), "Lấy Danh Sách" (getMany), "Xóa Sản Phẩm" (removeProduct), "Sắp Xếp Sản Phẩm" (setProductOrder), "Cập Nhật Bộ Sưu Tập Tùy Chỉnh" (updateCustom), "Cập Nhật Bộ Sưu Tập Thông Minh" (updateSmart)
ID Bộ Sưu Tập (collectionId) Numeric ID of the collection to operate on. Required for most operations except listing and counting.
ID Sản Phẩm (productId) Numeric ID of the product to add or remove from a collection. Required for addProduct and removeProduct operations.
Danh Sách ID Sản Phẩm (productIds) Comma-separated string of product IDs specifying the desired order within a collection. Used with setProductOrder operation.
Trả Về Tất Cả (returnAll) Boolean indicating whether to return all collections when listing (getMany) or limit results.
Giới Hạn (limit) Maximum number of collections to return when not returning all (used with getMany). Minimum 1.
Thông Tin Bổ Sung (additionalFields) Additional filters for listing collections, including handle (URL identifier), published status (published, unpublished, any), updated_at_min, and updated_at_max timestamps.
Dữ Liệu Bộ Sưu Tập Tùy Chỉnh (data) JSON object containing data to create or update a custom collection, e.g., title, description, 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 rules defining which products are included automatically.

Output

The node outputs a JSON object representing the result of the performed operation:

  • For creation, retrieval, update operations: the full collection object returned by the API.
  • For deletion, adding/removing products: a success confirmation { success: true }.
  • For listing multiple collections: an array of collection objects, possibly filtered and limited.
  • For counting: an object with a count property indicating the total number of collections.
  • For setting product order: the updated collection object reflecting the new product order.

No binary data is output 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 internal Sapo API base class to communicate with the Sapo platform.
  • Proper permissions on the Sapo account to manage collections and products are necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing collection or product IDs will cause errors.
    • Insufficient API permissions may lead to authorization failures.
    • Malformed JSON in the data property for creating/updating collections can cause request failures.
    • Providing an empty or incorrectly formatted product ID list for ordering may result in errors.
  • Error messages:

    • Errors from the Sapo API are surfaced with their message; ensure IDs exist and are correct.
    • Network or authentication errors indicate problems with API credentials or connectivity.
    • To resolve, verify input parameters, check API credentials, and confirm network access.
  • The node supports continuing on failure, allowing workflows to handle errors gracefully.

Links and References

Discussion