#Rob.Clayton

1 messages Β· Page 1 of 1 (latest)

silk treeBOT
red depot
#

What events do you expect from the advancement?

#

Can you give an example?

plain rock
#

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 πŸ™‚

red depot
#

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

plain rock
#

ahhhhhhh
I see. Thank you!

red depot
#

No problem! Happy to help πŸ˜„

plain rock
#

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

red depot
#

Can you share the invoice ID (in_xxx)?

plain rock
#

in_1NKYiTDBF4LGcRTgKUmjZI8G

#

Pardon the code interpolation, the fond_event.stripe_event is the base Stripe event object.

red depot
#

Thanks for sharing. Checking it now

plain rock
#

thanks!

red depot
#

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

plain rock
#

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

red depot
#

Can you share what you're trying to achieve? There should just be one invoice when the customer subscribes to a subscription initially

plain rock
#

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

red depot
#

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

plain rock
#

ahhh, thanks

red depot
#

No problem! Happy to help πŸ˜„