Light Mode
Create Product Option
POST
/products/{product}/optionsLast modified: 23 days ago
This endpoint allows you to create a new option for a specific product by passing the product
as a path parameter.
:::tip[Note]
For the product.type
variable set to product
, creating a new product option will generate a new variant for this option.
:::
Request
Path Params
product
integer
required
The Product ID. List of Product ID can be found here.
Body Params application/json
No schema defined
Example
{
"name": "option name",
"required": true,
"visibility": "on_condition",
"visibility_condition_type": "=",
"visibility_condition_option": 2134428744,
"visibility_condition_value": 306646512,
"display_type": "image",
"values": [
{
"name": "value 3",
"price": "10",
"is_default": false
}
]
}
Request samples
Responses
Created Successfully(201)
Not Found(404)
Error Validation(422)
Created Successfully
HTTP Code: 201
Content Type : JSONapplication/json
Data Schema
No schema defined
Example
{
"status": 201,
"success": true,
"data": {
"id": 1130246629,
"name": "size",
"description": null,
"type": "radio",
"required": false,
"associated_with_order_time": 0,
"sort": null,
"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
]
}
]
}
}
Last modified: 23 days ago