#mathieu ducrot - billing cycle anchor

1 messages · Page 1 of 1 (latest)

stray moss
stray moss
#

What exactly is your end goal with this, to set a particular renewal day?

dusk lichen
#

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 ?

stray moss
#

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.

dusk lichen
#

does is it actually work if the subscription doesn't have a trial period in first place ?

stray moss
#

does what work?

dusk lichen
#

using the trial_end option to manipulate the billing_cycle_anchor time ?

stray moss
#

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

#

Note you likely also want to disable prorations for this to avoid issuing credit for the unused time paid by the previous invoice

dusk lichen
#

oh ok i'll try that, thanks for the info !

stray moss
#

NP!