#Gkiokan-subscription-coupon
1 messages · Page 1 of 1 (latest)
I have especially one problem with that.
A coupon, with a duration of 3 months for 100% discount doesn't work for yearly subscriptions. (reported already)
However, I am patching them before updating the subs.
The issue happens when I upgrdae from a monthly sub with coupon to a yearly sub
Which coupon on you using?
There was not any other easy solution to this. But this works only for initial subscriptions.
So I have each coupon duplicated
VISOFAMILY
I am talking expecially about this invoice here in_1LBnUoHa5WPIKK5IQdgTqtMx
It just overtakes the "old coupon". But as I said, even the coupon is setup as 3 months for 100% it does discounts* the yearly subscriptions with full 100% so I made this workaround
I could maybe get around this when I check for the coupon input. If nothing is provided I could try to add coupon => '' but not sure if this will work
So the duration on the coupon is set to 3, so that means it will apply to the next 3 Invoices generated on the subscription, which complicates things
it is set to 3 months, not 3 intervals
Ahhhhh, right
No worries about that
Still though. Same basic problem
It's getting applied regardless of the upgrade
correct
Is there a way to prevent it?
I mean it's fine for monthly subs, but if I swap to a yearly it screws up the whole invoice
I can confirm, setting coupon to a empty string deletes the whole coupon on sub update
Let's fix this other way arround
I guess I can check if the current sub has a coupon applied right? I could get that coupon and patch it to the right one and apply it to the update params
That makes sense. I think the approach here is what you're looking for: https://stripe.com/docs/billing/subscriptions/coupons#customize-expirations
Once Before the upgrade is created you can programmatically update the expires_at field on the Discount that gets generated from the Coupon to expire whenever.
Not sure if that implementation works for your use-case or not though
Intersting part, but doesn't fix the issue if the coupon should still work but just with other params
I am looking for the api to get the current discount stuff
Is a coupon bound to a customer itself or to the subscription?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I think I can dig though that now.
Thanks anyways for the help. Can be closed
Sure thing. Hope you have a good day!