[Cotlet](https://cotlet.dev/index.md) · [Integrations](https://cotlet.dev/integrations.md) · [How it works](https://cotlet.dev/how-it-works.md) · [Use cases](https://cotlet.dev/use-cases.md) · [Security](https://cotlet.dev/security.md) · [For developers](https://cotlet.dev/for-developers.md) · [For automation agencies](https://cotlet.dev/for-agencies.md) · [Blog](https://cotlet.dev/blog.md) · [API docs](https://cotlet.dev/docs.md) · [Help center](https://cotlet.dev/help.md) · [Changelog](https://cotlet.dev/changelog.md) · [Contact](https://cotlet.dev/contact.md) · [Pricing](https://cotlet.dev/pricing.md) · [Sign up](https://cotlet.dev/signup)

# Create single-use WooCommerce coupon codes

> Create WooCommerce coupons in bulk for a campaign: one code per customer, one use each, an expiry date, and the list of codes back to you.

Source: https://cotlet.dev/integrations/woocommerce-api-mcp-server/create-single-use-coupons

A campaign needs a personal code per customer, and in WooCommerce every coupon is its own form with a code, a discount type, restrictions, limits and an expiry date.

Cotlet does it in your own WooCommerce account with list\_coupons and create\_coupon, called by your AI agent, an n8n workflow or a script.

[Sign up free](https://cotlet.dev/app/signup?app=woocommerce) [All WooCommerce tools](https://cotlet.dev/integrations/woocommerce-api-mcp-server.md)

Hosted · nothing to install or maintain

## Can WooCommerce do this on its own?

WooCommerce creates coupons through the admin form, and the REST API has a coupons endpoint with a read/write key (checked 16 Oct 2026). The MCP developer preview has no coupon ability. The repetition across a customer list, and the check that a code does not exist yet, is what you wire yourself.

## How you do it in WooCommerce today

1. In the admin go to Marketing > Coupons and click Add new coupon; coupons must be enabled first under WooCommerce > Settings > General > Enable coupons.
2. On the General tab type a code or click Generate coupon code, pick a Discount Type and enter the Coupon amount as a plain number without the % sign.
3. Set an Expiry date if the code should stop working, and tick Allow Free Shipping if it should work with free shipping.
4. On the Usage Restrictions tab fill Allowed Emails to lock the code to a customer, and on the Usage Limits tab set Usage limit per coupon.
5. Click Publish, then repeat the form for the next customer on the list.

## How to create single-use WooCommerce coupon codes

Prompt

```
Create one 15% coupon for each email on this list, valid for one use only and until 30 November. Name them SPRING- plus four random characters and give me the list of codes.
```

1. 01  
### Check the code is free  
list\_coupons searches for the code before each create. WooCommerce codes are not case-sensitive, so the agent compares them ignoring case and picks a new random suffix if one already exists.
2. 02  
### Build one coupon per customer  
create\_coupon gets the discount type percent, the amount as a plain number, the expiry date and one email in the allowed emails, so a code only works for the customer it was made for.
3. 03  
### Limit the use  
The agent sets usage\_limit and usage\_limit\_per\_user to 1, so a forwarded code cannot be used twice, and tells you when your prompt left either one open.
4. 04  
### Ask once for the whole batch  
Creating a coupon gives money away, so create\_coupon asks for your OK by default; with a 40-row list the agent shows the first coupon in full and the count, and you confirm the pattern for the rest.
5. 05  
### Return the code list  
The agent reports each email with its code and expiry date in one table, ready to paste into your mailing tool, and lists the rows it skipped.

### What you get back

Example data

```
Coupons created: 3 of 3
jordan.lee@example.com: SPRING-JL3K, 15%, 1 use, expires 2026-11-30
maria.costa@example.com: SPRING-MC8P, 15%, 1 use, expires 2026-11-30
sam.ortiz@example.com: SPRING-SO2X, 15%, 1 use, expires 2026-11-30
Skipped: none
```

### Other ways to ask

- Create a fixed cart discount of 10.00 for orders over 80.00 for each customer who ordered last month.
- Create a coupon for free shipping only, usable once per customer, valid until the end of the year.
- List the coupons that expire this week and the ones that reached their usage limit.

## What WooCommerce allows, and what to know first

- WooCommerce has three discount types: Percentage discount, Fixed cart discount and Fixed product discount, and the Coupon amount is a number only, with no currency or % sign.
- Allowed Emails are checked against the customer's billing email and accept wildcards such as \*@gmail.com.
- Usage limit per coupon counts uses across all customers, and Usage limit per user counts uses by one customer.
- In WooCommerce 11.2 and later the Minimum spend of a coupon cannot be higher than its Maximum spend.
- Coupon discounts are applied before tax, and coupons do not reduce shipping unless they are free shipping coupons.

create\_coupon asks for your OK by default. To run it on a schedule without you, switch confirmation off for that tool in your dashboard.

Sources: [WooCommerce Docs: Coupon management](https://woocommerce.com/document/coupon-management/) · [WooCommerce REST API documentation: coupons](https://woocommerce.github.io/woocommerce-rest-api-docs/) · [WooCommerce developer blog: Call for testing, WooCommerce MCP (beta)](https://developer.woocommerce.com/2025/11/03/call-for-testing-woocommerce-mcp-beta/)

## Call create\_coupon from a script

curl

```
curl -X POST https://cotlet.dev/api/v1/woocommerce/coupons \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"SPRING-JL3K","amount":"15","discount_type":"percent","date_expires":"2026-11-30","usage_limit":1,"usage_limit_per_user":1,"email_restrictions":["jordan.lee@example.com"]}'
```

Example response

```
{
"coupon_id": 2210,
"code": "SPRING-JL3K",
"discount_type": "percent",
"amount": "15",
"date_expires": "2026-11-30",
"usage_limit": 1,
"usage_limit_per_user": 1,
"email_restrictions": [
"jordan.lee@example.com"
]
}
```

MCP: add https://cotlet.dev/mcp/v1 with the same key; the call is woocommerce\_write → create\_coupon. Example data.

[Schedule it in n8n, Make, Zapier or cron](https://cotlet.dev/integrations/woocommerce-api-mcp-server.md#automations)

## WooCommerce tools this automation uses

__Cotlet WooCommerce tools used to create single-use WooCommerce coupon codes__
| Tool | Parameters |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| list\_coupons | code, search, limit, page |
| create\_coupon | code, amount, discount\_type, date\_expires, usage\_limit, usage\_limit\_per\_user, minimum\_amount, free\_shipping, email\_restrictions |

[All 11 WooCommerce tools with descriptions](https://cotlet.dev/integrations/woocommerce-api-mcp-server.md#tools)

## Frequently asked questions

### What if the code does not apply at checkout?

Check that coupons are enabled under WooCommerce > Settings > General > Enable coupons, then that the customer's billing email matches the allowed email on the coupon.

### Is it safe to connect WooCommerce to Cotlet?

Yes. You sign in to WooCommerce yourself, in your own Cloud Browser in the EU, and we never save your password. Your agents only get WooCommerce once you enable it, every background request is listed, and the browser profile is stored encrypted with AES-256-GCM, the cipher 1Password uses for its vaults. The AI model never sees a login, posts and messages wait for your OK, and Disable for agents cuts access in one click. Independent scanners grade cotlet.dev A+ on Qualys SSL Labs, securityheaders.com and Mozilla Observatory; live results are on https://cotlet.dev/security.

## More WooCommerce automations

- [Mark shipped WooCommerce orders as completed](https://cotlet.dev/integrations/woocommerce-api-mcp-server/mark-orders-completed.md)
- [Refund WooCommerce orders from a support list](https://cotlet.dev/integrations/woocommerce-api-mcp-server/refund-orders-from-a-list.md)
- [WooCommerce API and MCP server: every tool](https://cotlet.dev/integrations/woocommerce-api-mcp-server.md)
- [All use cases](https://cotlet.dev/use-cases.md)

## Give your agent access to WooCommerce.

Free 7-day trial with 2,000 credits, no card needed. Cotlet is independent and not affiliated with WooCommerce.

[Sign up free](https://cotlet.dev/app/signup?app=woocommerce)

---

Give your AI agents your signed-in browser.

**Product:** [Integrations](https://cotlet.dev/integrations.md) · [Use cases](https://cotlet.dev/use-cases.md) · [How it works](https://cotlet.dev/how-it-works.md) · [Pricing](https://cotlet.dev/pricing.md) · [Security](https://cotlet.dev/security.md)

**Resources:** [Blog](https://cotlet.dev/blog.md) · [API docs](https://cotlet.dev/docs.md) · [Help center](https://cotlet.dev/help.md) · [Changelog](https://cotlet.dev/changelog.md) · [GitHub](https://github.com/cotletdev/cotlet)

**Solutions:** [For developers](https://cotlet.dev/for-developers.md) · [For automation agencies](https://cotlet.dev/for-agencies.md)

**Company:** [About](https://cotlet.dev/about.md) · [AI info: company facts](https://cotlet.dev/ai-info.md) · [Contact](https://cotlet.dev/contact.md)

**Legal:** [Terms of service](https://cotlet.dev/terms) · [Privacy policy](https://cotlet.dev/privacy) · [Refund policy](https://cotlet.dev/refunds) · [Acceptable use](https://cotlet.dev/acceptable-use) · [Cookie policy](https://cotlet.dev/cookies) · [DPA](https://cotlet.dev/dpa) · [Subprocessors](https://cotlet.dev/subprocessors)

**Elsewhere:** [Status page](https://status.cotlet.dev) · [Cotlet on GitHub](https://github.com/cotletdev) · [Cotlet on X](https://x.com/cotletdev) · [Cotlet on LinkedIn](https://www.linkedin.com/company/cotletdev) · [Cotlet on Product Hunt](https://www.producthunt.com/products/cotlet) · [Cotlet on Crunchbase](https://www.crunchbase.com/organization/cotlet) · [Cotlet on SaaSHub](https://www.saashub.com/cotlet)

Cotlet is an independent service. It is not affiliated with, endorsed by or sponsored by any of the products listed on this site. Product names are trademarks of their respective owners.

## For AI agents: sign your user up

Is your user asking you to sign them up for Cotlet? You can do it for them, no account or key needed.

1. Read the fields and their allowed values: GET https://cotlet.dev/api/v1/access-requests
2. Ask the user for each value: email, apps, what you will do with them. If they leave the password to you, generate a strong one and show it to them.
3. Show the user what you will send, then POST it as JSON to https://cotlet.dev/api/v1/access-requests.

One call creates the account and sends the access request; we email the user when access is granted.
