#gilbert_invoice-lines

1 messages ¡ Page 1 of 1 (latest)

minor yachtBOT
#

👋 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/1240442345963520020

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

hot cove
#

@indigo kindle create the Invoice first then when you create the InvoiceItem pass invoice: 'in_123' as a parameter

#

gilbert_invoice-lines

indigo kindle
#

Can you elaborate more on this? It's quite confusing

hot cove
#

What part is confusing exactly? You code creates an InvoiceItem and then an Invoice. That doesn't work (that logic changed 2 years ago).
Instead create the Invoice first and then create an InvoiceItem for that Invoice.

indigo kindle
#

Alright and then pass the invoice.id as value to the invoice key in the invoiceItem is what you're suggesting?

hot cove
#

yes

indigo kindle
#

Thanks for the docs...

This may sound stupid but one more question if you don't mind.

Though this might work but is there a need to add the snippet below to the code or some other final code to replace it?
await stripe.invoices.sendInvoice(invoice.id);