Create Option
POST {{baseUrl}}/products/:product/options
You can create a new option for a specific product by providing the ID of the product you want to create the option for in the product path parameter.
Note: For product.type=product creating new product option will generate a new variant for this option.
OAuth Scopes
products.read_write
Request Body
{"name"=>"size", "display_type"=>"text", "values"=>[{"name"=>"XL", "price"=>120, "quantity"=>10, "display_value"=>"XL"}]}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: Created
{"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]}]}}