Update Coupon
Updates an existing coupon's amount, expiry, restrictions, and usage limits. Provide the coupon ID and at least one field to change.
Also known as: change a discount, extend a coupon expiry.
| Property | Value |
|---|---|
| Ability slug | mosmcp/update-coupon |
| Wire tool name | mosmcp__update-coupon |
| Category | WooCommerce (mosmcp-woocommerce) |
| Plan | Free |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_shop_coupons |
| Minimum default role | Shop manager |
| Requires | WooCommerce |
| Annotations | readOnly: false · destructive: true · idempotent: true · openWorld: false |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| id | integer | Yes | — | The coupon ID to update (required). |
| code | string | — | New coupon code. | |
| amount | string | — | New discount amount. | |
| discount_type | string (one of percent, fixed_cart, fixed_product) |
percent |
The discount type. Defaults to percent. | |
| description | string | — | Coupon description. | |
| date_expires | string | — | Expiry date (YYYY-MM-DD). Pass an empty string to clear it. | |
| individual_use | boolean | — | Whether this coupon can be combined with other coupons. | |
| product_ids | integer[] | — | Product IDs this coupon is restricted to. Replaces the existing set entirely; pass an empty array to remove the restriction. | |
| excluded_product_ids | integer[] | — | Product IDs this coupon cannot be used on. Replaces the existing set entirely. | |
| usage_limit | integer | — | Maximum number of times the coupon can be used in total. | |
| usage_limit_per_user | integer | — | Maximum number of times a single customer can use the coupon. | |
| limit_usage_to_x_items | integer | — | Maximum number of items in the cart the coupon applies to. | |
| free_shipping | boolean | — | Whether this coupon grants free shipping. | |
| product_categories | integer[] | — | Category IDs this coupon applies to. Replaces the existing set entirely. | |
| excluded_product_categories | integer[] | — | Category IDs this coupon does not apply to. Replaces the existing set entirely. | |
| exclude_sale_items | boolean | — | Whether this coupon is withheld from items already on sale. | |
| minimum_amount | string | — | Minimum cart subtotal required for this coupon to apply. | |
| maximum_amount | string | — | Maximum cart subtotal this coupon can apply to. | |
| email_restrictions | string[] | — | Email addresses (wildcards allowed, e.g. *@example.com) allowed to use this coupon. Replaces the existing set entirely. |
Output schema
| Field | Type | Required |
|---|---|---|
| success | boolean | |
| message | string | |
| data | object | |
| data.id | integer | |
| data.code | string | |
| data.amount | string | |
| data.date_created | string \| null | |
| data.date_modified | string \| null | |
| data.discount_type | string | |
| data.description | string | |
| data.date_expires | string \| null | |
| data.usage_count | integer | |
| data.individual_use | boolean | |
| data.product_ids | integer[] | |
| data.excluded_product_ids | integer[] | |
| data.usage_limit | integer \| null | |
| data.usage_limit_per_user | integer \| null | |
| data.limit_usage_to_x_items | integer \| null | |
| data.free_shipping | boolean | |
| data.product_categories | integer[] | |
| data.excluded_product_categories | integer[] | |
| data.exclude_sale_items | boolean | |
| data.minimum_amount | string | |
| data.maximum_amount | string | |
| data.email_restrictions | string[] | |
| data.used_by | string[] | |
| meta | object | |
| meta.ability | string | |
| meta.timestamp | string | |
| meta.execution_time | string \| null |
Example
Sample prompt
Extend coupon 210 so it expires at the end of November instead.
Example request (json)
{
"jsonrpc": "2.0",
"id": 387,
"method": "tools/call",
"params": {
"name": "mosmcp__update-coupon",
"arguments": {
"input": {
"id": 210,
"date_expires": "2026-11-30"
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 387,
"result": {
"isError": false,
"structuredContent": {
"success": true,
"message": "Coupon updated.",
"data": {
"id": 210,
"code": "autumn15",
"amount": "15",
"date_created": "2026-09-01T08:00:00",
"date_modified": "2026-09-01T08:00:00",
"discount_type": "percent",
"description": "Autumn sale - 15% off",
"date_expires": "2026-11-30T00:00:00",
"usage_count": 23,
"individual_use": true,
"product_ids": [],
"excluded_product_ids": [],
"usage_limit": 200,
"usage_limit_per_user": 1,
"limit_usage_to_x_items": null,
"free_shipping": false,
"product_categories": [],
"excluded_product_categories": [],
"exclude_sale_items": true,
"minimum_amount": "30.00",
"maximum_amount": "",
"email_restrictions": [],
"used_by": [
"57",
"jane@example.com"
]
},
"meta": {
"ability": "mosmcp/update-coupon",
"timestamp": "2026-09-29T10:15:00+00:00",
"execution_time": "18.4ms"
}
}
}
}
Edge cases / errors
- Only id supplied → wcab_nothing_to_update; unknown coupon → wcab_coupon_not_found; no edit rights → wcab_cannot_edit.
- Changing code to one used by another coupon → wcab_coupon_exists; empty code → wcab_missing_code.
- date_expires "" removes the expiry; array fields like product_ids replace the existing list.
- discount_type is only changed when you pass it, despite the schema default.
| << Previous | Next >> |
|---|---|
| Top Sellers Report | Update Customer |
For more information about the Secure MCP Server for WordPress plugin, explore the following resources:
Product Overview | Pricing | Try for Free | Documentation
If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.