#Mike Taylor - Upcoming Invoice
1 messages · Page 1 of 1 (latest)
The Upcoming Invoice doesn't actually exist as a record so it doesn't have an ID yet and you cannot fetch it.
You can retrieve the upcoming invoice via the API but you need to pass in the Customer ID and possibly the Subscription ID as well (since the Invoice ID doesn't exist yet).
https://stripe.com/docs/api/invoices/upcoming
Ok thanks. So in the absence of knowing the upcoming invoice ID, what do we pass as invoice id in this code stripe.invoices
.finalizeInvoice(invoiceId, { auto_advance: true }) -- do we pass null?
Wait...sorry. I might have got on the wrong foot. Is this an invoice you are creating manually or is it created via a subscription?
manually via the api
Okay then you should receive the invoice object in the response to your API request
We add InvoiceItems. An upcoming invoice is created. Stripe does not return an id in the invoice object. But we don't see a "close the latest draft invoice call in the API".
Ah, creating Invoice Items does not create and invoice by itself
But when you create a draft invoice for that customer it will pull in those invoice items
Although you can now create a draft invoice with no items first and then add items to it if that makes more sense for you
That was kind of a big deal and it just became available
Is that new behaviour?
Brand new this week
Gotcha.
have you got a refernce link? Also what is the use case for Quotes? Is that what Quotes is intended to target?
I think Quotes is something slightly different. To be honest I haven't messed around with them yet but I think the idea was to provide the customer something where they could see a potential charge
With respect to the docs on the invoice, right now all we have is the API doc here: https://stripe.com/docs/api/invoices/create#create_invoice-pending_invoice_items_behavior
And the docs for Quotes are here: https://stripe.com/docs/quotes