Update one variant
Permission
products:writeRate limit writesIdempotent with Idempotency-KeyAuthorization
ESTAGE-API-KeystringheaderrequiredA project key, est_live_…, from Settings → API keys. Call from server code only.
Path parameters
idintegerrequiredBody
application/jsonpricenumber≥ 0skustringnullable≤ 255 charsMust not be used by another variant of the same product.
compare_at_pricenumbernullable≥ 0inventory_policystringdeny = stop selling at zero; continue = keep selling.
One of deny, continue
titlestring≤ 255 charsbarcodestringnullable≤ 255 charscost_amountnumbernullable≥ 0positioninteger≥ 0image_idintegernullableAn image of the same product.
weightnumbernullable≥ 0lengthnumbernullable≥ 0widthnumbernullable≥ 0heightnumbernullable≥ 0is_defaultbooleanHeaders
Idempotency-Keystring≤ 255 charsAny unique string per attempt. A retry with the same key gets the first answer back instead of doing the work twice.
RequestcURL
curl --request PATCH \ --url 'https://api.estage.com/v1/variants/variant-id' \ --header 'ESTAGE-API-Key: est_live_your-api-key' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: your-unique-key' \ --data '{ "price": 24.5, "compare_at_price": 29, "sku": "TEE-L", "inventory_policy": "deny" }'
OK
{
"data": {
"id": 30442,
"product_id": 5012,
"title": "L",
"sku": "TEE-L",
"barcode": null,
"price": "24.50",
"compare_at_price": "29.00",
"cost_amount": null,
"position": 0,
"image_id": null,
"weight": null,
"inventory_policy": "deny",
"is_default": false,
"option_values": [
"L"
],
"inventory": {
"on_hand": 8,
"reserved": 0,
"available": 8
}
}
}Example. Errors are
{ error: { code, message, details } }.