store/update-coupon changes an existing coupon by its code: the amount, the expiry, the limits, the restrictions.
A code that does not exist is refused rather than created.
At a glance
| Ability | store/update-coupon |
| Toolset | WooCommerce — toolset/woocommerce |
| Group | WooCommerce › Coupons |
| 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 |
How it works
Refusing rather than creating is the right behaviour for an update addressed by a human-typed string. A typo in a coupon code should produce an error, not a new coupon with a misspelled code sitting alongside the real one.
The usage count survives an update. That matters when you are raising a limit: a coupon used 100 times against a limit of 100 needs the limit raised, and raising it to 150 gives fifty more uses rather than a hundred and fifty.
Changing the amount affects future orders only. Orders already placed keep the discount they were given, which is correct and occasionally surprising — the fix for a coupon that was too generous is to change it and accept the orders already through.
An empty string on date_expires removes the expiry entirely, which is the one way to make a coupon open-ended again.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
code | string | Yes | The code of the coupon to change. |
discount_type | string | No | percent, fixed_cart or fixed_product. |
amount | string | No | The discount amount. |
description | string | No | Internal description. |
date_expires | string | No | Expiry date, YYYY-MM-DD. An empty string removes it. |
usage_limit | integer | No | Total times the coupon may be used. |
usage_limit_per_user | integer | No | Times one customer may use it. |
minimum_amount | string | No | Minimum cart total. |
maximum_amount | string | No | Maximum cart total. |
individual_use | boolean | No | Cannot be combined with other coupons. |
free_shipping | boolean | No | Grants free shipping. |
product_ids | array | No | Restrict to these products. |
excluded_product_ids | array | No | Exclude these products. |
product_categories | array | No | Restrict to these categories. |
What comes back
| Name | Type | What it is |
|---|---|---|
coupon | object | The coupon after the write. |
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:
Extend WINTER26 to the end of January.
It resolves to one call:
{
"ability": "store/update-coupon",
"parameters": {
"code": "WINTER26",
"date_expires": "2027-01-31"
}
}Worth knowing
- A code that does not exist is refused, not created.
- The usage count is kept. Raising a limit gives the difference, not the whole new number.
- Changing the amount affects future orders only.
- An empty
date_expiresremoves the expiry.
Related abilities
- Get Coupon — read the current settings and usage
- Create Coupon — when the code does not exist yet
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category