#Stealth
1 messages · Page 1 of 1 (latest)
Hi there!
Can you clarify your question? What were you expecting to see on this subscription?
I was expecting that once threshold is reached invoice will be finalized and sent to the customer. But there is only pending invoice created.
So I have to manually trigger "invoice now" in order to send invoice.
This is the customer cus_MqxSlb909Pk6Go
It looks like this subscription has $0 in metered usage for now, so the $50 threshold hasn't been reached yet.
Does meter reset when pending invoice is created?
When I update subscription threshold is reached. New pending invoice item is created. And that is okay. But it is not automatically finalized.
Can you share the request ID where you increase the metered usage of this subscription?
evt_1M97BYGpJlO3RAQZfnkmArEh
Hi there 👋 I'm jumping in to lend a hand, please bear with me a moment while I catch up on the context here.
Actually Stripe finalize the Invoice after 1 hour:
https://stripe.com/docs/billing/invoices/subscription#:~:text=Stripe finalizes and sends the invoice in 1 hour
Hmm. I tested this before and itwas not finalized. It is finalized within 1 hour when threshold is not used. I can wait 1h to see if that will happen but if I remember from my previous tests it did not happen.
If you want you can use Stripe Test Clock in order to advance time and do some simulation:
https://stripe.com/docs/billing/testing/test-clocks
Thanks. I will look into it. in_1M96qQGpJlO3RAQZ15cZR29H this is invoice I had to manually finalize. Same scenario as this one. Changes where made on 23rd november and pending invoice was never automatically finalized
This invoice was created 45min ago and its finalization and payment was made 45min ago also
Correct. I created invoice by click onto "Invoice now" button. It should have been invoiced automatically on 23rd nov when changes were actually made
Between, you shared an event and an invoice of two different Subscription. I invite you to clean up your related test to this scenario and create a new one using test Clock and try to simulate it again by advancing the time
Also, the price you are using is an annual interval so the recorder items will remains pending until the end of the current period
Yes. I would like to invoice them immediately after the threshold has been reached. without resetting billing period.
Can I combine BillingThreshold and PendingInvoiceItemInterval?
You have set the billing_thresholds.reset_billing_cycle_anchor to false on this subscription sub_1M7FuiGpJlO3RAQZguX1r8j8 which will lead to not resetting the billing period for sure.
https://stripe.com/docs/api/subscriptions/create#create_subscription-billing_thresholds-reset_billing_cycle_anchor
Not sure I'm following here sorry, is there a specific use case you're trying to account for?
I have annual subscriptions. Let's say user paid for 10 units. After a while user adds another 3 units. Those 3 new units would be charged at the new billing cycle (after 1 year). I would like to charge these additional 3 units immediately without waiting 1 year.
Thanks for the explanation. You can't achieve this automatically AFAIK. You need to create (if the invoice is still upcoming) inalize the invoice by calling Stripe API, before waiting the end of the period
https://stripe.com/docs/api/invoices/create
https://stripe.com/docs/api/invoices/finalize
Here how to retrieve the upcoming invoices:
https://stripe.com/docs/api/invoices/upcoming
I see. What about PendingInvoiceItemInterval? Would that work? Description "Specifies an interval for how often to bill for any pending invoice items."
It seems like this is exactly what I need. Bill pending invoice items.
Hey. os4m37 had to step out but I am catching up here and can help out in a minute.
I think that param may be what you are looking for but I am not that familiar with how it works. If you already have a test clock test set up, can you try running your test again but with setting that interval to daily?
One moment. Does test clock advance freezes in time? Or it starts ticking from new time onwards? Like If advance time to 29th Nov at 14:22... Will it stay there forever or it will reach 14:23 after a minute, and so on.
Just figured it out. Freezes. I tested PendingInvoiceItemInterval and it does exactly what I need.
Great to hear! Good job figuring those out
Thanks for the help.
Of course, always happy to help