Apply coupon
Add a coupon to a subscription.
MCP tool chargebee_write → apply_coupon
write Confirm
Adds the coupon to the subscription's existing coupons and returns the full list. Chargebee lists only coupons that apply to the subscription's plan, and by default allows one fixed and one percentage coupon per subscription. A coupon can be added at any point in the billing cycle. It changes what the customer pays on later invoices, so by default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| subscription_id string required | string | Subscription ID from list_subscriptions. |
| coupon string required | string | Coupon ID or coupon code, for example SAVE20. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "chargebee_write",
"arguments": {
"operation": "apply_coupon",
"arguments": {
"subscription_id": "subscription_8c41d2",
"coupon": "coupon"
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"subscription_id": "sub_9s2kQw",
"coupons": [
{
"coupon_id": "SAVE20"
}
]
},
"isError": false
}