Skip to main content
POST
Spree Admin SDK

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

Body

application/json
key
string
required
field_type
string
required

Custom field type token (short_text, long_text, rich_text, number, …). An extension type that has no token is named by its registered class instead.

Example:

"short_text"

resource_type
string
required

Shorthand of the resource the field attaches to, from the resource types endpoint.

Example:

"product"

namespace
string

Defaults to custom.

label
string

Human-readable name; defaults to the titleized key.

storefront_visible
boolean

When false, the definition is admin-only and never exposed in the Store API.

searchable
boolean

Include values in storefront product text search. Supported for short_text, long_text and number fields; other types are refused.

sortable
boolean

Allow storefront product listings to sort by this field (sort=cf_{namespace}_{key}). Supported for short_text and number fields; other types are refused.

Response

201 - application/json

definition created