Skip to main content
PATCH
/
api
/
v3
/
admin
/
custom_field_definitions
/
{id}
Update a custom field definition
const options = {
  method: 'PATCH',
  headers: {
    'x-spree-api-key': '<api-key>',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({label: '<string>', storefront_visible: true})
};

fetch('http://{defaultHost}/api/v3/admin/custom_field_definitions/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "cfdef_UkLWZg9DAJ",
  "namespace": "specs",
  "key": "fabric",
  "label": "Fabric Composition",
  "field_type": "short_text",
  "resource_type": "Spree::Product",
  "storefront_visible": false,
  "created_at": "2026-05-24T17:36:37.685Z",
  "updated_at": "2026-05-24T17:36:37.959Z"
}

Documentation Index

Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-spree-api-key
string
header
required

Secret API key for admin access

Authorization
string
header
required

JWT token for admin user authentication

Headers

x-spree-api-key
string
required
Authorization
string
required

Path Parameters

id
string
required

Body

application/json
label
string
storefront_visible
boolean

Response

200 - application/json

definition updated