I want to create a coupon code that I can share with my users, and I want to limit its usage such that only one user can get its discount and then the coupon should become invalid for other users.
To apply a coupon while calling the create a subscription API, you can pass the ID of the coupon using this parameter. Once the coupon ID is passed, the subscription's price would automatically be discounted and the invoice generated would reflect the same.
I hope this helps!
I have a concern regarding the coupon flow in the subscription as how we can apply coupon code while paying for the subscription via a Create subscription API. However, we are using chargebee APIs to create a new subscription and for the payments (Payment with stripe token and paypal agreement Id). Basically, Our query is that how coupon code will be added while subscribing or paying for the subscription to get the discount.
Use The Coupon Set Feature
Here's how you can do this:
1. Create a Parent Coupon
Create a Parent coupon from the Coupons tab under Product Config and configure the desired Discount, Validity and the Nomenclature.
2. Upload A Coupon Set
Under the Coupon Set tab, upload a host of Coupon Codes as a CSV file. Here's an example of how it could look like:
This way each Coupon Code in the CSV file mimics the parent coupon in functionality and also becomes invalid after single redemption.
Here's more reading material coupon codes functionality of ChargeBee: https://www.chargebee.com/docs/coupon_codes.html