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

Biến Thể Sản Phẩm → Xóa Hàng Loạt

AI-generated

Overview

This node manages custom metafields on various resource types within the Sapo platform, specifically supporting operations like creating, retrieving, updating, deleting, counting, validating, and bulk deleting metafields. The "Biến Thể Sản Phẩm" (Product Variant) resource with the "Xóa Hàng Loạt" (Bulk Delete) operation allows users to delete multiple metafields associated with a specific product variant in one action.

Common scenarios include cleaning up obsolete or irrelevant metafields from product variants in bulk, which is useful for maintaining data hygiene and optimizing metadata management in e-commerce stores powered by Sapo.

Practical example: If you have many metafields attached to a product variant that are no longer needed (e.g., outdated inventory locations or promotional tags), you can use this node's bulk delete operation to remove them all at once based on filters such as namespace, key, or creation date ranges.

Properties

Name Meaning
ID Tài Nguyên Numeric ID of the resource (product variant) whose metafields are targeted for bulk deletion.
Thông Tin Bổ Sung Additional optional filters to narrow down which metafields to bulk delete. Options include:
- Namespace: Filter metafields by their namespace string.
- Key: Filter metafields by their key string.
- Tạo Sau (Created After): Filter metafields created after this datetime.
- Tạo Trước (Created Before): Filter metafields created before this datetime.

Output

The output JSON contains the result of the bulk delete operation. Typically, it returns an object indicating success status:

{
  "success": true
}

This confirms that the specified metafields matching the filters were deleted successfully.

No binary data output is produced by this operation.

Dependencies

  • Requires connection to the Sapo API via an API authentication credential configured in n8n.
  • The node depends on the internal SapoApiBase class to interact with metafield endpoints.
  • Proper permissions on the Sapo account to manage metafields on product variants are necessary.

Troubleshooting

  • Common issues:

    • Providing an invalid or non-existent resource ID will cause errors because the node cannot find the target product variant.
    • Incorrect filter values in "Thông Tin Bổ Sung" may result in no metafields being matched or deleted.
    • Insufficient API permissions or expired credentials will lead to authentication errors.
  • Error messages:

    • Errors returned from the Sapo API will be surfaced with their message. For example, "Resource not found" indicates the given product variant ID does not exist.
    • Network or authentication failures will throw errors related to connectivity or invalid credentials.
  • Resolutions:

    • Verify the resource ID corresponds to an existing product variant.
    • Double-check filter fields for correct formatting and valid values.
    • Ensure the API credential is valid and has required scopes/permissions.
    • Use the node's "Continue On Fail" option to handle partial failures gracefully.

Links and References

Discussion