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

Đơn Hàng → Xác Thực

AI-generated

Overview

This node manages custom metafields on various Sapo resources, including orders. It supports operations such as creating, retrieving, updating, deleting, counting, bulk deleting, and validating metafields associated with a specific resource ID.

For the Đơn Hàng (Order) resource with the Xác Thực (Validate) operation, the node validates a given value against the metafield's expected format or rules without modifying any data. This is useful to ensure that input values conform to required constraints before saving or processing them further.

Common scenarios:

  • Validating user input for custom fields on an order before submission.
  • Ensuring data integrity by checking if a metafield value meets predefined criteria.
  • Automating workflows that require confirmation of valid metafield data.

Example:
You want to verify that a custom metafield value for an order matches a certain string pattern or type before proceeding with fulfillment or invoicing.

Properties

Name Meaning
ID Tài Nguyên The numeric ID of the resource (order) to which the metafield belongs.
Tùy Chọn Xác Thực JSON object specifying the validation data, typically including a type and a value.

The Tùy Chọn Xác Thực property expects a JSON structure like:

{
  "type": "string",
  "value": "test value"
}

where "type" defines the expected data type and "value" is the actual data to validate.

Output

The output JSON contains a single field:

  • valid: A boolean indicating whether the provided validation data passed the metafield validation (true means valid).

Example output:

{
  "valid": true
}

No binary data is produced by this node.

Dependencies

  • Requires an API credential for authenticating with the Sapo platform.
  • Depends on the internal SapoApiBase class to interact with Sapo metafields.
  • The node must be configured with appropriate permissions to access and validate metafields on the specified resource.

Troubleshooting

  • Error: Invalid validation data format
    Ensure the validationData JSON is correctly structured with both type and value fields.

  • Error: Resource ID not found or invalid
    Verify that the provided resource ID corresponds to an existing order in Sapo.

  • API authentication errors
    Confirm that the API key or credentials are correctly set up and have sufficient permissions.

  • Unhandled exceptions
    If the node fails and you have enabled "Continue On Fail," the error message will appear in the output JSON under error.

Links and References

Discussion