Skip to main content
Version: Unstable

Custom Field Values

API version: unstable

These endpoints manage the stored values of custom fields on entity instances. To define custom fields, use the Custom Field Definitions API (stable).

Supported entities: products, products/variants, customers

Namespace 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 with 422.

Beta access only

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 value endpoints return this shape (single object or array):

{
"namespace": "myapp",
"owner_resource": "products",
"value_type": "string",
"key": "myapp/color",
"name": "Color",
"description": "The product color",
"value": "red",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
FieldTypeDescription
namespacestringThe app namespace
owner_resourcestringEntity type (products, product_variants, customers)
value_typestringField type as defined in the definition
keystringComposite key in namespace/slug format
namestringHuman-readable field name
descriptionstringField description
valueanyThe stored value (type depends on value_type)
created_atISO 8601When the value was first set
updated_atISO 8601When the value was last updated

Fields with null values are omitted from the response.

Endpoints

GET /{entity}/{id}/custom-fields

Returns all custom field values across all namespaces for a given entity instance.

EntityRequired scope
productsread_products
products/variantsread_products
customersread_customers

Query parameters

ParameterTypeDescription
expandstringPass refs to expand reference-type field values inline

Response

200 OK — array of field value objects


GET /{entity}/{id}/custom-fields/{namespace}

Returns all custom field values scoped to a specific namespace for a given entity instance.

EntityRequired scope
productsread_products
products/variantsread_products
customersread_customers

Query parameters

ParameterTypeDescription
expandstringPass refs to expand reference-type field values inline

Response

200 OK — array of field value objects


PUT /{entity}/{id}/custom-fields/{namespace}/{slug}/value

Creates or replaces the value of a specific field on an entity instance. The value is validated against the field definition's schema.

EntityRequired scope
productswrite_products
products/variantswrite_products
customerswrite_customers

Request body

{
"value": "red"
}
FieldTypeRequiredDescription
valueanyYesThe value to set. Type must match the field definition's value_type.

Response

200 OK — single field value object

404 Not Found — definition not found


DELETE /{entity}/{id}/custom-fields/{namespace}/{slug}/value

Removes the stored value of a field on an entity instance.

EntityRequired scope
productswrite_products
products/variantswrite_products
customerswrite_customers

Response

204 No Content — value deleted

404 Not Found — definition or value not found


PUT /{entity}/{id}/custom-fields/values

Sets multiple field values at once for a given entity instance. Each entry identifies the definition by its namespace/slug key. The operation is transactional — if any definition is not found, the entire request rolls back.

EntityRequired scope
productswrite_products
products/variantswrite_products
customerswrite_customers

Request body

{
"values": [
{ "key": "myapp/color", "value": "red" },
{ "key": "myapp/size", "value": "XL" }
]
}
FieldTypeRequiredDescription
valuesarrayYesMust not be empty
values[].keystringYesDefinition key in namespace/slug format
values[].valueanyYesThe value to set

Response

200 OK — array of field value objects, one per entry

400 Bad Request — validation errors or definition not found (rolls back all)


GET /{entity}/custom-fields/{namespace}/{slug}/owners

Returns the field definition and a paginated list of all entity instances that have a value set for it.

EntityRequired scope
productsread_products
products/variantsread_products
customersread_customers

Query parameters

ParameterTypeDefaultDescription
afterstringCursor from a previous response's next_cursor for pagination
limitinteger50Number of owners to return. Clamped to [1, 200].

Response

200 OK

{
"namespace": "myapp",
"slug": "color",
"key": "myapp/color",
"name": "Color",
"description": "The product color",
"value_type": "string",
"owner_resource": "products",
"values": [],
"ref_type": null,
"schema": null,
"capabilities": [],
"owners": [
{ "entity_id": "123", "value": "red" },
{ "entity_id": "456", "value": "blue" }
],
"next_cursor": "MTIz",
"has_more": true,
"created_at": "2024-01-10T08:00:00Z",
"updated_at": "2024-01-10T08:00:00Z"
}
FieldTypeDescription
namespacestringThe app namespace
slugstringThe field slug
keystringComposite key in namespace/slug format
namestringHuman-readable field name
descriptionstringField description
value_typestringField type
owner_resourcestringEntity type
valuesarrayAllowed values list (for text_list type)
ref_typestringReference type (for ref type)
schemaobjectJSON schema for validation
capabilitiesarrayEnabled capabilities (e.g. filterable)
ownersarrayPaginated list of { entity_id, value } pairs
next_cursorstringOpaque cursor for the next page. Absent when has_more is false.
has_morebooleanWhether more owners exist beyond this page
created_atISO 8601Definition creation time
updated_atISO 8601Definition last update time

404 Not Found — definition not found