store/set-product-attributes replaces a product’s attributes — size, colour, material — with the set you give.
It replaces rather than merges, so send the full set you want to end up with.
At a glance
| Ability | store/set-product-attributes |
| Toolset | WooCommerce — toolset/woocommerce |
| Group | WooCommerce › Products & Variations |
| Requires | WooCommerce, active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
Descriptive, or an axis
An attribute does two different jobs depending on one flag. Without for_variations it is descriptive: it shows in the additional-information table and nothing else. With it, the attribute becomes an axis the product varies along, and store/generate-variations will build a variation for every combination of the flagged attributes.
Which means changing that flag on an existing variable product is consequential. Adding an axis multiplies the combinations; removing one leaves existing variations referencing an attribute that is no longer varying.
Replacement is the right primitive here even though it is blunter than merging: attributes are a set, the order matters for display, and a merge would have to invent rules for what happens when two entries share a name.
The visible flag controls whether the attribute shows on the product page. An attribute can be an axis without being displayed.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
id | integer | Yes | Product ID. |
attributes | array | Yes | Each entry takes name, options (an array of values), and optionally visible and for_variations. |
What comes back
| Name | Type | What it is |
|---|---|---|
product | object | The product after the write. |
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:
Set size and colour as the varying attributes on product 812.
It resolves to one call:
{
"ability": "store/set-product-attributes",
"parameters": {
"id": 812,
"attributes": [
{ "name": "Size", "options": ["S", "M", "L"], "visible": true, "for_variations": true },
{ "name": "Material", "options": ["Organic cotton"], "visible": true }
]
}
}Worth knowing
- Replaces the whole set. Include the attributes you are keeping.
for_variationsis what makes an attribute an axis. Without it the attribute is descriptive only.- Adding an axis to an existing variable product multiplies the variations it needs.
- Idempotent.
Related abilities
- Generate Variations — build the combinations
- Get Product — read the current attributes
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category