Update Variant
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.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
sku | string | The sku value of product variant. Example: 23-TD23-32 | |
barcode | string | The barcode value of product variant. Example: abc01 | |
price | string | The price of the product variant. Example: 96.33 | |
sale_price | string | The sale price of the product variant. Example: 90.50 | |
cost_price | string | The cost price of the product variant. Example: 100.33 | |
stock_quantity | string | Amount 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"=>"<string>", "barcode"=>"<string>", "price"=>"<number>", "sale_price"=>"<number>", "cost_price"=>"<number>", "stock_quantity"=>"<number>", "weight"=>"<number>", "mpn"=>"<number>", "gtin"=>"<number>", "notify_low"=>"<integer>"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: Created
{"status":"\u003cnumber\u003e","success":"\u003cboolean\u003e","data":{"id":"\u003cinteger\u003e","barcode":"\u003cstring\u003e","sku":"\u003cstring\u003e","price":{"amount":"\u003cnumber\u003e","currency":"\u003cstring\u003e"},"sale_price":{"amount":"\u003cnumber\u003e","currency":"\u003cstring\u003e"},"regular_price":{"amount":"\u003cnumber\u003e","currency":"\u003cstring\u003e"},"cost_price":{"amount":"\u003cnumber\u003e","currency":"\u003cstring\u003e"},"stock_quantity":"\u003cinteger\u003e","unlimited_quantity":"\u003cboolean\u003e","related_options":["\u003cinteger\u003e","\u003cinteger\u003e"],"related_option_values":["\u003cinteger\u003e","\u003cinteger\u003e"],"is_default":"\u003cboolean\u003e","weight":"\u003cnumber\u003e","weight_type":"\u003cstring\u003e","weight_label":"\u003cstring\u003e","gtin":"\u003cstring\u003e","mpn":"\u003cstring\u003e","notify_low":"\u003cinteger\u003e"}}