store/create-variable-product creates a product that comes in variations: sizes, colours, and so on.
WooCommerce’s own product create cannot make one. Its type list covers simple, virtual, downloadable, external and grouped products, and stops there.
At a glance
| Ability | store/create-variable-product |
| Toolset | WooCommerce — toolset/woocommerce |
| Group | WooCommerce › Products & Variations |
| Requires | WooCommerce, active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Not idempotent — each call changes the row set, so re-running is not a no-op |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
Two steps, on purpose
A variable product is a parent plus one child product per combination of its varying attributes. Creating it is therefore two operations, and this is the first: the parent, with the attributes that will vary marked as such.
The second is store/generate-variations, which builds the combinations. Keeping them separate means you can check the attribute set before committing to the product explosion it implies — three sizes by four colours by five materials is sixty child products.
Created as a draft unless you say otherwise, so nothing appears in the shop half-built. A variable product with no variations is a product customers cannot buy, and it is a real state this exists in between the two calls.
Each attribute needs a name, its options, and for_variations: true to mark it as an axis the product varies along. An attribute without that flag is descriptive only.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
name | string | Yes | Product name. |
sku | string | No | Stock keeping unit. |
status | string | No — defaults to draft | Publication status. |
attributes | array | No | The attributes to vary along. Each needs name, options and for_variations: true. |
What comes back
| Name | Type | What it is |
|---|---|---|
product | object | The created variable product. |
lookup_state | object | Whether the product lookup table still agrees with the product after the write. A mismatch means the shop is answering SKU searches, price sorts and on-sale queries with stale values. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation. |
Example
Ask your assistant:
Create a t-shirt that comes in three sizes and two colours.
It resolves to one call:
{
"ability": "store/create-variable-product",
"parameters": {
"name": "Organic Cotton T-Shirt",
"attributes": [
{ "name": "Size", "options": ["S", "M", "L"], "for_variations": true },
{ "name": "Colour", "options": ["Black", "White"], "for_variations": true }
]
}
}Worth knowing
- Draft by default. Publish once the variations exist.
- Attributes without
for_variationsare descriptive, not axes. - Not idempotent.
- A variable product with no variations cannot be bought. Run the generation step before publishing.
Related abilities
- Generate Variations — the required second step
- Set Product Attributes — change the axes afterwards
- Update Variation — price the combinations
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category