Create coupon
Create a coupon with a discount type, amount, expiry date, usage limits and allowed emails.
MCP tool woocommerce_write → create_coupon
Creates one coupon. The code is required and not case-sensitive. discount_type is percent, fixed_cart or fixed_product, the default is fixed_cart, and amount is a number given as a string, also for percentages. Add date_expires, usage limits, a minimum or maximum spend, and email_restrictions to tie the code to customers. A coupon gives money off at checkout, so it is treated as reaching your customers. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| code string required | string | Coupon code. Not case-sensitive. |
| amount string required | string | Discount as a number, for example "15", also for percentages. |
| discount_type enum | enum | percent, fixed_cart or fixed_product. Default: fixed_cart. |
| date_expires date | date | Last day the coupon works, YYYY-MM-DD. |
| usage_limit integer | integer | Total uses across all customers. |
| usage_limit_per_user integer | integer | Uses allowed per customer. |
| minimum_amount string | string | Minimum spend for the coupon to apply. |
| free_shipping boolean | boolean | true makes the coupon work with free shipping. Default: false. |
| email_restrictions array | array | Billing emails allowed to use the coupon; wildcards such as *@gmail.com work. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "woocommerce_write",
"arguments": {
"operation": "create_coupon",
"arguments": {
"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
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"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"
]
},
"isError": false
}