Apply coupon

Add a coupon to a subscription.

POST https://cotlet.dev/api/v1/chargebee/subscriptions/{subscription_id}/coupon/apply

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

Parameters: apply_coupon
NameTypeDescription
subscription_id string required string Subscription ID from list_subscriptions.
coupon string required string Coupon ID or coupon code, for example SAVE20.

Request

cURL
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"}'
Python
result = client.call("chargebee", "apply_coupon", {"subscription_id":"subscription_8c41d2","coupon":"coupon"})
Node.js
const result = await cotlet.call('chargebee', 'apply_coupon', {"subscription_id":"subscription_8c41d2","coupon":"coupon"});
CLI
cotlet call chargebee apply_coupon --data '{"subscription_id":"subscription_8c41d2","coupon":"coupon"}'

Example response

JSON

{
  "subscription_id": "sub_9s2kQw",
  "coupons": [
    {
      "coupon_id": "SAVE20"
    }
  ]
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.