Light Mode
Update Product Variant
PUT
/products/variants/{variant}Last modified: 17 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: 17 days ago