How to automatically send receipt by email

Hi,I am strugguling to send receipt with stripe can someone explain me ?
Thank you very much !

There are many ways here.
First off you can do it manually within the stripe dashboard.

You can also turn on automatic emails to customers: go into stripe dashboard and search for customer emails.

These two should be turned ON

  • Successful payments
  • Refunds

PS. In stripe.js 2 or wherever you are, you need to fill in the ‘Receipt email’ with current users email.

If you want to give users a way to retrieve their receipts at any time.
There might be many more ways but this is how I did it via stripe.js 2 and one API call to stripe

  1. you need to note down the charge_id
    you can get it from the action: stripe.js - paymentIntent - create
    Save it to a new eg. payment capture.

Setup the API to stripe to retrieve the charge object. Sounds complicated but it’s not and you got chatGPT. https://api.stripe.com/v1/charges/[charge_id]

Once you got that, you can for example have a button somewhere.
When button is clicked…

  1. The API call to stripe. Feed it the charge_ID you previously stored in eg. the type paymentcaptures.
  2. Open an external website: containing result of step 1’s body receipt_url

Now your users can click the button and be directed to their receipt.