#kylemarlin-invoice
1 messages · Page 1 of 1 (latest)
@wet abyss it's quite confusing but at a high level all invoices have line items (invoice line items). So when you look at an invoice for $190 you can list all its invoice line items at once. Those are read only and you can't modify them
But you still need a way to create one-off line items for an invoice, for example to add an extra fee to a recurring subscription's invoice.
For that we have the Invoice Item API. That lets you create an invoice item and it is "pending" on the customer until it's swept by the next invoice
Does that make sense?
Yup, seems to make sense. Two separate calls to get either, I assume?
it depends what you mean by "get either".
Let's say you create an InvoiceItem for $100 ii_AAA on September 10 on customer A. On September 20, the subscription on customer A cycles, it creates an invoice in_A with an invoice line item ili_123 for the recurring Price of $20, at the same time it sees the pending invoice item ii_AAA on the customer and so it pulls that one in the Invoice. And your invoice has 2 separate invoice line item ili_XYZ that maps to ii_AAA and ili_123 that is for the subscription's recurring price
so in theory you only list invoice line items, for each invoice. The only reason to list invoice items is more to find the ones pending/not yet invoiced