Light Mode
Update Product Variant
PUT
/products/variants/{variant}Last modified:Â 18 days ago
This endpoint allows you to update variant details by passing the variant
as a path parameter.
:::caution[Important]
- All variables in the update variant body request are optional.
- Updating one variable at a time is possible, but at least one of the variables must be in the body request payload. Otherwise, an error will be shown if you send an empty body request payload.
:::
Request
Path Params
variant
stringÂ
required
Query Params
sku
stringÂ
optional
The sku value of product variant. Example: 23-TD23-32
barcode
stringÂ
optional
The barcode value of product variant. Example: abc01
price
numberÂ
optional
The price of the product variant. Example: 96.33
sale_price
numberÂ
optional
The sale price of the product variant. Example: 90.50
cost_price
stringÂ
optional
The cost price of the product variant. Example: 100.33
stock_quantity
stringÂ
optional
Amount of the product variant total stock quantity. Only updated if the store feature manage product by branches is not activated. Example: 4
Body Params application/json
No schema defined
Example
{
"sku": "23-TD23-32",
"barcode": "abc01",
"price": 96.33,
"sale_price": 90.5,
"cost_price": 100.33,
"stock_quantity": 4,
"weight": 3,
"mpn": 43242342,
"gtin": 54353453
}
Request samples
Responses
Updated Successfully(201)
Not Found(404)
Error Validation(422)
Updated Successfully
HTTP Code:Â 201
Content Type :Â JSONapplication/json
Data Schema
No schema defined
Example
{
"status": 201,
"success": true,
"data": {
"id": 652911549,
"price": {
"amount": 13.5,
"currency": "SAR"
},
"sale_price": {
"amount": 0,
"currency": "SAR"
},
"cost_price": {
"amount": 0,
"currency": "SAR"
},
"stock_quantity": 3000,
"barcode": "barcode-ABC",
"sku": "sku-variant-1551119600",
"related_option_values": [
667315336
]
}
}
Last modified: 18 days ago