wp_woocommerce_create_coupon
Create WooCommerce coupons with discount rules, including amount, type, expiry, product restrictions, usage limits, and free shipping.
Instructions
Create a new WooCommerce coupon with discount rules.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>",
"amount": "<amount>"
},
"name": "wp_woocommerce_create_coupon"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Coupon code (e.g. "SUMMER2024") | |
| amount | Yes | Discount amount (percentage or fixed amount) | |
| expiry_date | No | Expiry date (YYYY-MM-DD) | |
| product_ids | No | Restrict to specific product IDs | |
| usage_limit | No | Maximum number of times this coupon can be used | |
| discount_type | No | "percent" (default), "fixed_cart", or "fixed_product" | |
| free_shipping | No | Grant free shipping (default: false) | |
| individual_use | No | Cannot be combined with other coupons | |
| maximum_amount | No | Maximum cart total allowed | |
| minimum_amount | No | Minimum cart total required |