# settlementHistory

**POST api/settlementHistory**

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

```json
{
    "till": 12345,
    "limit": 10,
    "filterTransactions": false,
    "filter": "all"
}
```

{% endtab %}

{% tab title="200 OK" %}

```json
[
    [
        1229,          // Settlement order id
        "BTC",         // Currency 1
        "USD",         // Currency 2
        10000000,      // Size 1
        100000000000,  // Size 2
        1558050900000, // Created at
        2,             // Counterparty id
        "Comment",     // Comment
        0,             // Flags
        1558051900000, // Settlement moment
        245,           // Settlement id
        "BTC",         // Network name 1
        "",            // Network name 2
    ]
]
```

{% endtab %}

{% tab title="400 Bad request" %}

```json
{
    "error": 2
}
```

{% endtab %}
{% endtabs %}

**Request parameters**

| Field name         | Type           | Description                                                                                                                                                                                                                                                                            |
| ------------------ | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| till               | Efx::DealId    | If specified only return settlements with lesser ID                                                                                                                                                                                                                                    |
| from               | Efx::Timestamp | If specified only return settlements with equal or greater creation timestamp                                                                                                                                                                                                          |
| to                 | Efx::Timestamp | If specified only return settlements with lesser creation timestamp                                                                                                                                                                                                                    |
| limit              | unsigned int16 | <p>Default: <code>250</code></p><p>Maximum number of settlements to return (capped at 250)</p>                                                                                                                                                                                         |
| filterTransactions | bool           | *Optional*. False by default. If true, returns settlement orders created without transaction.                                                                                                                                                                                          |
| filter             | string         | <p><em>Optional</em> <em>field</em> for master accounts only (FM Liquidity Match).<br>- absent or "all": returns settlements for all counterparties<br>- "subaccounts": returns  settlements for the sub-accounts<br>- "external": returns settlements for external counterparties</p> |

**Response description**

| Field name     | Type                 | Description             |
| -------------- | -------------------- | ----------------------- |
|                | Array of settlements |                         |
| **Settlement** | Array\[13]           |                         |
| 0              | Efx::OrderId         | Settlement Order Id     |
| 1              | string               | Currency 1              |
| 2              | string               | Currency 2              |
| 3              | Efx::Size            | Size 1                  |
| 4              | Efx::Size            | Size 2                  |
| 5              | Efx::Timestamp       | Created At              |
| 6              | Efx::ClientId        | Counterparty Id         |
| 7              | string               | Comment                 |
| 8              | unsigned int16       | Flags                   |
| 9              | Efx::Timestamp       | Settlement Moment       |
| 10             | Efx::DealId          | Settlement Id           |
| 11             | string               | Network name 1 or empty |
| 12             | string               | Network name 2 or empty |
