#.rjcustodio
1 messages · Page 1 of 1 (latest)
👋 happy to help
no Payment Intents don't create invoices
if you're using Checkout Sessions, you can create an invoice after the payment
or you can use the Invoice API to create an invoice
and use its PaymentIntent to collect the payment
ohh okay.. sooo
here's the thing
we are using payment element, so we are creating payment intent and using the payment intent client secret to pass it to payment element..
so now for us to have an invoice
we need to create invoice and get the payment intent client secret of that?
expand: ["payment_intent"]
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
Could you please share the Invoice ID?
This Invoice is for $0 so it will not have the PaymentIntent.
There's nothing to pay for.
You can add Invoice Items to your Invoice: https://stripe.com/docs/api/invoiceitems
wait
what should i do first?
i already have a price. price_1NJT48KgpulIQWSvJLnpU7hY
It doesn't matter, as long as the invoice is not finalised, you can add items.
You can use it to create an Invoice Item
You can read more here: https://stripe.com/docs/invoicing/integration
You are looking at the Invoice Item. The payment_intent belongs to the Invoice object.
I see you have it connected to this Invoice Item with ID in_xxx
First I created an invoice - in_1NLNsJKgpulIQWSvILcvKibT (/v1/invoices)
Second create invoice item and use the invoice id (in_1NLNsJKgpulIQWSvILcvKibT) and i got this new invoice line item id - ii_1NLNwSKgpulIQWSv4s09HGaU (/v1/invoiceitems)
now how can i get the payment intent details?
what api url should i call?
You should retrieve the Invoice in_1NLNsJKgpulIQWSvILcvKibT: https://stripe.com/docs/api/invoices/retrieve
Oh. The Invoice is a draft right now, you will need to finalize it before it's payable: https://stripe.com/docs/api/invoices/finalize
I'm sorry for confusion
First I created an invoice - in_1NLNsJKgpulIQWSvILcvKibT (/v1/invoices)
Second create invoice item and use the invoice id (in_1NLNsJKgpulIQWSvILcvKibT) and i got this new invoice line item id - ii_1NLNwSKgpulIQWSv4s09HGaU (/v1/invoiceitems)
Third finalize the invoice
Fourth retrieve the invoice to get the payment intent id
is this the correct process?
Yes.
thank you
Happy to help!