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

Biến Thể Sản Phẩm → Lấy Chi Tiết

AI-generated

Overview

This node manages custom metafields on various Sapo resources, including product variants. Specifically, for the "Biến Thể Sản Phẩm" (Product Variant) resource and the "Lấy Chi Tiết" (Get Detail) operation, it retrieves detailed information about a specific custom metafield associated with a given product variant ID.

Common scenarios where this node is useful include:

  • Fetching metadata details for a specific product variant to display or process in workflows.
  • Integrating with external systems that require detailed custom field data from product variants.
  • Automating inventory or product management tasks based on custom attributes stored as metafields.

Example: You have a product variant with ID 12345 and want to retrieve the custom metafield with ID 67890 that stores warehouse location info. This node will fetch that metafield’s details for further use.

Properties

Name Meaning
ID Tài Nguyên The numeric ID of the product variant resource to which the metafield belongs.
ID Trường Tùy Chỉnh The numeric ID of the custom metafield to retrieve details for. Required for get operation.

Output

The node outputs a JSON object representing the metafield details. The structure typically includes fields such as:

  • id: The metafield's unique identifier.
  • namespace: The namespace grouping the metafield.
  • key: The key name of the metafield.
  • value: The value stored in the metafield.
  • value_type: The type of the value (e.g., string, integer).
  • description: A description of the metafield.
  • owner_type: The resource type owning the metafield (here, "variant").
  • owner_id: The ID of the resource instance (the product variant).

No binary data output is involved.

Dependencies

  • Requires an active connection to the Sapo API via an API credential configured in n8n.
  • The node depends on the internal SapoApiBase class to interact with the metafields endpoint.
  • Proper API authentication credentials must be set up in n8n to allow access to Sapo resources.

Troubleshooting

  • Common issues:

    • Invalid or missing resource ID or metafield ID parameters will cause errors.
    • API authentication failures due to incorrect or expired credentials.
    • Attempting to get a metafield that does not exist or is not associated with the specified product variant.
  • Error messages:

    • Errors returned by the Sapo API are surfaced with their message; ensure IDs are correct and the API key has sufficient permissions.
    • Network or connectivity errors may occur if the API endpoint is unreachable.
  • Resolutions:

    • Verify that the product variant ID and metafield ID are correct and exist in your Sapo store.
    • Check and update API credentials in n8n.
    • Use the "Continue On Fail" option to handle errors gracefully in workflows.

Links and References

Discussion