ecommerce_createAProductVariantV1
Add a product variant by specifying option values (e.g., size, color) and price. Automatically creates missing options and returns the new variant.
Instructions
Add a variant to a product along one or more option dimensions (e.g. Size, Color). Options missing from the product are created automatically; provide a value for every option the product already has. Prices are integers in the smallest currency unit and default to the store currency. Returns the created variant.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sku | No | The variant SKU. | |
| title | No | The variant title. Defaults to the option values joined with ' / ' (e.g. 'Red / L'). | |
| prices | No | Prices per currency. Amounts are integers in the smallest currency unit. A free item is amount: 0. | |
| options | Yes | Option name/value pairs that distinguish this variant, e.g. [{name: Size, value: M}]. Options missing from the product are created; provide a value for every option the product already has. | |
| store_id | Yes | The ID of the store that owns the product. | |
| product_id | Yes | The ID of the product to add the variant to. | |
| manage_inventory | No | Whether stock is tracked for this variant. Defaults to false. | |
| inventory_quantity | No | Units in stock. Defaults to 0. |