Are you looking for test card numbers?

Would you like to contact support?

Point-of-sale icon

Print data on the terminal

Print text, QR codes, or images on the payment terminal outside of the payment flow.

A print request allows you to initiate printing on the payment terminal from your POS app outside of a payment flow. You can print text, QR codes, or images. It's not possible to print barcode formats such as EAN-8, EAN-13, UPC-A, Code 25, Code 128 or PDF417.

Here are some examples of how you can use print requests:

  • In a Pay at Table flow, print the bill on the terminal before sending a payment request. This lets the customers decide if they want to split the bill, and how they want to pay.
  • Print entry tickets at a festival.
  • In a quick-service restaurant, print a receipt that allows customers to pick up their order at the counter.
  • Print a QR code with a URL to join your loyalty program or to download an app.

If you want to combine text with a QR code, you need to make two consecutive print requests. There is no prompt to tear off the paper following a print request (like after printing a shopper receipt), so you are able to give the shopper a single slip of paper.

A print request only works on payment terminals with a built-in printer. You can use these models:

  • V240m Plus (in Brazil)
  • V400c Plus
  • V400m
  • S1F2

To use the payment terminal to print text content:

  • Make a POST request to a Terminal API endpoint, specifying:

    Parameter Required Description
    ProtocolVersion -white_check_mark- 3.0
    MessageClass -white_check_mark- Device
    MessageCategory -white_check_mark- Print
    MessageType -white_check_mark- Request
    ServiceID -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- Your unique ID for the POS system component to send this request from.
    POIID -white_check_mark- The unique ID of the terminal to send this request to. Format: [device model]-[serial number].
    • PrintRequest.PrintOutput: the request body. Specify:

      Parameter Required Description
      DocumentQualifier -white_check_mark- Document
      ResponseMode -white_check_mark- PrintEnd
      OutputContent.OutputFormat -white_check_mark- Text
      OutputContent.OutputText -white_check_mark- An array with one or more array items containing the text you want to print.

      Each OutputText array item can have:

      Parameter Required Description
      CharacterStyle Allowed values: Normal, Bold, Underline. If not specified, defaults to Normal.
      Alignment Allowed values: Left, Centred, Justified, Right. If not specified, defaults to Left.
      EndOfLineFlag If not specified, defaults to true. Use false if you want the next array item to continue on the same line.
      Text -white_check_mark- The text you want to print in this array element. For a blank line, specify an empty value.

    Select the tabs below to see how you can use the parameters to print a receipt (with a header, line items, and a footer) or a document (with a title, headings, and paragraphs).

    {
      "SaleToPOIRequest": {
        "MessageHeader": {
          "ProtocolVersion": "3.0",
          "MessageClass": "Device",
          "MessageCategory":"Print",
          "MessageType": "Request",
          "ServiceID": "050824",
          "SaleID": "POSSystemID12345",
          "POIID": "V400m-346403161"
        },
        "PrintRequest": {
          "PrintOutput": {
            "DocumentQualifier": "Document",
            "ResponseMode": "PrintEnd",
            "OutputContent": {
              "OutputFormat": "Text",
              "OutputText": [
                {
                  "CharacterStyle": "Bold",
                  "Alignment": "Centred",
                  "EndOfLineFlag": true,
                  "Text": "THIS IS THE TITLE"
                },
                {
                  "Alignment": "Centred",
                  "EndOfLineFlag": true,
                  "Text": ""
                },
                {
                  "Alignment": "Left",
                  "EndOfLineFlag": false,
                  "Text": "This is key-1"
                },
                {
                  "Alignment": "Right",
                  "EndOfLineFlag": true,
                  "Text": "value-1"
                },
                {
                  "Alignment": "Left",
                  "EndOfLineFlag": false,
                  "Text": "This is key-2"
                },
                {
                  "Alignment": "Right",
                  "EndOfLineFlag": true,
                  "Text": "value-2"
                },
                {
                  "Alignment": "Left",
                  "EndOfLineFlag": false,
                  "Text": "This is key-3"
                },
                {
                  "Alignment": "Right",
                  "EndOfLineFlag": true,
                  "Text": "value-3"
                },
                {
                  "Alignment": "Left",
                  "EndOfLineFlag": true,
                  "Text": "Some explanation about the receipt (# %^& @/: $ £ EUR )"
                },
                {
                  "Alignment": "Centred",
                  "EndOfLineFlag": true,
                  "Text": ""
                },
                {
                  "CharacterStyle": "Bold",
                  "Alignment": "Centred",
                  "EndOfLineFlag": true,
                  "Text": "This is the footer"
                }
              ]
            }
          }
        }
      }
    }

    You receive a PrintResponse with:

    • DocumentQualifier: Document
    • Response.Result: Success
    Response for printing text
    {
       "SaleToPOIResponse": {
          "PrintResponse": {
             "DocumentQualifier": "Document",
             "Response": {
                "Result": "Success"
             }
          },
          "MessageHeader": {
             "MessageCategory": "Print",
             "MessageClass": "Device",
             "MessageType": "Response",
             "POIID": "V400m-346403161",
             "ProtocolVersion": "3.0",
             "SaleID": "POSSystemID12345",
             "ServiceID": "050823"
          }
       }
    }

To use the payment terminal to print a QR code that the shopper can scan with their mobile device:

  1. If the QR code needs to contain more than just a URL, convert the content to a URL-encoded string. You'll need to specify the URL-encoded string in the print request.

    For example, if the QR code should have this content:

    Visit www.adyen.com/pos-payments and:
    - Learn about the features we support
    - Choose from a range of terminals

    The resulting URL-encoded string will look like this:

    Visit%20www.adyen.com%2Fpos-payments%20and%3A%0A-%20Learn%20about%20the%20features%20we%20support%0A-%20Choose%20from%20a%20range%20of%20terminals

    If the QR code needs to contain only a URL, for example https://www.adyen.com/pos-payments, there is no need to URL-encode that. You'll specify the URL in the print request as a plain text string.

  2. Make a POST request to a Terminal API endpoint, specifying:

    Parameter Required Description
    MessageClass -white_check_mark- Device
    MessageCategory -white_check_mark- Print
    • PrintRequest.PrintOutput: the request body. Specify:

      Parameter Required Description
      DocumentQualifier -white_check_mark- CustomerReceipt
      ResponseMode -white_check_mark- PrintEnd
      OutputContent.OutputFormat -white_check_mark- BarCode
      OutputContent.OutputBarcode.BarcodeType -white_check_mark- QRCode
      OutputContent.OutputBarcode.BarcodeValue -white_check_mark- The content of the QR code: a URL specified as a plain text string or a URL encoded string.
    {
        "SaleToPOIRequest": {
            "MessageHeader": {
                "ProtocolVersion": "3.0",
                "MessageClass": "Device",
                "MessageCategory": "Print",
                "MessageType": "Request",
                "ServiceID": "050817",
                "SaleID": "POSSystemID12345",
                "POIID": "V400m-346403161"
            },
            "PrintRequest": {
                "PrintOutput": {
                    "DocumentQualifier": "CustomerReceipt",
                    "ResponseMode": "PrintEnd",
                    "OutputContent": {
                        "OutputFormat":"BarCode",
                        "OutputBarcode": {
                            "BarcodeType": "QRCode",
                            "BarcodeValue": "https://www.adyen.com/pos-payments"
                        }
                    }
                }
            }
        }
    }
    String serviceID = "YOUR_UNIQUE_ATTEMPT_ID";
    String saleID = "YOUR_CASH_REGISTER_ID";
    String POIID = "YOUR_TERMINAL_ID";
    
    SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest();
    PrintRequest printRequest = new PrintRequest();
    PrintOutput printOutput = new PrintOutput();
    printOutput.setDocumentQualifier( DocumentQualifierType.CUSTOMERRRECEIPT );
    printOutput.setResponseMode( ResponseModeType.PRINTEND );
    OutputContent outputContent = new OutputContent();
    outputContent.setOutputFormat( OutputFormatType.BARCODE );
    OutputBarcode outputBarcode = new OutputBarcode();
    outputBarcode.setBarcodeType( BarcodeTypeType.QRCODE );
    outputBarcode.setBarcodeValue( "https://www.adyen.com/pos-payments" )
    outputContent.setOutputBarcode(outputBarcode);
    printOutput.setOutputContent(outputContent);
    printRequest.setPrintOutput(printOutput);
    saleToPOIRequest.setPrintRequest(printRequest);
    
    MessageHeader messageHeader = new MessageHeader();
    messageHeader.setProtocolVersion("3.0");
    messageHeader.setMessageClass( MessageClassType.DEVICE );
    messageHeader.setMessageCategory( MessageCategoryType.PRINT );
    messageHeader.setMessageType( MessageType.REQUEST );
    messageHeader.setServiceID(serviceID);
    messageHeader.setSaleID(saleID);
    messageHeader.setPOIID(POIID);
    saleToPOIRequest.setMessageHeader(messageHeader);
    terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest);

    You receive a print response with:

    • DocumentQualifier: CustomerReceipt
    • Response.Result: Success
    Response for printing a QR code
    {
       "SaleToPOIResponse": {
          "PrintResponse": {
             "DocumentQualifier": "CustomerReceipt",
             "Response": {
                "Result": "Success"
             }
          },
          "MessageHeader": {
             "MessageCategory": "Print",
             "MessageClass": "Device",
             "MessageType": "Response",
             "POIID": "V400m-34640316",
             "ProtocolVersion": "3.0",
             "SaleID": "POSSystemID12345",
             "ServiceID": "050817"
          }
       }
    }

To use the payment terminal to print a PNG image:

  1. Convert the PNG image to a Base64-encoded string.

    The size limit of the image is 102400 bytes. Therefore, we recommend using 1-bit grayscale images with a maximum width of 384 pixels.

  2. In the XML code sample below, replace <IMAGE_DATA> with the Base64-encoded string.

    XML code sample
    <?xml version="1.0" encoding="UTF-8"?>
    <img src="data:image/png;base64, <IMAGE_DATA>"/>

    You must include a space between <img src="data:image/png;base64, and the Base64-encoded <IMAGE_DATA>.

  3. Convert the whole XML code sample, including the already Base64-encoded image, to a Base64-encoded string.

  4. Make a POST request to a Terminal API endpoint, specifying:

    Parameter Required Description
    MessageClass -white_check_mark- Device
    MessageCategory -white_check_mark- Print
    • PrintRequest.PrintOutput: the request body. Specify:

      Parameter Required Description
      DocumentQualifier -white_check_mark- Document
      ResponseMode -white_check_mark- PrintEnd
      OutputContent.OutputFormat -white_check_mark- XHTML
      OutputContent.OutputXHTML -white_check_mark- The Base64-encoded XML code sample with the image data.
    Print request
    {
       "SaleToPOIRequest": {
          "MessageHeader": {
             "ProtocolVersion": "3.0",
             "MessageClass": "Device",
             "MessageCategory": "Print",
             "MessageType": "Request",
             "ServiceID": "050831",
             "SaleID": "POSSystemID12345",
             "POIID": "V400m-34640316"
          },
          "PrintRequest": {
             "PrintOutput": {
                "DocumentQualifier": "Document",
                "ResponseMode": "PrintEnd",
                "OutputContent": {
                   "OutputFormat": "XHTML",
                   "OutputXHTML": "PD94bWwgdmVyc2...NUNZSUk9Ii8+"
                }
             }
          }
       }
    }
  5. You receive a PrintResponse with:

    • DocumentQualifier: Document
    • Response.Result: Success
    Response for printing an image
    {
       "SaleToPOIResponse": {
          "PrintResponse":{
             "DocumentQualifier": "Document",
             "Response": {
                "Result": "Success"
             }
          },
          "MessageHeader": {
             "MessageCategory": "Print",
             "MessageClass": "Device",
             "MessageType": "Response",
             "POIID": "V400m-34640316",
             "ProtocolVersion": "3.0",
             "SaleID": "POSSystemID12345",
             "ServiceID": "050831"
          }
       }
    }

See also