#Rob.Clayton
1 messages Β· Page 1 of 1 (latest)
I was expecting an invoice to be paid, and the event to be raised, but I advanced the clock a day after when the invoice was meant to be finalized and it stayed in the draft state until I updated the clock in the admin portal (but didn't advance it)
IF I have done the right things π
From https://stripe.com/docs/invoicing/integration/workflow-transitions#finalized:
We wait an hour after receiving a successful response to the invoice.created event before attempting payment. If we donβt receive a successful response within 72 hours, we attempt to finalize and send the invoice.
The invoice will only be finalised an hour after the invoice is created if your system acknowledges invoice.created event. Otherwise, it'll be 72 hours
You should advance time again to one hour after invoice is created if your system has responsed 200 to invoice.created event
ahhhhhhh
I see. Thank you!
No problem! Happy to help π
Hey, if you're still there river ... I'm using the invoice paid event to update in our own db when the customer is paid up until.
Is the billing period the invoice is for provided in the invoice.paid payload?
the period_start and end are the same value in my payload
Can you share the invoice ID (in_xxx)?
in_1NKYiTDBF4LGcRTgKUmjZI8G
Pardon the code interpolation, the fond_event.stripe_event is the base Stripe event object.
Thanks for sharing. Checking it now
thanks!
For the first invoice of the subscription, period_start and period_end will be the same and correspond to the timestamp the subscription was created
I see ... so if it's the first invoice, I have to check the subscription level period values?
I wanted to go off the pure event object to avoid any timing issues with event arrivals
Can you share what you're trying to achieve? There should just be one invoice when the customer subscribes to a subscription initially
I'm modelling a paid until field for our customers
I thought that the invoice paid was probably a good event to monitor for this information
so I update our paid until for our "subscription" information in our db from stripe
effectively I wanted the period end date that the paid subscription is billing for
I see! period_start and period_end are the usage period during which invoice items were added to this invoice, not the period which the invoice is paid for
If you wish to get the period that the invoice is paid for, you may look for lines.period.start and lines.period.end
ahhh, thanks
No problem! Happy to help π