# Get All Funding Transactions

<mark style="color:green;">**`GET`**</mark> `https://api.sfox.com/v1/post-trade-settlement/interest/history`

Retrieve a list funding transactions that have accrued to positions in your account.

### Query Parameters

<table><thead><tr><th width="211">Name</th><th width="133">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>limit</code></strong></td><td>int</td><td>Limit on the number of results to return. Default: 100.</td></tr><tr><td><strong><code>before</code></strong></td><td>int</td><td>Pagination parameter. Return results that occurred before (older) than the specified ID (<code>id</code> from response body).</td></tr><tr><td><strong><code>after</code></strong></td><td>int</td><td>Pagination parameter. Return results that occurred after (newer) than the specified ID (<code>id</code> from response body).</td></tr><tr><td><strong><code>start_date</code></strong></td><td>timestamp</td><td>Search by minimum specified date time. Unix timestamp in ms.</td></tr><tr><td><strong><code>end_date</code></strong></td><td>timestamp</td><td>Search by maximum specified date time. Unix timestamp in ms.</td></tr></tbody></table>

### Response Body

<table><thead><tr><th width="211">Name</th><th width="133">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>id</code></strong></td><td>int</td><td>sFOX-generated ID for the transaction. Use for <code>before</code> / <code>after</code> pagination.</td></tr><tr><td><strong><code>currency</code></strong></td><td>string</td><td>The currency of the transaction.</td></tr><tr><td><strong><code>amount</code></strong></td><td>number</td><td>Amount of the currency charged.</td></tr><tr><td><strong><code>amount_usd</code></strong></td><td>number</td><td>USD value of the amount at the time of the transaction.</td></tr><tr><td><strong><code>date_added</code></strong></td><td>datetime</td><td>Date the transaction was created.</td></tr><tr><td><strong><code>date_updated</code></strong></td><td>datetime</td><td>Date the transaction was last updated.</td></tr><tr><td><strong><code>position_id</code></strong></td><td>int</td><td>sFOX-generated ID of the PTS position that this transaction accrued to.</td></tr><tr><td><strong><code>next_cursor</code></strong></td><td>int</td><td>Newest transaction <code>id</code> of the results. Paginate to the next, newer page of results specifying <code>after</code> = this value.</td></tr><tr><td><strong><code>prev_cursor</code></strong></td><td>int</td><td>Oldest transaction <code>id</code> of the results. Paginate to the next, older page of results specifying <code>before</code> = this value.</td></tr></tbody></table>

### Responses

<details>

<summary><mark style="color:green;">200</mark></summary>

```json
{
    "data": [
        {
            "id": 2889941222331,
            "currency": "eth",
            "amount": 0.00011888,
            "amount_usd": 0.41202856,
            "date_added": "2024-03-21T20:39:00.000Z",
            "date_updated": "2024-03-21T20:39:00.000Z",
            "position_id": 253441111123
        },
        {
            "id": 2889941222330,
            "currency": "eth",
            "amount": 0.00011888,
            "amount_usd": 0.41218777,
            "date_added": "2024-03-21T19:37:00.000Z",
            "date_updated": "2024-03-21T19:37:00.000Z",
            "position_id": 253441111123
        }
    ],
    "page": {
        "next_cursor": 2889941222331,
        "prev_cursor": 2889941222330
    }
}
```

</details>

<details>

<summary><mark style="color:red;">400</mark>: Bad Request</summary>

```json
//specify only one of 'before' and 'after'
{
    "error": "before and after are mutually excusive parameters"
}

//start_date must be a valid Unix timestamp in ms
{
    "error": "start_date must be a valid timestamp"
}

//end_date must be a valid Unix timestamp in ms
{
    "error": "start_date must be a valid timestamp"
}
```

</details>

<details>

<summary><mark style="color:red;">401</mark>: Unauthorized</summary>

```json
//invalid API key
{
    "error": "user lookup failed"
}
```

</details>

<details>

<summary><mark style="color:red;">403</mark>: Forbidden</summary>

```json
//your account does not have post-trade settlement enabled
{
    "error": "post trade settlement disabled"
}
```

</details>

### Example Requests

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

```bash
curl -H 'Authorization: Bearer <API_TOKEN>' \
https://api.sfox.com/v1/post-trade-settlement/interest/history
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const axios = require('axios');

axios({
  method: 'get',
  url: 'https://api.sfox.com/v1/post-trade-settlement/interest/history',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

data = requests.get(
  "https://api.sfox.com/v1/post-trade-settlement/interest/history",
  headers={
    "Authorization": "Bearer <API_KEY>",
  }
)
print(data)
```

{% endtab %}
{% endtabs %}
