#.rjcustodio

1 messages · Page 1 of 1 (latest)

vital plinthBOT
pale ore
#

👋 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

hot anchor
#

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?

pale ore
#

yes

hot anchor
#

how to expand?

#

to get the intent id

pale ore
#

expand: ["payment_intent"]

hot anchor
#

im getting null

grand lion
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

#

Could you please share the Invoice ID?

hot anchor
#

here

#

in_1NLNAxKgpulIQWSvqUd9O9P0

grand lion
#

This Invoice is for $0 so it will not have the PaymentIntent.

#

There's nothing to pay for.

hot anchor
#

how can i add amount?

#

what is the key?

#

the word amount only?

grand lion
hot anchor
#

wait

#

what should i do first?

#

i already have a price. price_1NJT48KgpulIQWSvJLnpU7hY

grand lion
#

It doesn't matter, as long as the invoice is not finalised, you can add items.

grand lion
hot anchor
#

the payment intent is not here

grand lion
#

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

hot anchor
#

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?

grand lion
hot anchor
#

still null

grand lion
hot anchor
#

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?

grand lion
#

Yes.

vital plinthBOT
hot anchor
#

thank you

grand lion
#

Happy to help!