30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Get Coupon

store/get-coupon reads one coupon by its code — the string a customer actually types — including usage against its limit and its product and category restrictions.

Coupons are addressed by code rather than by ID throughout this suite.

At a glance

Abilitystore/get-coupon
ToolsetWooCommerce — toolset/woocommerce
GroupWooCommerce › Coupons
RequiresWooCommerce, active on the site
Capabilitymanage_options
SafetyRead-only — changes nothing
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

Addressing by code is the right choice because the code is the thing everybody has. A customer emails saying WELCOME10 is not working; nobody knows or cares what post ID that is.

The usage figures are what answer most coupon questions. A code that “stopped working” has usually hit its total usage limit, or its per-customer limit for that customer, or its expiry — and all three are here.

The restrictions are the other common answer: a coupon limited to certain products or categories appears not to work when applied to a cart that contains none of them, with no explanation at checkout beyond a generic refusal.

Minimum and maximum spend belong to the same family of invisible reasons.

Input

NameTypeRequiredWhat it is
codestringYesThe coupon code.

What comes back

NameTypeWhat it is
couponobjectCode, type, amount, expiry, usage count and limits, minimum and maximum spend, and product and category restrictions.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent 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:

Why has WELCOME10 stopped working?

It resolves to one call:

{
  "ability": "store/get-coupon",
  "parameters": {
    "code": "WELCOME10"
  }
}

Worth knowing

  • Addressed by code, not ID.
  • A coupon that “stopped working” has usually hit a limit or an expiry.
  • Product and category restrictions are a common invisible cause.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading