#gabriele-frattini_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1235592979356323973
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- gabriele-frattini_docs, 6 days ago, 40 messages
Hello there
I'm happy to help but I can't re-read a 40 comment thread -- I'm helping multiple folks at once.
So you'll need to summarize your issue for me
Aha okay of course.
We have a coupon with a fixed duration of 12 months that is applied on a subscription. The subscription is a fixed-12 months plan, so the user commits for 12 months.
After 12 months:
- If the user chooses to not renew, the discount is removed which is what we want.
- if the user does renew, we make a subscription update in our backend with the "discounts" property as one of the params (With the same coupon). However we have noticed that the users are billed the original price, so they don't get the discount. Which we want
When does the user choose to renew or not?
After 12 months we give them that option
So they come on-session and decide?
What is on-session?
Like they are on your website?
Yes, we have a "Renew for another 12 months button". Sends an API call to our backend which updates the "discounts" parameter (with the same coupon id as they had before)
Okay but that doesn't happen until after the 12 months has passed, correct?
As in the new Invoice has already been created/finalized ?
Correct
Let me check
It happens after invoice nr 12 yes
So invoice 13 (The first in the new 12 month cycle) should have the discount, but does not
Can you provide a subscription id where this happened?
sub_1MxFtfILgSZ3iaDEVRIFy18X
Ok so if a coupon has a fixed duration, it will only be applied that many times on a subscription. You already applied that coupon once to sub_1MxFtfILgSZ3iaDEVRIFy18X. It has a fixed duration of 12 months.
Really if you need a coupon to apply for an indeterminate number of months, you should use a coupon with a duration of forever
And you can just remove it whenever you don't want it to apply
But if you use one with a fixed duration, it will only apply for that duration
Yes i have thought this also. But its hard to just change coupons for active subscriptions right?
No you can do that
In the stripe dashboard?
Oh not sure. We're not really dashboard experts in here. We mostly answer api integration questions
I'm sure you can though
Recommend testing it out in test mode
I see, anyway i can see that you can update a subscription in the dashboard, but we have thousands of active subscriptions so it's not an option
I think we are stuck with this coupon id
and thus the fixed duration of 12 months
Well you could write a script to update the subscriptions
Doesn't have to be a manual process
If we wanted, would it be possible for you to change the duration to forever in this coupon, in your database?
No I don't have that ability
What do you think of this approach:
Cancel the subscription and create a new one after 12 months. That should work?
A new coupon with the same discount percentage?
Yeah
with a duration of forever
That way you can apply it for however long you want
And remove it whenever you don't want it to apply
Yes its very true, and for all other subscriptions that use the 12 months coupon, we can still remove it, we just do it before stripe does it
Its a good solution i think
Yeah you can update it whenever you want via a script or something