Custom Field Definitions
API version:
unstableThese endpoints manage custom field definitions — the schema for a field (name, type, allowed values). To read or write field values on entity instances, see Custom Field Values.
Supported entities:
products,products/variants,customersNamespace format: must match
^[a-z][a-z0-9_-]*$— lowercase alphanumeric, underscores, and hyphens; must start with a letter.Restricted namespaces:
custom,default,tiendanube,nuvemshop,system,admin,legacy— rejected with422.
This feature is currently only available to stores enrolled in the beta program. If you are interested in participating, please contact us.
Common response
All definition endpoints return this shape (single object or array):
{
"id": "color",
"namespace": "myapp",
"slug": "color",
"key": "color",
"name": "Color",
"description": "The product color",
"value_type": "text",
"owner_resource": "products",
"created_at": "2024-01-10T08:00:00Z",
"updated_at": "2024-01-10T08:00:00Z"
}
| Field | Type | Description |
|---|---|---|
id | string | Same as slug |
namespace | string | The app namespace |
slug | string | The field slug |
key | string | The field slug |
name | string | Human-readable field name |
description | string | Field description |
value_type | string | Field type — see supported types below |
owner_resource | string | Entity type (products, product_variants, customers) |
created_at | ISO 8601 | When the definition was created |
updated_at | ISO 8601 | When the definition was last updated |
Supported value_type values
| Type | Description |
|---|---|
text | Free-form string |
text_list | Constrained list of allowed string values |
numeric | Numeric value |
date | ISO 8601 date string |
color | Color value |
boolean | Boolean value |
media | Media asset |
ref | Reference to a single custom object entry |
ref[] | Reference to multiple custom object entries |
object | Inline structured object defined by a schema |
object[] | Array of inline structured objects defined by a schema |
Extra response fields by value_type
text_list
| Field | Type | Description |
|---|---|---|
values | array of strings | The allowed values for this field |
ref and ref[]
| Field | Type | Description |
|---|---|---|
ref_type | string | Target custom object type in namespace/slug format |
object and object[]
| Field | Type | Description |
|---|---|---|
schema | object | Schema describing the structure of the value — see Custom Object Schema DSL |
Endpoints
POST /{entity}/custom-fields/{namespace}
Creates a new custom field definition.
| Entity | Required scope |
|---|---|
products | write_products |
products/variants | write_products |
customers | write_customers |
Request body
{
"slug": "color",
"name": "Color",
"description": "The product color",
"value_type": "text"
}
| Field | Type | Required | Description |
|---|---|---|---|
slug | string | Yes | URL-safe identifier for the field |
name | string | Yes | Human-readable field name |
description | string | No | Field description |
value_type | string | Yes | One of the supported types |
capabilities | array | No | Capabilities to enable on creation — see Available capabilities |
Extra request fields by value_type
text_list
| Field | Type | Required | Description |
|---|---|---|---|
values | array of strings | Yes | Allowed values for this field |
{ "slug": "size", "name": "Size", "value_type": "text_list", "values": ["S", "M", "L", "XL"] }
ref and ref[]
| Field | Type | Required | Description |
|---|---|---|---|
ref_type | string | Yes | Target custom object type in namespace/slug format |
{ "slug": "badge", "name": "Badge", "value_type": "ref", "ref_type": "myapp/badge" }
object and object[]
| Field | Type | Required | Description |
|---|---|---|---|
schema | object | Yes | Schema describing the structure of the value — see Custom Object Schema DSL |
{
"slug": "dimensions",
"name": "Dimensions",
"value_type": "object",
"schema": {
"kind": "object",
"label": "Dimensions",
"properties": {
"width": { "kind": "number", "label": "Width" },
"height": { "kind": "number", "label": "Height" }
}
}
}
Response
201 Created — single definition object