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
Bài Viết → Xác Thực
AI-generatedOverview
This node manages custom metafields on various resource types within the Sapo platform. It allows users to create, retrieve, update, delete, count, bulk delete, and validate metafields associated with resources such as articles, blogs, collections, customers, orders, pages, products, and product variants.
A common use case is enriching resource data by adding custom metadata fields (metafields) that are not part of the standard resource schema. For example, a user might add a "warehouse_location" metafield to a product to track inventory storage details or validate a metafield value before saving it.
The Validate operation specifically checks if a given metafield value meets certain criteria without modifying any data, useful for pre-validation in workflows.
Properties
| Name | Meaning |
|---|---|
| Thao Tác (operation) | The action to perform on the metafield. Options: Create, Get, Get Many, Update, Delete, Bulk Delete, Count, Validate. |
| Tài Nguyên (resource) | The type of resource the metafield belongs to. Options: Bài Viết (articles), Blog, Bộ Sưu Tập (collections), Khách Hàng (customers), Đơn Hàng (orders), Trang (pages), Sản Phẩm (products), Biến Thể Sản Phẩm (variants). |
| ID Tài Nguyên | Numeric ID of the specific resource instance to operate on. |
| ID Trường Tùy Chỉnh | Numeric ID of the metafield (required for get, update, delete operations). |
| Trả Về Tất Cả | Boolean indicating whether to return all results when listing metafields (getMany operation). |
| Giới Hạn | Maximum number of results to return when not returning all (getMany operation). |
| Thông Tin Bổ Sung | Additional filters or parameters such as namespace, key, creation date range for list, count, or bulk delete operations. |
| Dữ Liệu Trường Tùy Chỉnh | JSON object defining metafield data for create or update operations, including namespace, key, value, value_type, description. |
| Tùy Chọn Xác Thực | JSON object containing validation data for the validate operation, typically specifying type and value. |
Output
The node outputs an array with one item containing a json property:
- For create, get, update, count, bulkDelete, and getMany operations, the
jsoncontains the response data from the Sapo API related to metafields. - For delete, the output is
{ success: true }upon successful deletion. - For validate, the output is
{ valid: true }if the validation passes. - In case of errors (if not continuing on fail), the node throws an error; otherwise, it outputs
{ error: <error message> }.
No binary data is produced by this node.
Dependencies
- Requires an API credential for authenticating with the Sapo platform.
- Depends on an internal Sapo API base class to interact with metafield endpoints.
- The node expects proper configuration of the API credentials in n8n to function correctly.
Troubleshooting
Common issues:
- Invalid or missing resource ID or metafield ID can cause failures.
- Incorrectly formatted JSON in
dataorvalidationDataproperties may lead to parsing errors. - Insufficient permissions or invalid API credentials will result in authentication errors.
- Using unsupported resource-operation combinations may cause unexpected errors.
Error messages:
- Errors returned from the Sapo API are propagated with their message and stack trace.
- Validation errors occur if the provided validation data does not meet expected formats or constraints.
Resolutions:
- Verify that all required IDs and JSON inputs are correctly set.
- Ensure API credentials are valid and have necessary permissions.
- Use the "continue on fail" option to handle errors gracefully in workflows.
Links and References
- Sapo Platform Documentation (general reference for Sapo APIs)
- n8n documentation on Creating Custom Nodes
- JSON Schema references for validating metafield data structures (not linked here due to generic nature)