#rohail-kamran_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/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.
- rohail-kamran_api, 1 day ago, 5 messages
Hi, let me help you with this.
Aoa, Hi! Thanks!
By default, Stripe Subscriptions renew automatically at the end of each period.
What are you doing exactly to prevent Subscriptions from renewing?
I am doing:
const subscription = await stripe.subscriptions.update(
subscriptionId,
{
cancel_at_period_end:true
}
);
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.
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)
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?
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.
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?
hi! I'm taking over this thread.
Aoa, Hi @elder pewter! Okay
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 setcancel_at_period_end, the customer changed their mind, and want to keep the Subscription?
yes. They just don't want it to automatically renew, but they still want to be able to manually renew it before it expires.
you can update the subscription to unset cancel_at_period_end. this way the Subscription will renew at the end of the month.
Okayy.... that makes sense. But what if they want to only be able to renew manually everytime.
I'm not sure I understand what that means
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?
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.
Is it possible to hop on a discord call? I think this is a bit hard to explain.