#jast26
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
Are there any docs you're following for this?
You can't pass a lines object directly to create invoice API
https://stripe.com/docs/api/invoices/create
You'd need to create invoice items separately
https://stripe.com/docs/api/invoiceitems/create
how does the api know which invoice to attach the item to? i see required params for adding an invoice item is customer and price, not invoice
also am i supposed to create the invoice or the item first?
You can create an empty invoice first, yes
ok so i am building a custom integration, i have now managed to create an invoice and manually finalised it so that i can generate a payment intent. How can i retrieve from the payment intent the client secret so that i can forward it to the client? is it possible with an invoicing flow?
Once you finalize the invoice, the invoice should have the payment intent under invoice.payment_intent
https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent
So you can retrieve the invoice and expand payment_intent to get the client secret