Sapo Sản Phẩm icon

Sapo Sản Phẩm

Quản lý sản phẩm trên Sapo

Overview

This node integrates with the Sapo platform to manage products. It supports operations such as retrieving product details, creating new products, updating existing ones, deleting products, counting total products, and listing multiple products with optional filters.

A common use case is automating product management workflows in e-commerce setups using Sapo, for example:

  • Fetching detailed information about a specific product by its ID.
  • Updating product data programmatically based on external inputs.
  • Creating new products from other systems or data sources.
  • Deleting obsolete products automatically.
  • Retrieving lists of products with filtering options like creation or update date ranges.
  • Counting the total number of products for reporting or synchronization purposes.

Properties

Name Meaning
Thao Tác (operation) The action to perform: create, get (retrieve details), getMany (list), update, delete, or count.
ID Sản Phẩm (productId) The unique numeric identifier of the product. Required for get, update, and delete operations.
Trả Về Tất Cả (returnAll) Boolean flag indicating whether to return all products when listing (getMany) or limit the results.
Giới Hạn (limit) Maximum number of products to return when listing (getMany) if returnAll is false. Minimum value is 1.
Thông Tin Bổ Sung (additionalFields) Optional filters for listing products (getMany), including:
- Tạo Sau (created_at_min): Return products created after this date/time.
- Tạo Trước (created_at_max): Return products created before this date/time.
- Cập Nhật Sau (updated_at_min): Return products updated after this date/time.
- Cập Nhật Trước (updated_at_max): Return products updated before this date/time.
Dữ Liệu (data) JSON object containing product data to send when creating or updating a product. Required for create and update operations.

Output

The node outputs an array with one item containing a json property:

  • For get (Lấy Chi Tiết), the json contains the detailed product information retrieved from Sapo for the specified product ID.
  • For create, update, and delete, the json contains the response from the respective API call, e.g., confirmation of success or the updated product data.
  • For getMany (Lấy Danh Sách), the json contains a list of products matching the criteria, possibly filtered by date or limited in count.
  • For count, the json contains an object with a count field representing the total number of products.
  • In case of errors, if "Continue On Fail" is enabled, the output includes an error message in the json.error field.

The node does not output binary data.

Dependencies

  • Requires an active connection to the Sapo API via an API key credential configured in n8n.
  • Uses the internal Sapo API base class to perform HTTP requests to Sapo's product endpoints.
  • No additional environment variables are required beyond the API authentication setup.

Troubleshooting

  • Common issues:

    • Invalid or missing product ID when performing get, update, or delete operations will cause errors.
    • Providing malformed JSON in the data property for create/update can result in API validation errors.
    • Network or authentication failures with the Sapo API will cause request errors.
    • Exceeding rate limits or permissions issues on the Sapo account may also cause failures.
  • Error messages:

    • Errors thrown include the message from the underlying API or network layer.
    • If "Continue On Fail" is disabled, the node execution stops on the first error.
    • To resolve errors, verify the correctness of input parameters, ensure valid API credentials, and check network connectivity.

Links and References

Discussion