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.

resource_type
string
required

Owner class, e.g. Spree::Product

namespace
string

Defaults to custom

label
string

Human-readable name; defaults to titleized key

storefront_visible
boolean

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

searchable
boolean

When true, values are included in storefront product text search

sortable
boolean

When true, storefront product listings can sort by this field

Response

201 - application/json

definition created