#rohail-kamran_api

1 messages ¡ Page 1 of 1 (latest)

cerulean stoneBOT
#

👋 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/1319268771420176385

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

patent belfry
#

Hi, let me help you with this.

rose dirge
#

Aoa, Hi! Thanks!

patent belfry
#

By default, Stripe Subscriptions renew automatically at the end of each period.
What are you doing exactly to prevent Subscriptions from renewing?

rose dirge
#

I am doing:

    const subscription = await stripe.subscriptions.update(
      subscriptionId,
      {
        cancel_at_period_end:true
      }
    );
patent belfry
#

So, in this case:

  • before period_end happens - you can just update this property to false. The Subscription renewal will happen on the same date as usual.
  • after period_end happens - the Subscription is cancelled and you need to create a new Subscription starting from now.
rose dirge
#

I am confused....

#

So let's say I a product that is a 1 month subscription

#

I subscribe to that today

#

So my subscription will be valid from Dec 19 (today) to Jan 19 (next month)

cerulean stoneBOT
rose dirge
#

By default, stripe will automatically renew my subscription on the 19th of January, but if I don't want my subscription to automatically renew, I simply do the following:

const subscription = await stripe.subscriptions.update(
      subscriptionId,
      {
        cancel_at_period_end:true
      }
    );
#

Am I correct so far?

patent belfry
#

Yes.
Please note, when you do that ☝️ your Subscription is still active until Jan 19, since you already paid for the whole month. After that it will be cancelled and unrecoverable.

rose dirge
#

Okay makes sense

#

but here is what I want to do

#

I cancel my subscription on the 25th of december

#

It's going to stay valid till 19th January still, but it won't auto renew

#

What if I want to manually renew on the 10th of January for the period of 19th January to 19th February. How is that possible? Does stripe provide a way?

elder pewter
#

hi! I'm taking over this thread.

rose dirge
#

Aoa, Hi @elder pewter! Okay

elder pewter
#

What if I want to manually renew on the 10th of January for the period of 19th January to 19th February. How is that possible? Does stripe provide a way?
You mean after you set cancel_at_period_end, the customer changed their mind, and want to keep the Subscription?

rose dirge
#

yes. They just don't want it to automatically renew, but they still want to be able to manually renew it before it expires.

elder pewter
#

you can update the subscription to unset cancel_at_period_end. this way the Subscription will renew at the end of the month.

rose dirge
#

Okayy.... that makes sense. But what if they want to only be able to renew manually everytime.

elder pewter
#

I'm not sure I understand what that means

rose dirge
#

I mean... they manually renew for the period of 19th Jan to 19th Feb

#

they want the default to be that they always have to manually renew and never is it automatically renewed?

#

Is there a way to do that?

elder pewter
#

that's something you can do with code yes. set cancel_at_period_end: true at every period by default. but let customers override that parameter.

rose dirge
#

Is it possible to hop on a discord call? I think this is a bit hard to explain.

elder pewter
#

no, sorry, we only help by written chat here

#

feel free to describe in more details your question here

rose dirge
#

I see! That's understandable.

#

I am discussing what you have suggested with the stakeholders of the project. If they like the solution as is, then there won't be need for more complexity (I hope lol)

#

Thanks a ton for your help!