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

Khách Hàng → Cập Nhật

AI-generated

Overview

This node manages custom metafields on various resources within the Sapo platform, such as customers, products, orders, and more. Specifically, for the "Khách Hàng" (Customer) resource with the "Cập Nhật" (Update) operation, it updates an existing custom metafield associated with a customer.

Use cases include modifying metadata like additional customer attributes or custom tags that are not part of the standard customer fields. For example, you might update a customer's preferred warehouse location or loyalty status stored as a metafield.

Properties

Name Meaning
ID Tài Nguyên The unique numeric identifier of the customer resource whose metafield you want to update.
ID Trường Tùy Chỉnh The unique numeric identifier of the specific metafield to update for the customer.
Dữ Liệu Trường Tùy Chỉnh JSON object containing the updated metafield data including namespace, key, value, value type, and description. Example:
json { "namespace": "inventory", "key": "warehouse_location", "value": "A-12", "value_type": "string", "description": "Storage location in warehouse" }

Output

The output is a JSON object representing the updated metafield details returned from the Sapo API after a successful update operation. It contains all relevant metafield properties reflecting the new state.

Example output structure:

{
  "id": 123,
  "namespace": "inventory",
  "key": "warehouse_location",
  "value": "A-12",
  "value_type": "string",
  "description": "Storage location in warehouse",
  "owner_id": 456,
  "owner_type": "customer"
}

No binary data is produced by this node.

Dependencies

  • Requires an active connection to the Sapo API via an API key credential configured in n8n.
  • The node depends on the SapoApiBase class which handles communication with the Sapo platform's metafield endpoints.
  • Proper permissions on the Sapo account to update customer metafields are necessary.

Troubleshooting

  • Common issues:
    • Invalid or missing resource ID or metafield ID will cause errors.
    • Incorrectly formatted JSON in the "Dữ Liệu Trường Tùy Chỉnh" property can lead to request failures.
    • Insufficient API permissions may result in authorization errors.
  • Error messages:
    • "Resource not found": Check if the provided customer ID and metafield ID exist.
    • "Invalid metafield data": Verify the JSON structure and required fields (namespace, key, value, value_type).
    • Network or authentication errors: Ensure the API key credential is valid and has access rights.

Links and References

Discussion