#mathieu ducrot - billing cycle anchor
1 messages · Page 1 of 1 (latest)
What exactly is your end goal with this, to set a particular renewal day?
I want to do webhook testing on the invoice.created when the subscription has renewal cycle
And since i have a daily recurrent price i must wait one day for the upcoming invoice to be created
and so i was wondering if updating this billing_cycle_anchor could help ?
ah, yes
The best way to do this is actually by using trial_end={timestamp a few seconds or minutes away}
Using a short trial like this is one way to move the billing cycle anchor. You can't move it to the past, but you can effectively move it to the near future.
then when that short trial ends, the cycle flow will happen and you'll get the invoice created wehbook
note that the invoice will remain in draft for 1hr before finalizing to take payment. You can accelerate this if you explicitly finalize it in your webhook handler.
does is it actually work if the subscription doesn't have a trial period in first place ?
does what work?
using the trial_end option to manipulate the billing_cycle_anchor time ?
Ah, yes
Setting trial_end in an update puts the subscription in trial mode if it isnt already, and sets the time for that to end
It is one of the ways we recommend to adjust existing billing cycles:
https://stripe.com/docs/billing/subscriptions/billing-cycle#using-a-trial-to-change-the-billing-cycle
Note you likely also want to disable prorations for this to avoid issuing credit for the unused time paid by the previous invoice
oh ok i'll try that, thanks for the info !
NP!