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
Cập Nhật
AI-generatedOverview
This node manages custom metafields on various resource types within the Sapo platform. Metafields are additional data fields that can be attached to resources such as products, orders, customers, blogs, and more, allowing users to extend the default data model with custom information.
Common scenarios for this node include:
- Adding extra metadata to products or orders (e.g., warehouse location, special instructions).
- Updating existing metafields to reflect changes in business logic.
- Retrieving detailed metafield information for reporting or integration purposes.
- Deleting obsolete or incorrect metafields in bulk or individually.
- Validating metafield values before applying them.
Practical example: A store manager wants to track the exact storage location of each product in their warehouse. They can use this node to create or update a metafield named warehouse_location under the inventory namespace for each product resource.
Properties
| Name | Meaning |
|---|---|
| ID Tài Nguyên | The numeric ID of the resource (e.g., product, order) to which the metafield belongs. |
| ID Trường Tùy Chỉnh | The numeric ID of the specific metafield to get, update, or delete. Required for "get", "update", "delete" operations. |
| Dữ Liệu Trường Tùy Chỉnh | JSON object containing metafield data such as namespace, key, value, value type, and description. Required for "create" and "update" operations. Example structure: json { "namespace": "inventory", "key": "warehouse_location", "value": "A-12", "value_type": "string", "description": "Storage location in warehouse" } |
Output
The node outputs an array with one element containing a json property. This json contains the result of the operation performed:
- For create, get, update, and getMany operations, it returns the metafield data or list of metafields.
- For delete and bulkDelete, it returns a success confirmation object.
- For count, it returns an object with a
countproperty indicating the number of metafields matching criteria. - For validate, it returns
{ valid: true }if the validation passes. - In case of errors (if not continuing on fail), it throws an error; otherwise, it returns an error message inside the
json.
No binary data output is produced by this node.
Dependencies
- Requires an API credential for authenticating with the Sapo platform.
- Depends on the internal
SapoApiBaseclass to perform REST API calls to manage metafields. - No additional external services beyond Sapo's API are required.
Troubleshooting
Common issues:
- Providing invalid or missing resource IDs or metafield IDs will cause errors.
- Incorrectly formatted JSON in the metafield data property may lead to request failures.
- Attempting to update or delete a metafield that does not exist will result in errors.
- Insufficient permissions or invalid API credentials will cause authentication errors.
Error messages:
- Errors from the Sapo API are propagated and shown in the node output or thrown.
- If "Continue On Fail" is enabled, errors appear as JSON objects with an
errorfield describing the issue. - To resolve errors, verify input parameters, ensure correct JSON formatting, and confirm API credentials have proper access rights.
Links and References
- Sapo API Documentation (for metafield management endpoints)
- n8n documentation on creating custom nodes