Skip to content

Update a variant (PATCH semantics)

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