Apply coupon
Add a coupon to a subscription.
POST https://cotlet.dev/api/v1/chargebee/subscriptions/{subscription_id}/coupon/apply
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. |
Request
curl -X POST https://cotlet.dev/api/v1/chargebee/subscriptions/subscription_8c41d2/coupon/apply \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"coupon":"coupon"}' result = client.call("chargebee", "apply_coupon", {"subscription_id":"subscription_8c41d2","coupon":"coupon"}) const result = await cotlet.call('chargebee', 'apply_coupon', {"subscription_id":"subscription_8c41d2","coupon":"coupon"}); cotlet call chargebee apply_coupon --data '{"subscription_id":"subscription_8c41d2","coupon":"coupon"}' Example response
{
"subscription_id": "sub_9s2kQw",
"coupons": [
{
"coupon_id": "SAVE20"
}
]
}