Skip to content

Add a variant to a product

POST
/admin/v1/products/{productId}/variants
curl --request POST \
--url https://your-store.example.com/admin/v1/products/example/variants \
--header 'Content-Type: application/json' \
--data '{ "sku": "example", "title": "example", "options": {}, "priceAmount": 1, "currency": "example", "compareAtAmount": 1, "stockQuantity": 0, "allowBackorder": false, "weightGrams": 1, "lengthMm": 1, "widthMm": 1, "heightMm": 1, "position": 0 }'
productId
required
string
Media type application/json
object
sku
string
>= 1 characters <= 255 characters
title
string
>= 1 characters <= 512 characters
options
object
key
additional properties
priceAmount
required
integer
<= 9007199254740991
currency
required
string
/^[A-Za-z]{3}$/
compareAtAmount
Any of:
integer
<= 9007199254740991
stockQuantity
integer
0 <= 9007199254740991
allowBackorder
boolean
weightGrams
Any of:
integer
<= 9007199254740991
lengthMm
Any of:
integer
<= 9007199254740991
widthMm
Any of:
integer
<= 9007199254740991
heightMm
Any of:
integer
<= 9007199254740991
position
integer
0 <= 9007199254740991