Actions72
- Bài Viết Actions
- Blog Actions
- Bộ Sưu Tập Actions
- Khách Hàng Actions
- Đơn Hàng Actions
- Trang Actions
- Sản Phẩm Actions
- Biến Thể Sản Phẩm Actions
Đơn Hàng → Xác Thực
AI-generatedOverview
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 (truemeans 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
SapoApiBaseclass 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 thevalidationDataJSON is correctly structured with bothtypeandvaluefields.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 undererror.
Links and References
- Sapo API Documentation (general reference for Sapo platform APIs)
- n8n documentation on creating custom nodes