Modo Claro
Update Product Variant
PUT
/products/variants/{variant}Last modified: a month 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
Parâmetros Path
variant
string
requerido
Parâmetros Query
sku
string
opcional
The sku value of product variant. Example: 23-TD23-32
barcode
string
opcional
The barcode value of product variant. Example: abc01
price
number
opcional
The price of the product variant. Example: 96.33
sale_price
number
opcional
The sale price of the product variant. Example: 90.50
cost_price
string
opcional
The cost price of the product variant. Example: 100.33
stock_quantity
string
opcional
Amount of the product variant total stock quantity. Only updated if the store feature manage product by branches is not activated. Example: 4
Parâmetros Bodyapplication/json
No schema defined
Exemplo
{
"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
Respostas
Updated Successfully(201)
Not Found(404)
Error Validation(422)
Updated Successfully
HTTP Code: 201
Content Type : JSONapplication/json
Esquema de Dados
No schema defined
Exemplo
{
"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: a month ago