#artur_kagaryan
1 messages · Page 1 of 1 (latest)
Hi! you pass the Price(https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-price) , not just a Product.
Sorry I put wrong link, I wont to create invoice , not the invoice item. I mean create invoice and pass the product
you have to create the items
the way it works is you create an Invoice, and then create Items that add to that Invoice.
there's a full guide at https://stripe.com/docs/invoicing/integration !
When I create invoice before creating invoice-items , I'm getting this error
"Nothing to invoice for customer"
that's because you're using an older API version that requires you to create the item before creating the Invoice, we changed it last month
if you pass https://stripe.com/docs/api/invoices/create set to include to opt into the new behaviour
or you can create the items first, and then create the Invoice
sorry, bad link
I meant this : https://stripe.com/docs/api/invoices/create#create_invoice-pending_invoice_items_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok, I will update version. Can I create one item/product and use it in few invoices ?
a single InvoiceItem is specific to one Invoice
you can create as many InvoiceItems referencing a certain Price(for a certain Product) and use those in separate Invoices as much as you want
Understood .
So in my current api version if I create for example 4 invocie items then create invoice , it will include all those 4 items ?
yep, in the older versions they way it worked is you
- create item A
- create item B
- create an Invoice
- the invoice "pulls in" A and B and those are part of that invoice now
- finalize the Invoice
there are some problems with that approach which is why in the new version it's
- create an empty Invoice I
- create item A on I
- create item B on I
- finalize the Invoice I