wc_get_coupon: get one coupon
Reads a coupon in full — including the expiry date and restrictions the listing leaves out.
Arguments
| Argument | Required | Meaning |
|---|---|---|
id |
Yes | The coupon ID |
Note that this takes the numeric ID, not the code. To go from SUMMER25 to an ID, list the coupons first.
Permissions
mcp:read and woocommerce:catalog:read, plus manage_woocommerce or edit_shop_coupons.
What it returns
The five listing fields — id, code, discount_type, amount, usage_limit — plus:
| Field | Meaning |
|---|---|
description |
The internal note explaining what the code is for |
individual_use |
Whether it can be combined with other coupons |
product_ids |
The products it is restricted to, if any |
date_expires |
When it stops working, as an ISO timestamp, or null |
date_expires is the field you came for
null means the coupon never expires. That is not a neutral default — it is a code that will still work in three years, in whatever campaign it leaks into.
A shop full of non-expiring coupons is a shop with unbounded discount exposure, and this is the only tool that shows it.
Read every coupon and tell me which have no expiry date.
When a date is present it is an exact timestamp, so a coupon can be live now and dead this evening. Compare against the site's own time, not yours.
individual_use decides whether discounts stack
With it off, a customer can combine this coupon with others, and the discounts compound. That is usually not what a campaign intends.
The listing does not report it, so a stacking problem is invisible until someone finds the combination. Reading it here is the check.
product_ids scopes the coupon
An empty list means the coupon applies to the whole cart. A populated one restricts it to those products.
Beware of the inverse: WooCommerce also supports excluded products, minimum spend, per-user limits and email restrictions — and none of those are visible here, because MCP does not expose them. So this read shows you a coupon's scope only partially.
A coupon can be far more restricted than this response suggests. Check the WooCommerce admin before concluding a code is unbounded.
usage_limit is a total, not per customer
It caps how many times the code can be redeemed across the whole shop. The separate per-customer limit is not exposed by these tools.
null or 0 means unlimited. Combined with a null expiry, that is a code with no ceiling of any kind.
Read before every write
Coupons have no revision history. This response is the only record of what an update is about to replace.
Read coupon 812 and show me every field, then apply the change.
That matters more than for most content, because the values are commercial: an amount overwritten by accident is money.
Using it well
Read coupon 812 and tell me whether it is currently valid.
For each published coupon, show me the code, amount, type and expiry in a table.
Common problems
| Symptom | Cause |
|---|---|
pom_ai_mcp_wc_coupon_not_found |
Wrong ID, or you passed the code instead |
pom_ai_mcp_wc_forbidden |
Missing manage_woocommerce or edit_shop_coupons |
date_expires is null |
The coupon never expires |
| Restrictions you configured are absent | MCP exposes only part of a coupon's settings |
| The coupon works despite looking restricted | Unexposed settings are in play |
Related
wc_get_coupons— find the IDwc_update_coupon- Coupon tools