Sapo Trường Tùy Chỉnh icon

Sapo Trường Tùy Chỉnh

Quản lý trường tùy chỉnh trên Sapo

Bộ Sưu Tập → Lấy Chi Tiết

AI-generated

Overview

This node manages custom metafields on various resource types within the Sapo platform. Metafields are additional metadata fields that can be attached to resources such as collections, products, customers, orders, and more. The node supports operations like creating, retrieving details, updating, deleting single or multiple metafields, counting metafields, and validating metafield values.

A common use case is enriching existing resources with extra structured data without modifying the core resource schema. For example, adding a "warehouse location" metafield to a product collection helps track inventory locations. Another scenario is fetching detailed metafield information for reporting or integration purposes.

Specifically, the "Lấy Chi Tiết" (Get Detail) operation retrieves detailed information about a specific metafield by its ID for a given resource and resource ID.

Properties

Name Meaning
ID Tài Nguyên The numeric ID of the resource (e.g., collection) to which the metafield belongs.
ID Trường Tùy Chỉnh The numeric ID of the specific metafield to retrieve details for. Required for get operation.

Note: The node also supports other properties depending on the operation, such as:

  • Thao Tác (Operation): The action to perform (create, get, update, delete, etc.).
  • Tài Nguyên (Resource): The type of resource (e.g., collections, products).
  • Trả Về Tất Cả (Return All): Whether to return all results when listing metafields.
  • Giới Hạn (Limit): Maximum number of results to return when not returning all.
  • Thông Tin Bổ Sung (Additional Fields): Filters like namespace, key, creation date range.
  • Dữ Liệu Trường Tùy Chỉnh (Data): JSON object describing metafield data for create/update.
  • Tùy Chọn Xác Thực (Validation Data): JSON object for validating metafield values.

Output

The output is a JSON array containing one element per execution. For the "Lấy Chi Tiết" operation, the json field contains the detailed metafield object retrieved from the API, including all its properties such as namespace, key, value, value type, description, owner type, and owner ID.

If the operation is delete, the output confirms success with { success: true }.

In case of errors, if the node is set to continue on failure, 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 authentication credential configured in n8n.
  • Uses the internal Sapo API base class to interact with metafields endpoints.
  • No additional external dependencies beyond the Sapo API access.

Troubleshooting

  • Common Issues:

    • Providing incorrect or missing resource IDs or metafield IDs will cause API errors.
    • Insufficient permissions or invalid API credentials will result in authentication failures.
    • Using unsupported resource types or malformed JSON in data fields may cause request rejections.
  • Error Messages:

    • Errors returned from the Sapo API are surfaced with their messages.
    • If the node fails and "Continue On Fail" is disabled, execution stops with a detailed error.
    • To resolve, verify input parameters, ensure valid API credentials, and check resource existence.

Links and References

Discussion