> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maxicore.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# WooCommerce coupon creation and management abilities

> Create, retrieve, update, delete, and list WooCommerce discount coupons — including usage stats and expiry controls — using Maxi AI Core Pro.

Coupon abilities let your AI agent manage the full lifecycle of WooCommerce discount coupons — creating percentage or fixed-amount codes, setting expiry dates and usage limits, updating live coupons, and reviewing current usage counts. All coupon abilities require an active **Pro** plan, **WooCommerce** to be installed and active, and the `manage_woocommerce` capability on the connected WordPress user.

<Info>
  All WooCommerce coupon abilities require WooCommerce to be active and a **Pro** plan license. The connected WordPress user must have the `manage_woocommerce` capability — typically assigned to the **Shop Manager** or **Administrator** role.
</Info>

## All coupon abilities

| Ability              | Description                                                                        | Capability           | Plan |
| -------------------- | ---------------------------------------------------------------------------------- | -------------------- | ---- |
| `maxi/create-coupon` | Create a coupon with discount type, amount, limits, and restrictions.              | `manage_woocommerce` | Pro  |
| `maxi/get-coupon`    | Get coupon details by ID or coupon code, including usage stats.                    | `manage_woocommerce` | Pro  |
| `maxi/update-coupon` | Update coupon amount, expiry, limits, or restrictions. Send only fields to change. | `manage_woocommerce` | Pro  |
| `maxi/delete-coupon` | Delete a coupon permanently.                                                       | `manage_woocommerce` | Pro  |
| `maxi/list-coupons`  | List coupons with optional filters.                                                | `manage_woocommerce` | Pro  |

## Key ability examples

### maxi/create-coupon

Create a new discount coupon. Choose from three discount types, set an optional expiry date, and cap total usage or usage per customer.

```json theme={null}
{
  "code": "SUMMER20",
  "discount_type": "percent",
  "amount": "20",
  "expiry_date": "2025-08-31",
  "usage_limit": 100
}
```

Supported discount types:

| Type            | Behavior                                 |
| --------------- | ---------------------------------------- |
| `percent`       | Percentage off the cart or product total |
| `fixed_cart`    | Fixed amount off the entire cart         |
| `fixed_product` | Fixed amount off each qualifying product |

<Tip>
  Coupon codes are case-insensitive in WooCommerce. The code you pass in `create-coupon` is stored as-is, but customers can enter it in any case at checkout.
</Tip>

### maxi/get-coupon

Retrieve a coupon by its numeric ID or by its coupon code. The response includes usage statistics — how many times the coupon has been used (`usage_count`) and the list of customer user IDs or email addresses who used it (`used_by`).

```json theme={null}
{ "code": "SUMMER20" }
```

### maxi/update-coupon

Update any coupon field. Send only the fields you want to change — omitted fields remain untouched.

```json theme={null}
{
  "coupon_id": 789,
  "amount": "25",
  "expiry_date": "2025-09-30"
}
```

### maxi/delete-coupon

Delete a coupon permanently by its numeric ID. This cannot be undone.

<Warning>
  `maxi/delete-coupon` removes the coupon and all associated data permanently. If you want to prevent further use without losing the record, update the coupon's `expiry_date` to a past date or set `usage_limit` to match the current `usage_count` instead of deleting.
</Warning>

### maxi/list-coupons

List all coupons on your store, with optional filters and pagination.

```json theme={null}
{ "per_page": 20, "page": 1 }
```

<Tip>
  All `list-*` abilities accept `orderby`, `order`, `per_page`, and `page`. See [listing conventions](/abilities/overview#listing-conventions) for the full reference.
</Tip>
