Skip to main content
POST
/
api
/
v3
/
admin
/
option_types
Spree Admin SDK
import { createAdminClient } from '@spree/admin-sdk'

const client = createAdminClient({
  baseUrl: 'https://your-store.com',
  secretKey: 'sk_xxx',
})

const optionType = await client.optionTypes.create({
  name: 'color',
  presentation: 'Color',
  option_values: [
    { name: 'red', presentation: 'Red' },
    { name: 'navy', presentation: 'Navy' },
  ],
})
{
  "id": "opt_gbHJdmfrXB",
  "name": "material",
  "label": "Material",
  "position": 2,
  "kind": "dropdown",
  "metadata": {},
  "filterable": true,
  "created_at": "2026-05-17T22:57:43.336Z",
  "updated_at": "2026-05-17T22:57:43.336Z"
}

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

Bearer token for admin authentication

Body

application/json
name
string
required
Example:

"color"

label
string
required
Example:

"Color"

position
integer
Example:

1

filterable
boolean
Example:

true

option_values
object[]

Response

option type created

id
string
required
name
string
required
label
string
required
position
number
required
kind
string
required
metadata
object
required
filterable
boolean
required
created_at
string
required
updated_at
string
required
option_values
object[]