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 perform various operations such as retrieving a list of collections, getting details of a specific collection, creating or updating custom and smart collections, deleting collections, and managing products within collections (adding, removing, ordering).

A common use case is automating the synchronization or management of product groupings in an online store, for example:

  • Fetching all collections to display or analyze them.
  • Creating a new custom collection with specific attributes.
  • Updating a smart collection based on dynamic rules.
  • Adding or removing products from collections programmatically.

This node is beneficial for store owners or developers who want to automate collection management workflows without manual intervention in the Sapo admin interface.

Properties

Name Meaning
Trả Về Tất Cả Boolean option to return all results or limit the number of returned collections when listing many.
Giới Hạn Maximum number of collections to return if not returning all (only applicable if "Trả Về Tất Cả" is false).
Thông Tin Bổ Sung Additional optional filters for listing collections:
- Handle: URL-friendly identifier for filtering collections by handle.
- Trạng Thái Xuất Bản: Filter by published status with options: Đã Xuất Bản (published), Chưa Xuất Bản (unpublished), Tất Cả (any).
- Cập Nhật Sau: Filter collections updated after this date/time.
- Cập Nhật Trước: Filter collections updated before this date/time.

These properties are used specifically for the "Lấy Danh Sách" (getMany) operation to control which collections are retrieved and how many.

Output

The output is a JSON object representing the result of the requested operation:

  • For "Lấy Danh Sách" (getMany), it returns an array of collection objects matching the filter criteria and limits.
  • Each collection object typically includes fields like collection ID, title, description, published status, update timestamps, and other metadata depending on the API response.
  • For other operations, the output JSON contains the created/updated collection data or success confirmation objects.
  • If an operation involves product management (add/remove/set order), the output confirms success.
  • In case of errors, the output JSON contains an error field with the error message if the node is set to continue on failure.

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 SapoApiBase class that handles communication with the Sapo API endpoints related to collections.
  • Proper API permissions are needed to read, create, update, or delete collections and manage products within them.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Providing invalid collection IDs or product IDs may result in "not found" errors.
    • Exceeding API rate limits can cause request failures.
    • Incorrectly formatted input JSON for creating/updating collections can lead to validation errors.
  • Error messages:

    • Errors thrown by the node include descriptive messages from the Sapo API.
    • If the node is not set to continue on fail, errors will stop execution and show the error message and stack trace.
    • To handle partial failures gracefully, enable "Continue On Fail" in the node settings.
  • Resolution tips:

    • Verify API credentials and permissions.
    • Double-check IDs and input data formats.
    • Use the "Trả Về Tất Cả" and "Giới Hạn" properties carefully to avoid large data requests.
    • Review Sapo API documentation for valid data schemas.

Links and References

Discussion