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
Biến Thể Sản Phẩm → Xác Thực
AI-generatedOverview
This node manages custom metafields on various Sapo resources, such as products, variants, orders, customers, and more. It allows users to create, retrieve, update, delete, count, bulk delete, list, and validate metafields associated with these resources.
The "Xác Thực" (Validate) operation specifically checks the validity of a given metafield value according to predefined rules or constraints without modifying any data. This is useful for ensuring that metafield values conform to expected formats or types before saving them.
Practical examples:
- Before updating a product variant's custom field, use the validate operation to confirm the new value is acceptable.
- Validate metafield data input from external sources to prevent errors downstream.
- Automate quality control in workflows by validating metafield values programmatically.
Properties
| Name | Meaning |
|---|---|
| ID Tài Nguyên | The numeric ID of the resource (e.g., product variant) to which the metafield belongs. |
| Tùy Chọn Xác Thực | JSON object specifying the validation data, including the type and value to be validated. |
Example of Tùy Chọn Xác Thực property value:
{
"type": "string",
"value": "test value"
}
Output
The output JSON contains a single field:
| Field | Meaning |
|---|---|
| valid | Boolean indicating if the validation passed (true) |
Example output:
{
"valid": true
}
No binary data is produced by this operation.
Dependencies
- Requires an active connection to the Sapo API via an API key credential configured in n8n.
- The node depends on the internal
SapoApiBaseclass to interact with the Sapo metafields endpoints. - Proper permissions on the Sapo account to access and validate metafields are necessary.
Troubleshooting
Common issues:
- Invalid or malformed JSON in the
validationDataproperty can cause validation to fail or throw errors. - Using an incorrect resource ID or resource type may result in errors or unexpected behavior.
- Network or authentication failures with the Sapo API will cause the node to error out.
- Invalid or malformed JSON in the
Error messages:
- Errors related to invalid validation data typically indicate the provided JSON does not meet expected schema or value constraints.
- Authentication errors suggest missing or incorrect API credentials.
- Resource not found errors occur if the specified resource ID does not exist.
Resolutions:
- Ensure
validationDataJSON is correctly formatted and matches expected structure. - Verify resource IDs and types are correct and correspond to existing entities.
- Confirm API credentials are properly set up and have required permissions.
- Enable "Continue On Fail" option in the node settings to handle errors gracefully in workflows.
- Ensure
Links and References
- Sapo API Documentation (general reference for Sapo API)
- n8n documentation on creating custom nodes
- JSON Schema validation concepts for structuring
validationDatapayloads