custom_field.define
Define a typed custom field for a product or cart level (merchant-owned).
- Scope:
custom_fields.write - System: no
- Reachable from:
POST /v1/commands/custom_field.define(tenant credential) · MCP toolcustom_field.define· SDKclient.call('custom_field.define', …) - Events:
custom_field.updated
Input (JSON Schema)
Section titled “Input (JSON Schema)”{ "properties": { "facetable": { "default": false, "type": "boolean" }, "key": { "minLength": 1, "type": "string" }, "label": { "anyOf": [ { "type": "string" }, { "additionalProperties": { "type": "string" }, "propertyNames": { "type": "string" }, "type": "object" } ] }, "options": { "default": [], "items": { "properties": { "key": { "minLength": 1, "type": "string" }, "label": { "type": "string" } }, "required": [ "key" ], "type": "object" }, "type": "array" }, "owner_entity": { "enum": [ "product", "cart", "cart_line", "cart_customer", "order", "order_line", "customer", "category", "store" ], "type": "string" }, "pii": { "enum": [ "name", "email", "phone", "address", "postal_code", "tax_id", "other" ], "type": "string" }, "required": { "default": false, "type": "boolean" }, "type": { "enum": [ "text", "number", "boolean", "select" ], "type": "string" } }, "required": [ "owner_entity", "key", "type" ], "type": "object"}Result (200)
Section titled “Result (200)”{ "additionalProperties": false, "properties": { "definition_id": { "type": "string" } }, "required": [ "definition_id" ], "type": "object"}Errors
Section titled “Errors”validation_failed (400) · unauthorized (401) · forbidden (403) · conflict (409) · internal (500)