#Eranga-Coupon
1 messages · Page 1 of 1 (latest)
{ "id": "TkzreARG", "object": "coupon", "amount_off": null, "created": 1662597441, "currency": null, "duration": "forever", "duration_in_months": null, "livemode": true, "max_redemptions": null, "metadata": {}, "name": "2022STAS-10%", "percent_off": 10.0, "redeem_by": 1672502340, "times_redeemed": 1, "valid": true }
This is the entire object for the coupon
The expiration is shown by redeem_by property
@lunar rune Are you still here?
Thanks for waiting.
redeem_by is not an expiration date. redeem_by indicates the date after which the coupon can no longer be applied to a customer.
So if your customer has already redeemed the coupon, this customer can enjoy the discount throughout the coupon's duration, even after the redeem_by date.
Cool
So if the duration is forever, if they have already redeemed the coupon and they continue the same subscription, they will enjoy the coupon
Yes you are right
Got it. Thank you so much for the help Jack
Welcome!
you mean duration_in_months ?
I think so.
If I apply the coupon to a yearly subscription, but the duration_in_monts: 4, what would happen?
https://stripe.com/docs/api/coupons/object?lang=node#coupon_object-duration_in_months The API reference has the detailed explanation
If duration is repeating, the number of months the coupon applies. Null if coupon duration is forever or once.
So if I apply it to a yearly subscription, it will still discount for 4 months? The next 8 months it will not apply the discount
No, it doesn't work this way.
One sec, let me check something.
OK, so if the subscription is yearly and you set duration_in_months to 4. Only the first invoice will be applied with the discount, and the next invoice, which will be generated in next year (> 4 months) won't be applied with this discount.
So, the discount (let's say 10%), will be deducted from the total amount they owe us for the year
If they owe us 1000$ for the yearly subscription, this will still reduce 100$ from them?
Yes, 10% from the first invoice.
Great, that is super helpful to clear out my doubts
Thanks again
That is all for now @lunar rune . Have a great day 🎉
Welcome!