# Settlement

<mark style="color:green;">`POST`</mark> `https://api.sensepass.com/api/settlements/all`

#### Request Body

<table><thead><tr><th width="197">Name</th><th width="130">Type</th><th>Description</th></tr></thead><tbody><tr><td>deviceId</td><td>string</td><td>Terminal unique device ID provided by SensePass (For Device based Transactions) - Required if apiKey is empty</td></tr><tr><td>apiKey</td><td>string</td><td>Merchant ID provided by SensePass (For Web based Transactions) - Required if deviceId is empty</td></tr><tr><td>startDate<mark style="color:red;">*</mark></td><td>string</td><td>2024-01-01T12:00:00Z</td></tr><tr><td>endDate<mark style="color:red;">*</mark></td><td>string</td><td>2024-02-01T12:00:00Z</td></tr><tr><td>status</td><td>string</td><td>settled/expired/voided</td></tr><tr><td>paymentMethod</td><td>string</td><td>Sensepass payment method name</td></tr><tr><td>currency</td><td>string</td><td>currency Iso code</td></tr><tr><td>pagination.limit</td><td>number</td><td>limit the number of records returned (between  1 and 1000)</td></tr><tr><td>pagination.offset</td><td>number</td><td>skip N amount of records</td></tr><tr><td>orderBy</td><td>string</td><td><p>column to sort the results by:</p><pre><code>status/paymentMethod/settlementAmount/fee/submitDate/settlementDate/transactionNumber/pmTransId/cardType
</code></pre><p>default: submitDate<br></p></td></tr><tr><td>filter[]</td><td>FilterData</td><td>filter query rows by array of conditions</td></tr></tbody></table>

FilterData

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>parmeter</td><td>KeyValue</td><td>any custom data to filter by:<br>E.G: "name":"Joe"</td></tr><tr><td>operator</td><td>string</td><td><p></p><pre><code>'=', '!=', '&#x3C;', '&#x3C;=', '>', '>='
</code></pre></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

#### Example Request

```
{
   "startDate": "2024-01-01T00:00:00Z",
    "endDate": "2024-06-01T00:00:00Z",
    "apikey": "myApiKey",
    "pagination": {
        "limit": "40",
        "offset": "0"
    },
    "orderBy": "settlementAmount",
    "filter": [{"accountId": "1000635", "operator": "!="}, {"age": "10", "operator": ">"}  ]    
}
```

**Response**

**Pagination data** [Settlement Report Model](/sensepay/transaction-api/models/settlement-report-model.md)

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

<pre class="language-json"><code class="lang-json"><strong>{ "pagination": {
</strong><strong>    "returnedRecords": 2,
</strong><strong>    "totalRecords": 2
</strong><strong>    "isPartialResult": "false"
</strong><strong>  },
</strong><strong>  "data": [
</strong>    {
        "status": "settled",
        "paymentMethod": "Authorize.Net",
        "settlementAmount": "10.21",
        "fee": null,
        "submitDate": "2024-03-27T13:29:07.200Z",
        "settlementDate": "2024-01-04T05:06:18.377Z",
        "transactionNumber": "c7bc37546cf53aa42fa4e2838bbda9cd355e99e680a7715fc4d85dc6",
        "pmTransId": "120012947718",
        "cardType": "MasterCard",
        "settlementCurrency": "USD"
    },
    {
        "status": "expired",
        "paymentMethod": "Authorize.Net",
        "settlementAmount": "12.79",
        "fee": null,
        "submitDate": "2024-03-27T13:29:07.404Z",
        "settlementDate": "2023-12-28T07:40:19.838Z",
        "transactionNumber": "4afa7ca11746f1e9b89ee05b56db6463728752a2a486893a6f44766a",
        "pmTransId": "120012495576",
        "cardType": "MasterCard",
        "settlementCurrency": "USD"
    }
    ]
</code></pre>

{% endtab %}

{% tab title="400" %}

```json
{
}
```

{% 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/settlement.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.
