---
title: "Digital receipts"
description: "Send digital receipts for in-person transactions."
url: "https://docs.adyen.com/unified-commerce/digital-receipts"
source_url: "https://docs.adyen.com/unified-commerce/digital-receipts.md"
canonical: "https://docs.adyen.com/unified-commerce/digital-receipts"
last_modified: "2021-07-06T11:55:00+02:00"
language: "en"
---

# Digital receipts

Send digital receipts for in-person transactions.

[View source](/unified-commerce/digital-receipts.md)

Some customers prefer to receive digital receipts (by email, for example) instead of a printed receipt. Digital receipts are easier to store, more convenient to find, and do not generate paper waste.

Here we'll show you how to use Adyen-supplied payment terminals to recognize a returning customer and know if you already have their email, ask them if they want to receive their receipt digitally, and send their receipt to the email address saved in their profile.

## Requirements

To send digital receipts, make sure that:

1. You can [create customer profiles](/unified-commerce/loyalty-program/create-profiles) and [recognize returning customers](/unified-commerce/loyalty-program/recognize-customers) across your sales channels.
2. You have software that can generate the receipt from the Terminal API payment response, and send the receipt to the customer's email.

## Step 1: Recognize customer

Before asking your customer whether they prefer a digital receipt, you should attempt to recognize them. This will determine whether you already have their contact details that you can send the receipt to.

1. Make a card acquisition request to [recognize the customer](/unified-commerce/loyalty-program/recognize-customers#recognize-returning-customers-in-store). This will return any customer information that you previously stored with Adyen.

   The example below shows a card acquisition request for a customer who is making a **EUR 10.99** purchase.

   **Card acquisition request**

   ```json
   {
       "SaleToPOIRequest": {
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Service",
               "MessageCategory":"CardAcquisition",
               "MessageType":"Request",
               "SaleID":"POSSystemID12345",
               "ServiceID":"0207111104",
               "POIID":"V400m-324688179"
           },
           "CardAcquisitionRequest": {
               "SaleData": {
                   "SaleTransactionID": {
                       "TransactionID": "15890",
                       "TimeStamp": "2019-12-04T12:02:49.000Z"
                   },
               },
               "CardAcquisitionTransaction": {
                   "TotalAmount": 10.99
               }
           }
       }
   }
   ```

   You receive a response that includes an `AdditionalResponse` object, with a base64-encoded string that you need to decode to get a JSON object, or a string of form-encoded key-value pairs. In our examples, we use form-encoded key-value pairs.

   **Card acquisition response**

   ```json
   {
       "SaleToPOIResponse": {
           "CardAcquisitionResponse": {
               "POIData": {
                   "POITransactionID": {
                       "TimeStamp": "2019-12-04T12:02:49.000Z",
                       "TransactionID": "4rVu001575460969123"
                   },
                   "POIReconciliationID": "1000"
               },
               "SaleData": {
                   "SaleTransactionID": {
                       "TimeStamp": "2019-12-04T12:02:49.000Z",
                       "TransactionID": "15890"
                   }
               },
               "PaymentInstrumentData": {...},
               "Response": {
                   "Result": "Success",
                   "AdditionalResponse":"...alias=M469509594859802...shopperReference=ShopperID-A16729&shopperEmail=john.smith@example.com&recurringDetailReference=8315753858208091..."
               }
           },
           "MessageHeader": {...}
       }
   }
   ```

2. Check if the `AdditionalResponse` object contains a `shopperReference`.

   * If it contains a `shopperReference`, they are a returning customer. If you have previously stored the `shopperEmail` with Adyen, this is also provided in this response.
   * If it *does not* contain a `shopperReference`, the customer's card is not recognized.\
     This usually means that the customer is new, and has not purchased with you before. However, they could also be a returning customer using a new card.

   To confirm, you can collect their email address, then check whether this matches a `shopperEmail` stored in your customer database:

   * If the email matches a `shopperEmail` in your database, they are a returning customer. Ask them if they want to save their new card. If they do, tokenize their new card using their `shopperReference` from your database when you make a payment.
   * If the email is not your database, they are a new customer. Proceed to step 2 to [ask them if they want their receipt sent by email](#email-unknown).

## Step 2: Request customer input

You can present messages and collect input from the customer using the touch-screen displays in Adyen-supplied payment terminals. Alternatively, your staff can ask your customer for their preferences, and then type the email address in your POS app.

Depending on whether your customer's email address is saved in their profile, you can either ask them:

* To [confirm whether they want their receipt sent to their known email address](#email-known).
* Whether they [want their receipt sent by email](#email-unknown), before prompting them for their address.

### Email address is known

If your customer's email address is already known, present a prompt on the terminal display to check whether they would like the receipt sent by email.

To ask if your customer wants to get a digital receipt:

1. Make a **GetConfirmation** [input request](/point-of-sale/shopper-engagement/shopper-input/confirmation) from your POS app, asking the customer whether they would like to receive their receipt by email.

   The example below would present the message **Would you like us to send your receipt to the email address (followed by the customer's email address)?** on the terminal display, followed by a prompt for the customer.

   **GetConfirmation input request**

   ```json
   	{
   	  "SaleToPOIRequest": {
   	    "MessageHeader": {...},
   	    "InputRequest": {
   	      "DisplayOutput": {
   	        "Device": "CustomerDisplay",
   	        "InfoQualify": "Display",
   	        "OutputContent": {
   	          "OutputFormat": "Text",
   	          "PredefinedContent": {
   	            "ReferenceID": "GetConfirmation"
   	          },
   	          "OutputText": [
   	            {"Text": "How would you like your receipt?"},
   	            {"Text": "Would you like us to send your receipt to the email address SHOPPER_EMAIL?"},
   	            {"Text": "No"},
   	            {"Text": "Yes"}
   	          ]
   	        }
   	      },
   	      "InputData": {
   	        "Device": "CustomerInput",
   	        "InfoQualify": "Input",
   	        "InputCommand": "GetConfirmation",
   	        "MaxInputTime": 30
   	      }
   	    }
   	  }
   	}
   ```

   Your message is shown on the terminal display. The customer indicates whether they would like their receipt emailed to them.

   When they are done selecting their option, you receive the input response that contains `Input.ConfirmedFlag` object. If this is **true**, the customer would like to receive their receipt by email. Continue to [make the payment](#step-3-continue-with-payment).

   **GetConfirmation input response**

   ```json
   	{
   	  "SaleToPOIResponse": {
   	    "InputResponse": {
   	      "InputResult": {
   	        "Device": "CustomerInput",
   	        "InfoQualify": "Input",
   	        ...
   	        },
   	        "Input": {
   	          "ConfirmedFlag": true,
   	          "InputCommand": "GetConfirmation"
   	        }
   	      },
   	      ...
   	    },
   	    "MessageHeader": {...}
   	  }
   	}
   ```

### Email address is unknown

If your customer is new, or does not have an email linked to their profile yet, present a prompt on the terminal display to check whether they would like the receipt sent by email. If they do, you can collect the customer's email address directly from your terminal, using the on-screen keyboard.

To ask if your customer wants to get a digital receipt:

1. Make a **GetConfirmation** [input request](/point-of-sale/shopper-engagement/shopper-input/confirmation), asking the customer whether they would like to receive their receipt by email.

   The example below would present the message **Would you like us to send your receipt to your email address?** on the terminal display, followed by a prompt for the customer.

   **GetConfirmation input request**

   ```json
   	{
   	  "SaleToPOIRequest": {
   		"MessageHeader": {...},
   		"InputRequest": {
   		  "DisplayOutput": {
   			"Device": "CustomerDisplay",
   			"InfoQualify": "Display",
   			"OutputContent": {
   			  "OutputFormat": "Text",
   			  "PredefinedContent": {
   				"ReferenceID": "GetConfirmation"
   			  },
   			  "OutputText": [
   				  {"Text": "How would you like your receipt?"},
    	            {"Text": "Would you like us to send your receipt to your email address?"},
    	            {"Text": "No"},
    	            {"Text": "Yes"}
   			  ]
   			}
   		  },
   		  "InputData": {
   			"Device": "CustomerInput",
   			"InfoQualify": "Input",
   			"InputCommand": "GetConfirmation",
   			"MaxInputTime": 30
   		  }
   		}
   	  }
   	}
   ```

   The customer uses the terminal display to indicate whether they would like their receipt sent by email.

   Your message is shown on the terminal display. The customer indicates whether they would like their receipt emailed to them.

   When they are done selecting their option, you receive the input response that contains an `Input.ConfirmedFlag` object. This indicates **true** if the customer would like to receive their receipt by email. Continue to the next step to get their email. Otherwise, they would rather have a paper receipt, so [continue to make a payment request](#step-3-continue-with-payment).

   **GetConfirmation input response**

   ```json
   {
     "SaleToPOIResponse": {
       "InputResponse": {
         "InputResult": {
           "Device": "CustomerInput",
           "InfoQualify": "Input",
           ...
           },
           "Input": {
             "ConfirmedFlag": true,
             "InputCommand": "GetConfirmation"
           }
         },
         ...
       },
       "MessageHeader": {...}
     }
   }
   ```

2. If the customer indicated that they want to receive an electronic receipt, [collect their email](/unified-commerce/loyalty-program/create-profiles#create-profile-from-point-of-sale-payment) and create a customer profile.

## Step 3: Continue with payment

Continue with the purchase by making a payment request:

1. Make a POST request from your POS app to [initiate the payment](/point-of-sale/basic-tapi-integration/make-a-payment). If you are saving the email of a new customer, also include parameters described in the [Create customer profiles](/unified-commerce/loyalty-program/create-profiles#create-profile-from-point-of-sale-payment) documentation.

   Here is how you can make a **EUR 10.99** payment for a *known* customer.

   **Terminal API request**

   ```json
   	{
   		"SaleToPOIRequest":{
   			"MessageHeader":{
   				"ProtocolVersion":"3.0",
   				"MessageClass":"Service",
   				"MessageCategory":"Payment",
   				"MessageType":"Request",
   				"SaleID":"POSSystemID12345",
   				"ServiceID":"0207111105",
   				"POIID":"V400m-324688179"
   			},
   			"PaymentRequest":{
   				"SaleData":{
   					"SaleTransactionID":{
   						"TransactionID":"15887",
   						"TimeStamp":"2019-12-04T12:02:49.000Z"
   					}
   				},
   				"PaymentTransaction":{
   					"AmountsReq":{
   						"Currency":"EUR",
   						"RequestedAmount":10.99
   					}
   				},
   				"PaymentData":{
   					"CardAcquisitionReference":{
   						"TransactionID":"oLkO001528797935000",
   						"TimeStamp":"2019-12-04T12:02:49.000Z"
   					}
   				}
   			}
   		}
   	}
   ```

   You receive a response that includes:

   * `AdditionalResponse` object, with a base64-encoded string that you need to decode to get a JSON object, or a string of form-encoded key-value pairs. In our examples, we use form-encoded key-value pairs. You can get the `shopperEmail` from this string.
   * `PaymentReceipt`: Object containing data you can use to [generate a receipt](/point-of-sale/basic-tapi-integration/generate-receipts#receipt-data).

   **Payment response**

   ```json
   	{
   	  "SaleToPOIResponse":{
   	    "MessageHeader":{...},
   	    "PaymentResponse":{
   	      "POIData":{
   	        "POITransactionID":{
   	          "TransactionID": "oLkO0012498220087567.991517998212382C"
   	        },
   	        ...
   	      },
   	      "Response":{
   	        "Result":"Success",
   	        "AdditionalResponse":"...shopperEmail=john.smith@example.com&shopperReference=john_smith..."
   	      },
   	      ...
   	    },
   	    "PaymentReceipt":{...}
   	  }
   	}
   ```

2. Use your CRM or email tool to send the receipt to the `shopperEmail`. The receipt should include the data provided in the `PaymentReceipt` object. For more information on what you need to provide in generated receipt, see [Generating compliant receipts](/point-of-sale/basic-tapi-integration/generate-receipts#generating-compliant-receipts).
