Update Variant

PUT {{baseUrl}}/products/variants/:variant?sku=23-TD23-32&barcode=abc01&price=96.33&sale_price=90.5&regular_price=100.33&stock_quantity=4

This endpoint allows you to update variant details by providing the ID of the variant you want to update its details in the variant path parameter.

OAuth Scopes


orders.read_write

Request Params

KeyDatatypeRequiredDescription
skustringThe sku value of product variant. Example: 23-TD23-32
barcodestringThe barcode value of product variant. Example: abc01
pricestringThe price of the product variant. Example: 96.33
sale_pricestringThe sale price of the product variant. Example: 90.50
regular_pricestringThe regular price of the product variant. Example: 100.33
stock_quantitynumberAmount of the product variant total stock quantity. Only updated if the store feature manage product by branches is not activated. Example: 4

Request Body

{"sku"=>"23-TD23-32", "barcode"=>"abc01", "price"=>96.33, "sale_price"=>90.5, "regular_price"=>100.33, "stock_quantity"=>4}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: Created

{"status":201,"success":true,"data":{"id":652911549,"price":{"amount":13.5,"currency":"SAR"},"sale_price":{"amount":0,"currency":"SAR"},"regular_price":{"amount":0,"currency":"SAR"},"stock_quantity":3000,"barcode":"barcode-ABC","sku":"sku-variant-1551119600","related_option_values":[667315336]}}