set_commerce_product_options
Set a product's variation axes (size, colour, ...) and rebuild its variants.
By default the full variant matrix is regenerated: variants matching an existing
option combination keep their id, SKU, price, and stock; combinations that no longer
exist are removed. Pass variants to control the set explicitly.
Args: project_id: The project ID. product_id: The product ID. options: JSON array of up to 3 axes, e.g. [{"name":"Size","values":["S","M","L"]},{"name":"Colour","values":["Black","White"]}]. Send [] to remove all options and variants. variants: Optional JSON array of variants to use instead of the generated matrix.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| options | Yes | ||
| variants | No | ||
| product_id | Yes | ||
| project_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |