#obo_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1288917959342817304
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi ๐
Invoice items can be created without any direct link to an Invoice. The idea is that, when you later create an Invoice for the same Customer as the Invoice Items, those items get automatically included.
so for my situation, I want to list all invoice items that will be appearing on an upcoming invoice (whenever that is, it could be the moment after the previous invoice went out, or all the way up until that invoice goes out). Is there a good way to get that list?
Well that depends on how you create your next invoice. Are these created from a Subscription or are you using the Invoice API?
invoice api
Okay so to get the pending InvoiceItems included, you would need to specify the pending_invoice_item_behavior and set it to include. It defaults to exclude which means pending invoice items are not added automatically.
If you are using include, then you would get a list of all pending invoice items for a given Customer by using the List API and specifying the Customer ID and pending: 'true'
https://docs.stripe.com/api/invoiceitems/list
That would show you the Invoice Items that would be added to any new Invoice that specifies pending_invoice_item_behavior: 'include'
Ah, sorry that property is only for when you create the Invoice, here: https://docs.stripe.com/api/invoices/create#create_invoice-pending_invoice_items_behavior
For the InvoiceItems List API, you would just provide the customer and pending parameters to get a list of pending invoice items