> ## Documentation Index
> Fetch the complete documentation index at: https://adyen-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Ask to Select One or More Answers from a List

> Use an input request to ask a multiple-choice question and allow more than one answer.

## Single-answer option

For cases where you require the user to select only one option, you can use a [single-answer question](https://adyen-preview.mintlify.site/point-of-sale/shopper-engagement/shopper-input/menu.md).

We describe here how you can use an input request to ask the shopper a question and allow them to select more than one answer. You can use this, for example, to create a customer survey. You can show a header (your question) and up to 15 scrollable option buttons. Each option button can contain one text line.

## Requirements

Before you begin, take into account the following requirement.

| Requirement | Description |
| - | - |
| **Integration type** | A [Terminal API integration](https://adyen-preview.mintlify.site/point-of-sale/get-started) with payment terminals. |

## How it works

When you use a **MenuButtons** `InputRequest`, the terminal prompts the shopper to answer a question that allows them to select multiple answers. The terminal continues to show your input request until one of these events occurs:

* The user has provided input.
* The maximum input time expires. You can set this time in the request.
* On the terminal, **Cancel** **![](https://docs.adyen.com/images/2/8/a/f/d/28afd7de9550252a516d854a8d4a34ce726d7ba1-cancel2x.png)** is selected.
* The terminal receives a [request to cancel collecting input](https://adyen-preview.mintlify.site/point-of-sale/shopper-engagement/shopper-input/cancel-input.md) or any other request from the POS app.

### Examples

This example shows a list where the shopper can select more than one of the answers on a portrait, small portrait, and landscape display

![](https://docs.adyen.com/images/3/0/4/4/c/3044c24f2da7016dc39f3a2413a1dbd52521093f-screen-enmultiselectportrait.png)

![](https://docs.adyen.com/images/4/b/1/4/4/4b1441093c239c71723abc1699d0f978f080355b-screen-enmultiselect285.png)

![](https://docs.adyen.com/images/e/1/6/5/f/e165fe25bb9421f7dc98525f0c2b61372b04cbc4-screen-enmultiselectlandscape.png)

## Make a multiple-answers MenuButtons input request

We support two **MenuButtons** input requests:

* [Multiple choice—single answer](https://adyen-preview.mintlify.site/point-of-sale/shopper-engagement/shopper-input/menu.md): ensures no more than one answer is selected.
* Multiple choice—multiple answers: allows selecting more than one answer.

To enable the selection of multiple answers, your request needs to include the `MinLength` or `MaxLength` parameters.

To use the payment terminal to show a menu that allows the user to select more than one option:

1. Make a [Terminal API](https://adyen-preview.mintlify.site/point-of-sale/design-your-integration/terminal-api) input request, specifying:

   * The standard [`SaleToPOIRequest.MessageHeader` ](https://adyen-preview.mintlify.site/point-of-sale/design-your-integration/terminal-api#request-message-header)object, with `MessageClass` set to **Device** and `MessageCategory` set to **Input**.

     | Parameter | Required | Description |
     | - | - | - |
     | `ProtocolVersion` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | **3.0** |
     | `MessageClass` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | **Device** |
     | `MessageCategory` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | **Input** |
     | `MessageType` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | **Request** |
     | `ServiceID` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | 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-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | Your unique ID for the system where you send this request from. |
     | `POIID` | ![-white\_check\_mark-](https://docs.adyen.com/user/data/smileys/emoji/white_check_mark.png) | The unique ID of the terminal to send this request to. Format: *\[device model]-\[serial number]*. The [InputRequest.DisplayOutput](https://docs.adyen.com/api-explorer/terminal-api/latest/post/input#request-DisplayOutput) object to define what is shown on the terminal: |

     | Parameter | Description |
     | - | - |
     | `Device` | **CustomerDisplay** |
     | `InfoQualify` | **Display** |
     | `OutputContent.OutputFormat` | **Text** |
     | `OutputContent.PredefinedContent.ReferenceID` | **MenuButtons** |
     | `OutputContent.OutputText` | An array of one `Text` field to specify the header. For example, to ask a multiple-choice question. The [InputRequest.DisplayOutput.MenuEntry](https://docs.adyen.com/api-explorer/terminal-api/latest/post/input#request-DisplayOutput-MenuEntry) array of up to 15 items representing the options to choose from. The terminal shows these items as a scrollable list of buttons that the user can tap to select. Each item in the array has: |

     | Parameter | Description |
     | - | - |
     | `OutputFormat` | **Text** |
     | `OutputText` | An array of one `Text` field to specify the answer or menu button. The [InputRequest.InputData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/input#request-InputData) object to handle the user input: |

     | Parameter | Description |
     | - | - |
     | `Device` | **CustomerInput** |
     | `InfoQualify` | **Input** |
     | `InputCommand` | **GetMenuEntry** |
     | `MaxInputTime` | (Integer) Time-out in seconds. This is the time that the user gets to finish their input. |
     | `MinLength` | The minimum number of answers the user must select. |
     | `MaxLength` | The maximum number of answers the user is allowed to select. |

     To allow selecting multiple answers, you must include the `MinLength` or `MaxLength` parameters.

   The following example asks the shopper to select options from a list.

   #### JSON

   ```json theme={null}
   {
       "SaleToPOIRequest":{
           "MessageHeader":{
               "ProtocolVersion":"3.0",
               "MessageClass":"Device",
               "MessageCategory":"Input",
               "MessageType":"Request",
               "ServiceID":"0207111104",
               "SaleID":"POSSystemID12345",
               "POIID":"V400m-324688179"
           },
           "InputRequest":{
               "DisplayOutput":{
                   "Device":"CustomerDisplay",
                   "InfoQualify":"Display",
                   "OutputContent":{
                       "OutputFormat":"Text",
                       "PredefinedContent":{
                           "ReferenceID":"MenuButtons"
                       },
                       "OutputText":[
                           {
                               "Text": "Subscribe to the following channels?"
                           }
                       ]
                   },
                   "MenuEntry": [
                       {
                           "OutputFormat": "Text",
                           "OutputText": [
                               {
                                   "Text": "Email"
                               }
                           ]
                       },
                       {
                           "OutputFormat": "Text",
                           "OutputText": [
                               {
                                   "Text": "SMS"
                               }
                           ]
                       },
                       {
                           "OutputFormat": "Text",
                           "OutputText": [
                               {
                                   "Text": "Post"
                               }
                           ]
                       }
                   ]
               },
               "InputData": {
                   "Device": "CustomerInput",
                   "InfoQualify": "Input",
                   "InputCommand": "GetMenuEntry",
                   "MaxInputTime": 60,
                   "MinLength": 0,
                   "MaxLength": 3
               }
           }
       }
   }
   ```

   #### Java

   ```java theme={null}
   SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest();
   MessageHeader messageHeader = new MessageHeader();
   saleToPOIRequest.setMessageHeader(messageHeader);

   InputRequest inputRequest = new InputRequest();
   DisplayOutput displayOutput = new DisplayOutput();
   displayOutput.setDevice( DeviceType.CUSTOMER_DISPLAY );
   displayOutput.setInfoQualify( InfoQualifyType.DISPLAY );
   OutputContent outputContent = new OutputContent();
   outputContent.setOutputFormat( OutputFormatType.TEXT );
   PredefinedContent predefinedContent = new PredefinedContent();
   predefinedContent.setReferenceID("MenuButtons");
   outputContent.setPredefinedContent(predefinedContent);
   OutputText headerLine1 = new OutputText();
   headerLine1.setText("Subscribe to the following channels?");
   outputContent.getOutputText().add(headerLine1);
   displayOutput.setOutputContent(outputContent);

   MenuEntry menuEntry1 = new MenuEntry();
   menuEntry1.setOutputFormat( OutputFormatType.TEXT );
   OutputText option1Line1 = new OutputText();
   option1Line1.setText("Email");
   menuEntry1.getOutputText().add(option1Line1);
   displayOutput.getMenuEntry().add(menuEntry1);

   MenuEntry menuEntry2 = new MenuEntry();
   menuEntry2.setOutputFormat( OutputFormatType.TEXT );
   OutputText option2Line1 = new OutputText();
   option2Line1.setText("SMS");
   menuEntry2.getOutputText().add(option2Line1);
   displayOutput.getMenuEntry().add(menuEntry2);

   MenuEntry menuEntry3 = new MenuEntry();
   menuEntry3.setOutputFormat( OutputFormatType.TEXT );
   OutputText option3Line1 = new OutputText();
   option3Line1.setText("Post");
   menuEntry3.getOutputText().add(option3Line1);
   displayOutput.getMenuEntry().add(menuEntry3);

   inputRequest.setDisplayOutput(displayOutput);

   InputData inputData = new InputData();
   inputData.setDevice( DeviceType.CUSTOMER_INPUT );
   inputData.setInfoQualify( InfoQualifyType.INPUT );
   inputData.setInputCommand( InputCommandType.GET_MENU_ENTRY );
   inputData.setMaxInputTime( BigInteger.valueOf(60) );
   inputData.setMinLength( Integer.valueOf(0) );
   inputData.setMaxLength( Integer.valueOf(3) );
   inputRequest.setInputData(inputData);
   saleToPOIRequest.setInputRequest(inputRequest);
   terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest);
   ```

2. Wait for the user to supply the requested input.

   If input is received from the terminal, the input response includes an [InputResult](https://docs.adyen.com/api-explorer/terminal-api/latest/post/input#responses-200-InputResult) object with:

   * `Input.MenuEntryNumber`: An array that indicates the options that the user selected. For example, if the shopper selects the first and third options, the first and third items in the array are `1` and all other array items are `0`.

   **Example response when the shopper selects the first and third options**

   ```json theme={null}
   {
    "SaleToPOIResponse": {
        "InputResponse": {
            "InputResult": {
                "Device": "CustomerInput",
                "InfoQualify": "Input",
                "Input": {
                    "InputCommand": "GetMenuEntry",
                    "MenuEntryNumber": [
                        1,
                        0,
                        1
                    ]
                },
                "Response": {
                    "AdditionalResponse": "outputTextWarning=The%20number%20of%20usable%20button%20text%20fields%20is%20three.",
                    "Result": "Success"
                }
            },
            "OutputResult": {
                "Device": "CustomerDisplay",
                "InfoQualify": "Display",
                "Response": {
                    "Result": "Success"
                }
            }
        },
        "MessageHeader": {
            "ProtocolVersion":"3.0",
            "MessageClass":"Device",
            "MessageCategory":"Input",
            "MessageType":"Request",
            "ServiceID":"0207111104",
            "SaleID":"POSSystemID12345",
            "POIID":"V400m-324688179"
        }
    }
   }
   ```

   * If the user selects fewer than the minimum number of answers specified in the `MinLength` parameter or more than the maximum number of answers specified in the `MaxLength` parameter, the response contains:

     * `InputResult.Response.Result`: **Failure**

     * `Response.ErrorCondition`: **NotAllowed**

     * `AdditionalResponse`: contains the message *The number of selections are below the MinLength* or *The number of selections are above the MaxLength*.

   * If the input request times out, you receive an [`EventNotification` ](https://adyen-preview.mintlify.site/point-of-sale/design-your-integration/notifications/event-notifications)with `EventDetails`: **message=Did+not+receive+a+response+from+the+POI.**

   * If you make a payment request while the input request is waiting for input on the terminal, the payment request overrides the input request. The `InputResult` has `Response.Result`: **Failure**, `Response.ErrorCondition`: **Busy**, and an `AdditionalResponse` containing the message *A higher priority request has been received*.

   * If the user declined to respond (selected the **Cancel** key **![](https://docs.adyen.com/images/2/8/a/f/d/28afd7de9550252a516d854a8d4a34ce726d7ba1-cancel2x.png)**), the `InputResult` has `Response.Result`: **Failure** and `Response.ErrorCondition`: **Cancel**.

3. Pass the relevant data from `InputResult.Input` to your system for validation and further use.

## See also

* [Multiple choice - single answer](https://adyen-preview.mintlify.site/point-of-sale/shopper-engagement/shopper-input/menu.md)
* [Cancel an input request](https://adyen-preview.mintlify.site/point-of-sale/shopper-engagement/shopper-input/cancel-input.md)
* [Ask for another type of input](https://adyen-preview.mintlify.site/point-of-sale/shopper-engagement/shopper-input#select-an-input-request)
* [Create a session](https://adyen-preview.mintlify.site/point-of-sale/shopper-engagement/create-session.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.