#appchargeguy
1 messages · Page 1 of 1 (latest)
When you received payment_intent.succeeded Call a Retrieve Payment Intent API and expand its invoice property. You will receive a full Invoice object. Inside there you may find the property you want
it does not appear here
https://stripe.com/docs/api/payment_intents/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
it shows "invoice": null,
I completed a payment and then listened on payment_intent.succeeded
I received the payment intent object and I always get the invoice object as null
Yeah so that's a standalone PaymentIntent and it doesn't come with an Invoice
So there is no Invoice unfortunately
ok, so how can i get it?
https://stripe.com/docs/invoicing/integration you can use this integration instead. It will create an Invoice, and then a PaymentIntent inside it
No that's it, any reason you don't want to?
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
I want to get the details about the invoice that is sent to every buyer. currently, I don't support any integration with invoice, so it requires a lot of effort from my side.
and for now, since I only create a payment intent, then invoice is triggered automatically...
can you explain me more about the integration with the invoice...
If you want an invoice for each payment then you either:
- Use Checkout: https://stripe.com/docs/receipts?payment-ui=checkout#paid-invoices
- Use the Invoicing API (as advised above)
Payment Intents don't support invoice generation
I'm a bit confused. now, when I create a payment intent, the buyer is redirected to the checkout page, he then completes the payment and the invoice is automatically sent to his email. Finally I get in the code a payment_intent.succeeded event that summarise the transaction
the invoice is automatically sent to his email
It's likely a receipt, not an invoice
ok, I get it, but the receipt is linked to an invoice, right?
No, not with Payment Intents
Can you share an example pi_xxx ID of one of your payments?
so why in the email receipt I see both receipt number and invoice number?
"id": "pi_3NfPL9GIhFVTvc3Z0W5NvFhn"
but this is in test mode..
Ok, so you are using Checkout with the invoice_creation parameter. So yes, there would be an Invoice generated on payment. However for that example the session/payment is not complete
"id": "cs_test_a1U6qEVEw2MSODYhJIHICkYjWYMaY9ZHqb1HdjM8rDsslAR26XxT2YytVh",
here is session completed event
Ok, here's the Invoice it generated: https://dashboard.stripe.com/test/invoices/in_1NfPCyGIhFVTvc3ZL8P4AoWF
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Now help me understand the issue. In the email, there'll be a link your customer(s) can click to download the PDF
They aren't attached to the email
ok, now I see, there invoice object is attaced to the session completed event and not the payment intent succeeded event
I can make an api call to retrieve the invoice object
I see that there is a 'reciept_number' property, is this the number that the buyer sees in his email receipt?
or a stripe's internal id?
Yes, its reflected in the email
great and which property in the invoice object represent the value of 'Invoice number'?
Should be number: https://stripe.com/docs/api/invoices/object#invoice_object-number
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.