# Customer Input

API for retrieving input from consumer using SensePass Tags and EMV devices.

### API Interface

## Get customer input

<mark style="color:green;">`POST`</mark> `https://api.sensepass.com/api/transactions/customer-input`

For terminal agent invoke use this endpoint: <http://localhost:8003/api/transactions/customer-input>

#### Request Body

| Name                                       | Type   | Description                                                                                                                |
| ------------------------------------------ | ------ | -------------------------------------------------------------------------------------------------------------------------- |
| deviceId<mark style="color:red;">\*</mark> | string | unique device ID provided by SensePass                                                                                     |
| inputs<mark style="color:red;">\*</mark>   | array  | Array of [customer-input-model](https://docs.sensepass.com/sensepay/transaction-api/models/customer-input-model "mention") |

{% tabs %}
{% tab title="200: OK OK" %}
**See Transactions entity schema:** [#transaction-entity](https://docs.sensepass.com/sensepay/models/transaction-model#transaction-entity "mention")

```javascript
{
  "success": true,
  "error": null,
  "results": [
    {
      "type": "email",
      "question": "Please input your email address",
      "input": "a@b.com"
    },
    {
      "type": "phone",
      "minimumLength": 10,
      "question": "Please input your phone number",
      "input": "1234567890"
    }
  ]
}    
```

{% endtab %}

{% tab title="400: Bad Request Invalid Input" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error Internal Error" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

###

### Example - Simple Questions

```json
{
  "deviceId": "Your-Device-ID",
  "inputs": [
    {
      "type": "email",
      "question": "Please input your email address"
    },
    {
      "type": "phone",
      "minimumLength": 10,
      "question": "Please input your phone number"
    }
  ]
}
```

### Example - Yes/No Questions

```json
{
  "deviceId": "Your-Device-ID",
  "inputs": [
    {
      "type": "boolean",
      "question": "Please verify your email address is a@b.c",
      "acceptText": "Yes",
      "rejectText": "No"
    }
  ]
}
```

### Clear all questions on device

## Clear customer input

<mark style="color:green;">`POST`</mark> `https://api.sensepass.com/api/transactions/customer-input/reset`

For terminal agent invoke use this endpoint:&#x20;

<http://localhost:8003/api/transactions/customer-input/reset>

#### Request Body

| Name                                       | Type   | Description                            |
| ------------------------------------------ | ------ | -------------------------------------- |
| deviceId<mark style="color:red;">\*</mark> | string | unique device ID provided by SensePass |

{% tabs %}
{% tab title="200: OK OK" %}

```javascript
{
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid Input" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error Internal Error" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

###
