Get Coupon
Gets a single WooCommerce coupon by ID, including its restrictions and usage limits.
Also known as: coupon details, discount code details.
| Property | Value |
|---|---|
| Ability slug | mosmcp/get-coupon |
| Wire tool name | mosmcp__get-coupon |
| Category | WooCommerce (mosmcp-woocommerce) |
| Plan | Free |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_shop_coupons |
| Minimum default role | Shop manager |
| Requires | WooCommerce |
| Annotations | readOnly: true · destructive: false · idempotent: true · openWorld: false |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| id | integer | Yes | — | The coupon ID (required). |
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
What are the restrictions on coupon 210?
Example request (json)
{
"jsonrpc": "2.0",
"id": 366,
"method": "tools/call",
"params": {
"name": "mosmcp__get-coupon",
"arguments": {
"input": {
"id": 210
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 366,
"result": {
"isError": false,
"structuredContent": {
"success": true,
"message": "Coupon retrieved.",
"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-10-31T00: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/get-coupon",
"timestamp": "2026-09-29T10:15:00+00:00",
"execution_time": "18.4ms"
}
}
}
}
Edge cases / errors
- id missing or not positive → wcab_invalid_id.
- ID doesn't exist or isn't a coupon → wcab_coupon_not_found.
- usage_limit/usage_limit_per_user are null when unlimited; used_by lists user IDs or emails of past redeemers.
| << Previous | Next >> |
|---|---|
| Delete Product Category | Get 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.