#nihilist_subscription-events
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. Thank you for your patience!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.
๐ 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/1214598606192119858
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
Hi ๐ you will need to adjust the billing_cycle_anchor for that. When you were testing this approach, did you try setting proration_behavior to none when updating the Subscription and setting the billing_cycle_anchor?
yes, i set proration_behavior to none and it charges the user again for the full price of the period
for more information i update the subscription using these params {billing_cycle_anchor:'now', proration_behavior:'none'}, i tried entering an exact date instead of 'now' but i dont think Stripe support that
Ah, that's right. now isn't what you want, because you want to set the anchor to a year from now.
The only way to change the billing cycle anchor for an existing Subscription is to add a trial period to it that ends when you want the Subscription to cycle to the next billing period:
https://docs.stripe.com/billing/subscriptions/billing-cycle?dashboard-or-api=api#add-a-trial-to-change-the-billing-cycle
yeah i guess the best option here is to update subscription with {trial_end: (2025-03-06).to_unix, proration_behavior: 'none'}. So how to update the subscription to trial only when the subscription was in past_due state when the invoice is paid? I can retrieve subscription from invoice object from invoice.paid event but i think the subscription.status might be already changed to active ?
You can watch for customer.subscription.updated Events, where you see the status changing from past_due to active, and then trigger the billing cycle anchor update from that.
This makes sense, thanks for the answer. But out of curiosity which event is triggered first when automatic renewal is successful: invoice.paid or customer.subscription.updated
It doesn't matter, you should never rely on receiving Events in a specific order, they could get mixed up as they move from our system to yours.