#Shra_1
1 messages · Page 1 of 1 (latest)
Hi there, you should listen to invoice.created event so that you can add the new invoice items to the newly created invoice (https://stripe.com/docs/api/invoiceitems/create?lang=node#create_invoiceitem-invoice)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so it means, above mentiond cause is possible to achieve ?
how about this ?
(when ever additional charges/invoice item to be added to customer)
- I'll retrive the upcoming invoice for the customer(which will already have some charges)
- i'll create a invoice Item
- i'll add that invoice item to upcoming invoice
will it work ?
The upcoming invoice API is just for you to preview the upcoming invoice, there's no invoice ID in the upcoming invoice object.
Although you can create an invoice item without specify a invoice id, I highly recommend you to specify one so that the invoice item is attached to the correct invoice so that you can prevent attaching it to a wrong invoice.
but how do I add it, when Invoice itself is not created.
That's why I advise you to listen to invoice.created event, this event is fired when an invoice is created and you can get the ID from the invoice object in this event
Occurs X number of days before a subscription is scheduled to create an invoice that is automatically charged—where X is determined by your subscriptions settings.