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

Bearer token for admin authentication

Path Parameters

product_id
string
required

Product ID

Body

application/json
options
object[]
required

Required. A variant created here is always non-master, so it must declare at least one option pair (e.g. size + color) or creation fails with 422. One pair per option type the variant participates in. Option types and values are auto-created if missing.

sku
string
Example:

"SKU-001"

cost_price
string
Example:

"10.00"

cost_currency
string
Example:

"USD"

weight
number
height
number
width
number
depth
number
weight_unit
string
dimensions_unit
string
track_inventory
boolean
tax_category_id
string
position
integer
barcode
string
prices
object[]

Per-currency prices. Upserted by currency.

stock_items
object[]

Per-stock-location inventory. Upserted by stock_location_id.

Response

variant created