# Fetch Transfer History

## HTTPS Request

<mark style="color:blue;">`GET`</mark> `https://api.lenmo.app/api/v3/transfer_history/`

Transfer history is returned in a paginated response.

#### Headers

| Name                                          | Type   | Description                                                                 |
| --------------------------------------------- | ------ | --------------------------------------------------------------------------- |
| Accept                                        | String | The content type of the response.                                           |
| X-API-KEY<mark style="color:red;">\*</mark>   | String | The API key that gives the user the authentication to perform this request. |
| X-Timestamp<mark style="color:red;">\*</mark> | String | The timestamp of the request.                                               |
| X-HMAC<mark style="color:red;">\*</mark>      | String | The HMAC generated for the request.                                         |

{% tabs %}
{% tab title="200: OK A paginated list of transfer history is returned" %}

```json
{
   "count":2,
   "next":null,
   "previous":null,
   "results":[
      {
         "date":"2023-03-07",
         "transactions":[
            {
               "transfer_status":"pending",
               "transfer_type":"Fund Loans",
               "transfer_amount":"-53.11",
               "transfer_source_dest":"to MP",
               "loan_request_id":781768,
               "loan_id":837,
               "borrower_id":2894
            }
         ]
      },
      {
         "date":"2023-03-02",
         "transactions":[
            {
               "transfer_status":"processed",
               "transfer_type":"Withdrawal",
               "transfer_amount":"-20.00",
               "transfer_source_dest":"to Checking",
               "loan_request_id":null,
               "loan_id":null,
               "borrower_id":null
            }
         ]
      }
   ]
}
```

{% endtab %}

{% tab title="403: Forbidden Permission Denied" %}

```javascript
{
    "detail": "Authentication credentials were not provided."
}
```

{% endtab %}
{% endtabs %}

#### Sample Request

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

```clike
curl -X GET "https://api.lenmo.app/api/v3/transfer_history/" \
    -H "accept: application/json" \
    -H "X-API-KEY: YOUR_API_KEY" \
    -H "X-Timestamp: REQUEST_TIMESTAMP" \
    -H "X-HMAC: REQUEST_HMAC"
```

{% endtab %}

{% tab title="Python" %}
{% code overflow="wrap" lineNumbers="true" %}

```python
import requests

url = 'https://api.lenmo.app/api/v3/transfer_history/'

headers = {
    'Accept': 'application/json',
    'X-API-KEY': 'YOUR_API_KEY',
    'X-Timestamp': 'REQUEST_TIMESTAMP',
    'X-HMAC': 'REQUEST_HMAC'
}

r = requests.get(url, headers=headers)

print(r.text)
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}

```java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        try {
            String urlString = "https://api.lenmo.app/api/v3/transfer_history/";
            URL url = new URL(urlString);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("GET");
            connection.setRequestProperty("Accept", "application/json");
            connection.setRequestProperty("X-API-KEY", "YOUR_API_KEY");
            connection.setRequestProperty("X-Timestamp", "REQUEST_TIMESTAMP");
            connection.setRequestProperty("X-HMAC", "REQUEST_HMAC");

            BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
            String inputLine;
            StringBuilder response = new StringBuilder();
            while ((inputLine = in.readLine()) != null) {
                response.append(inputLine);
            }
            in.close();

            System.out.println(response.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'uri'

url = URI("https://api.lenmo.app/api/v3/transfer_history/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/json"
request["X-API-KEY"] = "YOUR_API_KEY"
request["X-Timestamp"] = "REQUEST_TIMESTAMP"
request["X-HMAC"] = "REQUEST_HMAC"

response = http.request(request)
puts response.body

```

{% endtab %}

{% tab title="Node.Js" %}

```javascript
const fetch = require('node-fetch');

const url = 'https://api.lenmo.app/api/v3/transfer_history/';

const headers = {
    "Accept": "application/json",
    "X-API-KEY": "YOUR_API_KEY",
    "X-Timestamp": "REQUEST_TIMESTAMP",
    "X-HMAC": "REQUEST_HMAC",
};

fetch(url, {
    method: 'GET',
    headers: headers
})
.then(response => response.text())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "https://api.lenmo.app/api/v3/transfer_history/";

$headers = [
    "Accept: application/json",
    "X-API-KEY: YOUR_API_KEY",
    "X-Timestamp: REQUEST_TIMESTAMP",
    "X-HMAC: REQUEST_HMAC"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    echo $response;
}

curl_close($ch);
?>

```

{% endtab %}
{% endtabs %}

#### Response Parameters

<table><thead><tr><th>Parameter</th><th width="175">Type</th><th>Description</th></tr></thead><tbody><tr><td>date</td><td>Date</td><td>Transfer Date</td></tr><tr><td>transactions</td><td>List of transfer obj.</td><td>A list of transactions grouped by transfer date</td></tr><tr><td>TransferHistory.transfer_status</td><td>String</td><td>Status of a transfer .e.g <code>pending</code>, <code>processed</code> or <code>failed</code></td></tr><tr><td>TransferHistory.transfer_type</td><td>String</td><td>Type of a transfer .e.g <code>Add Money</code>, <code>Withdrawal</code>, <code>Fund Loans</code>, <code>Monthly Payments</code>, <code>Collection</code>, <code>Lender Subscription</code>, <code>Default Crypto</code>, <code>Liquidate Crypto</code>, <code>Reward</code>, <code>Refund</code></td></tr><tr><td>TransferHistory.transfer_amount</td><td>String</td><td>Amount of transfer in USD</td></tr><tr><td>TransferHistory.transfer_source_dest</td><td>String</td><td>Indicates the transfer initiation either to or from source</td></tr><tr><td>TransferHistory.loan_request_id</td><td>Long</td><td>Id of the loan request associated with the transfer</td></tr><tr><td>TransferHistory.loan_id</td><td>Long</td><td>Id of the loan associated with the transfer</td></tr><tr><td>TransferHistory.borrower_id</td><td>Long</td><td>Id of the borrower associated with the transfer</td></tr></tbody></table>
