> For the complete documentation index, see [llms.txt](https://docs.sfox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sfox.com/rest-api/post-trade-settlement-pts/get-all-funding-transactions.md).

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sfox.com/rest-api/post-trade-settlement-pts/get-all-funding-transactions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
