#nstripe0_subscription-invoice-finalization

1 messages ยท Page 1 of 1 (latest)

astral glenBOT
#

๐Ÿ‘‹ 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.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— 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/1327027590199902208

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

foggy steppe
#

Hi there!

compact wraith
#

๐Ÿ‘‹ Hi palamedes!

foggy steppe
#

No, you can't control automatic advancement the Subscription level. You would have to do it at the Invoice level as the Invoices are created by the Subscription, but note that generally, the first Invoice of a Subscription is finalized immediately.

astral glenBOT
compact wraith
#

That's what I concluded at the moment, thanks for confirming that.

The concern I have is that if our system's webhook event processing fails or has an outage... we are unable to make modifications to invoices generated or do other important things such as calculate taxes on invoices for remittance.

So I was thinking of potentially making it such that Stripe can generate invoices, but must have positive confirmation (via API call) before the invoices are finalized and collected upon.

Do you have some advice about this concern you can share?

ember pagoda
#

Specifically, I think you are interested in this point

If Stripe fails to receive a successful response to invoice.created, we delay finalizing all invoices with automatic collection for up to 72 hours, excluding those where you have set a custom scheduled finalization time.

compact wraith
#

Oh that's interesting and good to know, I didn't know about that.

ember pagoda
#

However, I'm pretty sure that only applies to Invoices created after the first one (that is created along with the Subscription).

compact wraith
#

Ok, makes sense. Thanks for this reference, I'll read it through and noodle on it.

ember pagoda
#

Sounds good. I'm happy to shed what ๐Ÿ’ก I can ๐Ÿ™‚

compact wraith
#

I wonder if I should configure the account settings to have a long Invoice finalization delay , because generally if things are working properly, our webhook processing would have finalized invoices that need to be finalized.

ember pagoda
compact wraith
#

Yes. The 1 hour (default I believe) delay was where I was concerned may be too short for anyone to notice any issues.

ember pagoda
#

Yes if your integration would have trouble performing all the necessary checks and modifications within the 1 hour timeframe, then I think that would be a good approach.

Especially if you are calling the Finalize API as part of your flow after you make the necessary changes.

compact wraith
#

Ok, so if we change that setting to something like 7 days... theoretically, those draft invoices would start to pile up, right?

And I'm thinking our resolution efforts in such a scenario would involve going through the backlog of draft invoices and making the necessary adjustments to finalize them.

Does that sound about right to you?

ember pagoda
#

Well that has more to do with your business model. We only offer advice about coding integrations with Stripe APIs here.

But in general, that sounds about right. If you are generating multiple invoices per hour but waiting 7 days to finalize, that might pile up.

In general, I recommend you work to implement programmatic solutions that apply whatever modifications are required without much human intervention.

compact wraith
#

Makes sense.

It looks like the max might be 3 days according to the grace period doc.

You can set a delay of up to 72 hours (3 days)

ember pagoda
#

Ah yup. Probably for the very reason you mentioned. Things would pile up

compact wraith
#

If you're still with me, I was wondering if you can shed a bit of light into when collection on a finalized invoice would occur.

Is it 1 hour after finalization?

ember pagoda
#

It depends on the collection method. Is it set to charge_automatically or send_invoice?

compact wraith
#

charge_automatically

ember pagoda
#

Then we will attempt to charge the saved payment method immediately after finalization

compact wraith
#

Interesting. I thought it was 1 hour after from what I've observed. Maybe it's a bit different when running a Subscription Simulation?

Maybe in a Subscription Simulation, I don't need to advance the time 1 hour, but rather maybe just 1 minute after finalization to see the payment occur.

ember pagoda
#

Oh yeah if you are using Test Clocks then those timestamps might not appear to be what you expect.