Search

Are you looking for test card numbers?

Would you like to contact support?

Point-of-sale icon

Print data on the terminal

Print a receipt or other text, or QR code on the payment terminal outside of the payment flow.

A print request allows you to initiate printing on the payment terminal from the cash register outside of a payment. You can print either text, or a QR code that the shopper can scan with their mobile device.

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

  • In a Pay at Table flow, print the bill on the terminal before sending a payment request. This enables the customers to decide whether 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 and a QR code, you'd need to make two subsequent print requests. There's no prompt to tear off the paper after each print request, so you'd be able to give the shopper a single receipt slip.

Of course a print request only works on a payment terminal that has a built-in printer. You can use these models:

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

To use the payment terminal to print text content:

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

    • MessageHeader: The standard MessageHeader structure, explained in Terminal API fundamentals:
      Parameter Required Description
      ProtocolVersion -white_check_mark- 3.0
      MessageClass -white_check_mark- Device
      MessageCategory -white_check_mark- Print
      MessageType -white_check_mark- Request
      SaleID -white_check_mark- Your unique ID for the cash register.
      ServiceID -white_check_mark- Your unique ID for this request, consisting of 1-10 alphanumeric characters. This value needs to be unique within the last 48 hours.
      POIID -white_check_mark- Unique ID of the terminal that you want to route this request to. Format: [device model]-[serial number].
    • PrintRequest.PrintOutput: The request body with:

      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 (# %^& @/: $ £ €)"
                },
                {
                  "Alignment": "Centred",
                  "EndOfLineFlag": true,
                  "Text": ""
                },
                {
                  "CharacterStyle": "Bold",
                  "Alignment": "Centred",
                  "EndOfLineFlag": true,
                  "Text": "This is the footer"
                }
              ]
            }
          }
        }
      }
    }
    
    {
      "SaleToPOIRequest": {
        "MessageHeader": {
          "ProtocolVersion": "3.0",
          "MessageClass": "Device",
          "MessageCategory":"Print",
          "MessageType": "Request",
          "ServiceID": "050823",
          "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"
                },
                {
                  "CharacterStyle": "Normal",
                  "Alignment": "Centred",
                  "EndOfLineFlag": true,
                  "Text": "This is the subtitle"
                },
                {
                  "Alignment": "Centred",
                  "EndOfLineFlag": true,
                  "Text": ""
                },
                {
                  "CharacterStyle": "Underline",
                  "Alignment": "Left",
                  "EndOfLineFlag": true,
                  "Text": "This is a heading"
                },
                {
                  "Alignment": "Left",
                  "EndOfLineFlag": true,
                  "Text": "Normal left-aligned text belonging to the header above."
                },
                {
                  "CharacterStyle": "Underline",
                  "Alignment": "Left",
                  "EndOfLineFlag": true,
                  "Text": "Another heading"
                },
                {
                  "Alignment": "Left",
                  "EndOfLineFlag": true,
                  "Text": "Normal left-aligned text belonging to the header above."
                },
                {
                  "Alignment": "Left",
                  "EndOfLineFlag": false,
                  "Text": "This is the key"
                },
                {
                  "Alignment": "Right",
                  "EndOfLineFlag": true,
                  "Text": "value"
                },
                {
                  "Alignment": "Left",
                  "EndOfLineFlag": false,
                  "Text": "This is the key"
                },
                {
                  "Alignment": "Right",
                  "EndOfLineFlag": true,
                  "Text": "value"
                },
                {
                  "Alignment": "Left",
                  "EndOfLineFlag": true,
                  "Text": ""
                },
                {
                  "Alignment": "Justified",
                  "EndOfLineFlag": true,
                  "Text": "Normal justified text flush with the left and right margins."
                },
                {
                  "Alignment": "Left",
                  "EndOfLineFlag": true,
                  "Text": "For comparison, here you have some normal left-aligned text."
                },
                {
                  "Alignment": "Left",
                  "EndOfLineFlag": true,
                  "Text": ""
                },
                {
                  "CharacterStyle": "Bold",
                  "Alignment": "Left",
                  "EndOfLineFlag": true,
                  "Text": "This is bold left-aligned text."
                },
                {
                  "Alignment": "Centred",
                  "EndOfLineFlag": true,
                  "Text": ""
                },
                {
                  "CharacterStyle": "Bold",
                  "Alignment": "Centred",
                  "EndOfLineFlag": true,
                  "Text": "This is the footer"
                }
              ]
            }
          }
        }
      }
    }

    You receive a print response with:

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

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

  1. Decide what the QR code needs to contain.

    • Only a URL: You don't need to do anything now. You will be specifying this as a plain text string in the print request.
    • More than just a URL: Write the content and convert this to a URL encoded string.

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

    • MessageHeader: The standard MessageHeader structure, explained in Terminal API fundamentals:
      Parameter Required Description
      ProtocolVersion -white_check_mark- 3.0
      MessageClass -white_check_mark- Device
      MessageCategory -white_check_mark- Print
      MessageType -white_check_mark- Request
      SaleID -white_check_mark- Your unique ID for the cash register.
      ServiceID -white_check_mark- Your unique ID for this request, consisting of 1-10 alphanumeric characters. This value needs to be unique within the last 48 hours.
      POIID -white_check_mark- Unique ID of the terminal that you want to route this request to. Format: [device model]-[serial number].
    • PrintRequest.PrintOutput: The request body with:

      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, 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
    {
        "SaleToPOIResponse": {
            "PrintResponse": {
                "DocumentQualifier": "CustomerReceipt",
                "Response": {
                    "Result": "Success"
                }
            },
            "MessageHeader": {
                "ProtocolVersion": "3.0",
                "SaleID": "POSSystemID12345",
                "MessageClass": "Device",
                "MessageCategory": "Print",
                "ServiceID": "050817",
                "POIID": "V400m-346403161",
                "MessageType": "Response"
            }
        }
    }

See also