Create variant
shop_create_variantCreates a new variant of a given product Guidance: Creates a new variant of a given product | context: product_id, option_values, price
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"product_id": "<product_id>",
"price": "<price>",
"option_values": "<option_values>"
},
"name": "shop_create_variant"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sku | No | Stock Keeping Unit unique ID. | |
| media | No | Unique ID of the Product Media instance displayed with the variant. | |
| price | Yes | Variant unit price. | |
| stock | No | Variant stock quantity. This field should contain a positive integer or the value `-1` for an infinite stock. | |
| weight | No | Variant weight (unit: kg). | |
| position | No | Position of the variant in the product variants list (0 is the first). | |
| compare_at | No | Price reference for this product variant. | |
| product_id | Yes | Unique ID of the product. | |
| option_values | Yes | List of option/value pairs that identify this variant. Each item must include option_id and value, for example [{"option_id": 1, "value": "Red"}, {"option_id": 2, "value": "M"}]. |