#gabriele-frattini_api

1 messages ¡ Page 1 of 1 (latest)

winged wadiBOT
#

👋 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.

blazing turretBOT
#

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.

buoyant sable
#

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

crude juniper
#

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
buoyant sable
#

When does the user choose to renew or not?

crude juniper
#

After 12 months we give them that option

buoyant sable
#

So they come on-session and decide?

crude juniper
#

What is on-session?

blazing turretBOT
buoyant sable
#

Like they are on your website?

crude juniper
#

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)

buoyant sable
#

Okay but that doesn't happen until after the 12 months has passed, correct?

#

As in the new Invoice has already been created/finalized ?

crude juniper
#

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

random badge
#

Can you provide a subscription id where this happened?

crude juniper
#

sub_1MxFtfILgSZ3iaDEVRIFy18X

random badge
#

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

crude juniper
#

Yes i have thought this also. But its hard to just change coupons for active subscriptions right?

random badge
#

No you can do that

crude juniper
#

In the stripe dashboard?

random badge
#

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

crude juniper
#

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

random badge
#

Well you could write a script to update the subscriptions

#

Doesn't have to be a manual process

crude juniper
#

If we wanted, would it be possible for you to change the duration to forever in this coupon, in your database?

random badge
#

No I don't have that ability

crude juniper
#

What do you think of this approach:
Cancel the subscription and create a new one after 12 months. That should work?

random badge
#

You could do that

#

But why not just update the sub with a new coupon?

#

via the api

crude juniper
#

A new coupon with the same discount percentage?

random badge
#

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

crude juniper
#

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

random badge
#

Yeah you can update it whenever you want via a script or something

crude juniper
#

Yes

#

Thank you