# 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](/sensepay/transaction-api/models/customer-input-model.md) |

{% tabs %}
{% tab title="200: OK OK" %}
**See Transactions entity schema:** [Transaction Model](/sensepay/transaction-api/models/transaction-model.md#transaction-entity)

```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 %}

###


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sensepass.com/sensepay/transaction-api/other-flows/customer-input.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
