Search

Are you looking for test card numbers?

Would you like to contact support?

Default icon

Digital receipts

Send digital receipts for in-store transactions.

Some customers might 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 don't generate paper waste.

In this tutorial, we'll show you how you can use Adyen 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 to send their receipt to the email address saved in their profile.

Before you begin

To send digital receipts, make sure that:

  1. You can create customer profiles and recognize returning customers across your sales channels.
  2. You have a 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 would 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. This will return any customer information that you previously stored with Adyen.

    The example below shows how you would attempt to recognize a customer who is making a 10.99 EUR purchase.

    Card acquisition request
    {
    "SaleToPOIRequest": {
        "MessageHeader":{
            "ProtocolVersion":"3.0",
            "MessageClass":"Service",
            "MessageCategory":"Payment",
            "MessageType":"Request",
            "SaleID":"POSSystemID12345",
            "ServiceID":"0207111104",
            "POIID":"V400m-324688179"
        },
        "CardAcquisitionRequest": {
            "SaleData": {
                "SaleTransactionID": {
                    "TransactionID": "15890",
                    "TimeStamp": "2019-12-04T12:02:49.000Z"
                },
                "TokenRequestedType": "Customer"
            },
            "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.

    The example response below includes an AdditionalResponse object.

    Card acquisition response
    {
    "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":"...shopperReference=john_smith&shopperEmail=john.smith@email.com..."
            }
        },
        "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.

Step 2: Request customer input

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

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

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 from your cash register, 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
    {
      "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.

    GetConfirmation input response
    {
      "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, 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
    {
      "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.

    GetConfirmation input response
    {
      "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 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 cash register to initiate the payment. If you are saving the email of a new customer, also include parameters described in the Create customer profiles documentation.

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

    Terminal API request
    {
        "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.
    Payment response
    {
      "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 Receipt requirements.

Next steps