Skip to main content
POST
/
admin
/
products
/
{id}
/
variants
curl -X POST 'http://localhost:9000/admin/products/prod_01HXYZABCDEF/variants' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"title": "L", "sku": "LS-L", "options": {"Size": "L"}}'
{
  "product": {
    "id": "prod_01HXYZABCDEF",
    "title": "Linen Shirt",
    "variants": [
      { "id": "variant_01HXYZABCDEF", "title": "M", "sku": "LS-M" },
      { "id": "variant_01HXYZABCDEG", "title": "L", "sku": "LS-L" }
    ]
  }
}
Creates a new variant on the product and returns the updated product.

Path parameters

id
string
required
The product’s ID.

Body parameters

title
string
required
Variant title.
sku
string
Variant SKU.
ean
string
Variant EAN.
upc
string
Variant UPC.
isbn
string
Variant ISBN.
asin
string
Variant ASIN.
gtin
string
Variant GTIN.
barcode
string
Variant barcode.
hs_code
string
Harmonized System code.
mid_code
string
Manufacturer identification code.
variant_rank
number
Sort rank of the variant.
weight
number
Variant weight.
length
number
Variant length.
height
number
Variant height.
width
number
Variant width.
origin_country
string
Country of origin.
material
string
Variant material.
options
object
Map of option title to option value, for example {"Size": "L"}.
metadata
object
Custom key-value data.
additional_data
object
Custom data passed to workflow hooks.

Response

product
object
curl -X POST 'http://localhost:9000/admin/products/prod_01HXYZABCDEF/variants' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"title": "L", "sku": "LS-L", "options": {"Size": "L"}}'
{
  "product": {
    "id": "prod_01HXYZABCDEF",
    "title": "Linen Shirt",
    "variants": [
      { "id": "variant_01HXYZABCDEF", "title": "M", "sku": "LS-M" },
      { "id": "variant_01HXYZABCDEG", "title": "L", "sku": "LS-L" }
    ]
  }
}