Update a variant (PATCH semantics)
PATCH
/admin/v1/products/{productId}/variants/{variantId}
const url = 'https://your-store.example.com/admin/v1/products/example/variants/example';const options = { method: 'PATCH', headers: {'Content-Type': 'application/json'}, body: '{"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}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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 }'Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” productId
required
string
variantId
required
string
Request Body required
Section titled “Request Body required ” Media type application/json
object
sku
string
options
object
key
additional properties
priceAmount
integer
currency
string
stockQuantity
integer
allowBackorder
boolean
position
integer
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}