option
as a path parameter.product.type
variable set to product
, updating product option with new values will generate new variants for these new values old
values are updated, they are removed as the new
values are added.products.read_write
- Products Read & WriteAuthorization: Bearer ********************
{
"name": "text update",
"required": false,
"sort": 44,
"display_type": "text",
"associated_with_order_time": false,
"not_same_day_order": false,
"availability_range": true,
"visibility": "on_condition",
"visibility_condition_type": "=",
"visibility_condition_option": 131932457,
"visibility_condition_value": 1516487768,
"advance": true,
"values": [
{
"name": "value new"
},
{
"name": "value new 2"
}
]
}
curl --location --request PUT 'https://api.salla.dev/admin/v2/products/options/' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "text update",
"required": false,
"sort": 44,
"display_type": "text",
"associated_with_order_time": false,
"not_same_day_order": false,
"availability_range": true,
"visibility": "on_condition",
"visibility_condition_type": "=",
"visibility_condition_option": 131932457,
"visibility_condition_value": 1516487768,
"advance": true,
"values": [
{
"name": "value new"
},
{
"name": "value new 2"
}
]
}'
{
"status": 201,
"success": true,
"data": {
"id": 1130246629,
"name": "size",
"description": "This product is best seller",
"type": "radio",
"required": false,
"associated_with_order_time": 0,
"sort": 9,
"display_type": "text",
"visibility": "always",
"values": [
{
"id": 322122678,
"name": "XL",
"price": {
"amount": 180,
"currency": "SAR"
},
"display_value": "XL",
"option_id": 1130246629,
"image_url": "https://i.ibb.co/jyqRQfQ/avatar-male.webp",
"hashed_display_value": "XL"
}
],
"skus": [
{
"id": 652911549,
"price": {
"amount": 150,
"currency": "SAR"
},
"regular_price": {
"amount": 234,
"currency": "SAR"
},
"stock_quantity": 3000,
"barcode": "barcode-ABC",
"sku": "sku-variant-1551119600",
"related_option_values": [
667315336,
322122678
]
}
]
}
}