#Jonah Librach
1 messages · Page 1 of 1 (latest)
Good question, can you tell me why you are looking to reset the anchor each time?
I am looking in to how to do this but there may also be an easier way to acheive that
I think I figured it out...
I just need to set the billing anchor to when the period ends.
But the reason is because I want them to get billed 30 days after their payment went through.
So resetting each time accounts for the case that their payment fails
Nope, that didn't work. Seems like adding a trial is the way to go
If you want to do this on only the initial payment you can also check if the billing_reason on the invoice is subscription_create or subscription_cycle https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
subscription_create will only be the first invoice, subscription_create will be the invoices after
And subscription_update will be from things like changing the billing cycle anchor I believe
No, I want to do this for everything after the first payment
Gotcha, same billing reasons should apply. So you may be able to use billing_reason to run the original logic that you were planning. Though if you don't want that to send an invoice as well, you may want to make sure you are specifying proration_behavior="none" in your update calls
So if I do proration_behavior=none then it will send the invoice after the end of the new period?
Lol that didn't work for billing_cycle_anchor
This is really frustrating, it's been 3 days working on this overall issue of failed payments
proration_behavior="create_prorations" should do that