--- title: "Show a virtual receipt on the terminal" description: "Show a virtual receipt on the display of the payment terminal." url: "https://docs.adyen.com/point-of-sale/shopper-engagement/display-data/display-receipt" source_url: "https://docs.adyen.com/point-of-sale/shopper-engagement/display-data/display-receipt.md" canonical: "https://docs.adyen.com/point-of-sale/shopper-engagement/display-data/display-receipt" last_modified: "2025-03-14T16:17:00+01:00" language: "en" --- # Show a virtual receipt on the terminal Show a virtual receipt on the display of the payment terminal. [View source](/point-of-sale/shopper-engagement/display-data/display-receipt.md) Before the payment transaction starts, you can use the payment terminal to show the shopper an overview of their purchase. You can also add a QR code to this virtual receipt. A request to show a virtual receipt doesn't time out. The terminal continues to show the receipt until you send another request. For example, a payment request, or a request to [show the standby screen](/point-of-sale/shopper-engagement/display-data/idle-display). #### Without QR code The next examples show what virtual receipts look like on landscape (wide) and portrait (narrow) terminal displays. The receipt lines are scrollable. ![](/images/7/f/d/4/0/7fd40130a4f93696bfd0101843f4ea48ed13e070-screen-enlineitemlandscape.png) ![](/images/1/7/6/b/d/176bd9ac0788401372cde304fc692cd3e117cd4a-screen-enlineitemportrait.png) #### With QR code It is also possible to add a QR code. A terminal with a landscape display shows the QR code next to the receipt lines. ![](/images/5/9/4/d/9/594d99cefac23eae656eafba20dd40da8dd9d65a-screen-enlineitemplusqrcodelandscape.png) A terminal with a portrait display shows two screens. First a screen with the QR code and a button to proceed, and then a screen with the receipt lines. ![](/images/b/c/b/a/d/bcbad94f109d925638b3618545926ab3c93cea6c-screen-enqrcodebeforelineitemportrait.png)  ![](/images/1/7/6/b/d/176bd9ac0788401372cde304fc692cd3e117cd4a-screen-enlineitemportrait.png) ## Receipt XML file To show a virtual receipt on the terminal display, you need to gather all content in an XML file, convert this file to a Base64 string, and pass that string in a display request. The XML file can contain: * ``: the XSLT to use. This determines whether a QR code is added to the virtual receipt. * `` : the image to show on the left part of the screen. This is only supported on SFO1 payment terminals. The image must be converted to a Base64-encoded string. * ``: a QR code with a header and footer. When used with a `` that doesn't support showing a QR code, the `` is ignored. * ``: the header line of the virtual receipt. * ``: contains line items that represent the goods that the shopper is purchasing. Each line item can have a `count`, `description`, and `amount`. The `amount` can have `currency` and `value`. On SFO1 terminals, each line can also have an `icon` and a `subtitle`. * ``: the amount due before discounts and taxes. * ``: total discounts, amount and type of taxes, total tax amount. * ``: final amount due. Use the following example XML file to populate an XML input file with line items and total amounts from your POS app, making sure you specify a `` that is compatible with the terminal and the result you want to achieve: | Effect | `` | Terminal model | | ------------------------------------------------------------------------------------------------------------ | ----------------------------------- | --------------------------------------------------------- | | Receipt **with** QR code | `virtual-receipt-with-qr-code.xslt` | All that support virtual receipts | | Receipt **without** QR code | `virtual-receipt.xslt` | AMS1, e280, P400 Plus, S1E, S1F2, SFO1, V400c Plus, V400m | | | `virtual_receipt02.xslt` | M400 | | Receipt **without** QR code, receipt header not 'sticky' | `virtual_receipt01.xslt` | M400 | | Receipt **without** QR code, receipt header not 'sticky', receipt footer 'sticky', auto-scroll to the bottom | `virtual-receipt01.xslt` | AMS1, S1E, S1F2, V400M, P400 | | | `virtual_receipt03.xslt` | M400 | **Example XML file** ```xml "iVBORw0KGgoAAAANS" Scan to access member card Scan https%3A%2F%2Fwww%2Eadyen%2Ecom%2Fsignup%2F%3Flocation%3Damsterdam%26store%3DStore42%26POSID%3DREG0042%26hash%3DAAhbcdfjkbckjwbnadsjkn4%3D Do not have the app? Scan to download Your items "iVBORw0KGgoAAAANS" ** SALES ** Quantity: 1 1 Running shoes $ 79.99 2 Green T-shirt @ 9.89 $ 19.78 ** RETURNS ** 1 Grey t-shirt @ 12.99 $ -12.99 ** DISCOUNTS ** Loyalty discount $ -4.48 ____________________ Subtotal $ 86.78 Total discount: $ -4.48 State tax: $ 5.97 County tax: $ 1.85 Total tax: $ 7.82 Total amount: $ 90.12 ``` On the terminal screen, the currency symbol only shows for the total amount. ## Make a display request for a virtual receipt 1. Create the virtual receipt: 1. Based on our [example XML file](#virtual-receipt-xml), populate an XML file with line items and total amounts from your POS app. Make sure that you use the correct screen name: * ``: shows a receipt without QR code where the receipt has a 'sticky' header which remains visible when scrolling down the receipt lines. For use on portrait terminals: **AMS1**, **e280**, **P400 Plus**, **S1E**, **S1F2**, **V400c Plus**, and **V400m**. * ``: shows a receipt with a QR code. For use on any terminal model that supports virtual receipts. * ``: shows a receipt without QR code. For use on the **M400**. * ``: shows a receipt without QR code but with a 'sticky' header. For use on the **M400**. * ``: shows a receipt without QR code, a 'sticky' footer, and auto-scroll to the bottom. For use on the **AMS1**, **S1E**, **S1F2**, **SFO1**, **V400M** and **P400**. * ``: shows a receipt without QR code, a 'sticky' footer, and auto-scroll to the bottom. For use on the **M400**. 2. Convert the XML content to a Base64 string. 2. Make a [Terminal API](/point-of-sale/design-your-integration/terminal-api) display request, specifying: * The standard [`SaleToPOIRequest.MessageHeader` ](/point-of-sale/design-your-integration/terminal-api#request-message-header)object, with `MessageClass` set to **Device** and `MessageCategory` set to **Display**. | Parameter | Required | Description | | ----------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ProtocolVersion` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **3.0** | | `MessageClass` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Device** | | `MessageCategory` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Display** | | `MessageType` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Request** | | `ServiceID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal (`POIID`) being used. | | `SaleID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique ID for the POS system component to send this request from. | | `POIID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The unique ID of the terminal to send this request to. Format: *\[device model]-\[serial number]*. | - The [DisplayRequest.DisplayOutput](https://docs.adyen.com/api-explorer/terminal-api/latest/post/display#request-DisplayOutput) array containing a single array item with: | Parameter | Description | | ---------------------------- | --------------------------------------------- | | `Device` | **CustomerDisplay** | | `InfoQualify` | **Display** | | `OutputContent.OutputFormat` | **XHTML** | | `OutputContent.OutputXHTML` | The Base64 string containing the XML content. | #### JSON ```json { "SaleToPOIRequest":{ "DisplayRequest":{ "DisplayOutput":[ { "Device":"CustomerDisplay", "InfoQualify":"Display", "OutputContent":{ "OutputFormat":"XHTML", "OutputXHTML": "...paste Base64 encoded XML here..." } } ] }, "MessageHeader":{ "ServiceID":"1116172359", "ProtocolVersion":"3.0", "MessageClass":"Device", "POIID":"M400-284251175", "MessageType":"Request", "SaleID":"POSSystemID12345", "MessageCategory":"Display" } } } ``` #### Java ```java String serviceID = "YOUR_UNIQUE_ATTEMPT_ID"; String POIID = "YOUR_TERMINAL_ID"; String saleID = "YOUR_CASH_REGISTER_ID"; SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); DisplayRequest displayRequest = new DisplayRequest(); DisplayOutput displayOutput = new DisplayOutput(); displayOutput.setDevice( DeviceType.CUSTOMER_DISPLAY ); displayOutput.setInfoQualify( InfoQualifyType.DISPLAY ); OutputContent outputContent = new OutputContent(); outputContent.setOutputFormat( OutputFormatType.XHTML ); outputContent.setOutputXHTML("...paste base64 encoded XML here..."); displayOutput.setOutputContent(outputContent); displayRequest.setDisplayOutput(displayOutput); saleToPOIRequest.setDisplayRequest(displayRequest); MessageHeader messageHeader = new MessageHeader(); messageHeader.setServiceID(serviceID); messageHeader.setProtocolVersion("3.0"); messageHeader.setMessageClass( MessageClassType.DEVICE ); messageHeader.setPOIID(POIID); messageHeader.setMessageType( MessageType.REQUEST ); messageHeader.setSaleID(saleID); messageHeader.setMessageCategory( MessageCategoryType.DISPLAY ); saleToPOIRequest.setMessageHeader(messageHeader); terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest); ``` 3. In the display response, check the [OutputResult](https://docs.adyen.com/api-explorer/terminal-api/latest/post/display#responses-200-OutputResult).\ If the request is successful, this includes `Response.Result`: **Success**. **Display response** ```json { "SaleToPOIResponse":{ "DisplayResponse":{ "OutputResult":[ { "InfoQualify":"Display", "Device":"CustomerDisplay", "Response":{ "Result":"Success" } } ] }, "MessageHeader":{...} } } ``` If the request is not successful, the `DisplayResponse.OutputResult` includes: * `Response.Result`: **Failure**. * `AdditionalResponse` and `ErrorCondition`: more information about why the request failed. See [XML validation](#validation) for information about how errors in the XML content are reported.\ The next example shows the response after sending the display request to an incompatible terminal. **Response for a failed display request** ```json { "SaleToPOIResponse":{ "DisplayResponse":{ "OutputResult":[ { "Device":"CustomerDisplay", "InfoQualify":"Display", "Response":{ "Result":"Failure", "AdditionalResponse":"message=DisplayRequest%20API%20cannot%20be%20used%20for%20this%20terminal%20model.", "ErrorCondition":"NotAllowed" } } ] }, "MessageHeader":{...} } } ``` ## XML validation When we receive your display request for a virtual receipt, we check whether we can parse the XML content. We can also check whether the XML content matches the XML Schema Definition (XSD). We only do this XSD check if it is enabled for your account. * **Parsing**\ We always check whether we can parse the XML content of your request. For example, if the XML contains a syntax error like a missing caret `>`, we cannot parse the XML. You receive a failure response with *XHTML data could not be parsed*. **XHTML data could not be parsed** ```json { ... "Response": { "AdditionalResponse": "message=XHTML%20data%20could%20not%20be%20parsed.", "ErrorCondition": "MessageFormat", "Result": "Failure" } } ``` * **XSD**\ If we can parse the XML content and XSD checking is enabled, we validate the XML against the XSD. To use this validation, ask our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to enable the virtual receipt XSD check. For example, if you add an element that is not in the XSD or if you omit a required element, the XML doesn't match the XSD. You receive a failure response with *XSD validation failed*. **XSD validation failed** ```json { ... "Response": { "AdditionalResponse": "message=XSD%20validation%20failed.", "ErrorCondition": "MessageFormat", "Result": "Failure" } } ``` The details of any XSD errors are in the terminal log. ## See also * [Set the display to standby](/point-of-sale/shopper-engagement/display-data/idle-display) * [Show a QR code on the display](/point-of-sale/shopper-engagement/display-data/display-qr-code) * [Show an image on the display](/point-of-sale/shopper-engagement/display-data/display-image)