#nospoon - invoice events

1 messages ยท Page 1 of 1 (latest)

elfin elk
#

Hello! Just starting a thread for you -- I'll review and respond as soon as I can ๐Ÿ™‚

#

We recommend using invoice.paid in most cases, as it will emit for all invoices that progress to paid

#

invoice.payment_succeeded by contrast only fires with a successful payment

#

The difference is from mainly two cases:

  • trial or free plan invoices for $0 have no payment
  • invoices issued and paid out of customer balance eg from previous prorated credit, again no payment
#

So those cases will get invoice.paid but won't get payment succeeded

#

So it depends exactly what you want ๐Ÿ™‚

midnight geyser
#

I'm looking at the event evt_1KxYYiFm1WBeuTDqCfemc7b6 of type invoice.paid and don't understand why the invoice's period_end and period_start are different from the invoice's lines.data[0].period.start and lines.data[0].period.end

#

Specifically, why does the invoice's period_end and period_start point to the previous cycle while the line items (lines.data[0].period.start and lines.data[0].period.end) point to the next cycle

elfin elk
#

That's expected and intentional, it is how stripe invoice and billing periods work

#

the invoice period is the past period where invoice items are created, and the items are the forward looking billing period being paid for

midnight geyser
#

So i'm guessing the invoice period indicates the period of when the invoice was created?

elfin elk
#

the invoice period is "paid for all the invoice items generated in this period" and the item period is "here is the period of time the item is paying for"

#

right, Billing works on a prepaid basis, you pay at the start of the period not the end