Providing receipts for in-person transactions with Terminal
Tags: stripe, terminal
Published: 2022-09-08 18:39:04

---
title: Providing receipts for in-person transactions with Terminal
published: true
description: Digital receipts are a convenient way to keep track of spendings. Learn how to generate them automatically from in-person transactions with Stripe Terminal.
tags: stripe, terminal
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qvs00fda4p5x9ngnhzmz.png
---

Recently, my colleague [Charles Watkins](https://twitter.com/charlesw_dev) wrote a [4-part intro series to Stripe Terminal](https://dev.to/charlesw_dev/series/18169), our in-person payment solution. Charles' articles will teach you how to set up and register a Terminal device and build an app to accept or cancel payments. Additionally, I’ve been looking into other features including [how to collect tips with Terminal](https://dev.to/stripe/how-to-collect-tips-with-stripe-terminal-18l6). In this post, I’ll explain how to provide digital receipts for in-person purchases.
Digital receipts are very convenient for both customers and merchants. They eliminate the need for paper, help keep track of your spendings and are very helpful if you need to submit expenses. 

## Triggering an automatic email receipt

If you’ve used Terminal before or if you read the blog series linked above, you’ll know that to process payments, you need to start by creating a [PaymentIntent](https://stripe.com/docs/api/payment_intents). By default, this does not send receipts once the payment is processed. To use this feature, you only need to add the `receipt_email` field in the payment intent object, with the email value your customer would enter in your UI.

```javascript
 const intent = await stripe.paymentIntents.create({
     currency: "usd",
     amount: 1000,
     payment_method_types: ["card_present"],
     capture_method: "manual",
     receipt_email: "edsger@dijkstra.com"
 });
```

Once the payment intent is created, it needs to be processed using the `processPaymentIntent` method, passing the Terminal reader ID and the payment intent ID.

```javascript
await stripe.terminal.readers.processPaymentIntent(
     reader.id, //the reader ID can be found by calling await stripe.terminal.readers.list()
     { payment_intent: intent.id }
);
```

Finally, capturing the payment using the  `capture` methods will automatically send an email to the address provided.

```javascript
await stripe.paymentIntents.capture(intent.id);
```

## Creating custom receipts

By default, email receipts look like this:

![Example of a Stripe receipt with the amount paid, the date and the payment method.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1fndva3npq3jeu06ks35.png)

The design and content can be updated via the [Stripe dashboard](https://dashboard.stripe.com). You can select which language to use for receipts (English, French, Portuguese, etc.) in your [email receipt settings](https://dashboard.stripe.com/account/emails) and update the logo and colors in the [branding settings](https://dashboard.stripe.com/account/branding).


![Screenshot of the Stripe dashboard showing the branding page where colors and logos can be edited.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/45tfmxn0fozsjug0i6gz.png)

Additionally, you can add details about your cancellation policy by using the [`description` field](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-description) when creating your payment intent.
Some things to note: a receipt will only be sent after a successful payment. A canceled or failed transaction will not generate a receipt.
Now you should be able to automatically send receipts to your customers after each successful in-person transaction!

Let us know if you’re implementing this, and stay up to date with Stripe developer updates on the following platforms:

📣 Follow [@StripeDev](https://twitter.com/stripedev) and [our team](https://twitter.com/i/lists/1459720002567868418) on [Twitter](https://twitter.com/StripeDev)
📺 Subscribe to our [Youtube channel](https://www.youtube.com/StripeDevelopers)
💬 Join the official [Discord server](https://discord.com/invite/RuJnSBXrQn)
📧 Sign up for the [Dev Digest](https://go.stripe.global/dev-digest)


## About the author

![Charlie's profile picture. She has long brown hair and wears glasses. She is standing in front of a white wall with purple lights.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3vzhifmjslwilrx3e8y6.png)

[Charlie Gerard](https://twitter.com/@devdevcharlie) is a Developer Advocate at Stripe, a [creative technologist](https://charliegerard.dev/) and [Google Developer Expert](https://developers.google.com/community/experts). She loves researching and [experimenting with technologies](https://charliegerard.dev/). When she’s not coding, she enjoys spending time outdoors, trying new beers and reading.