# Get Transfer History

<mark style="color:blue;">**`GET`**</mark> `https://api.sfox.com/v1/enterprise/transfer/history`

This endpoint returns a partner's transfer history. Partners have the ability to filter by `type`, `purpose`, `status`, and time period.&#x20;

{% hint style="info" %}
Responses are limited to 25,000 entries per request. If a time period is not specified, it will return entries from the last 3 months.
{% endhint %}

### Body Parameters

<table><thead><tr><th width="163">Name</th><th width="114">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td>string</td><td>Filters the response by that user i.e. <code>ClientAccount1</code></td></tr><tr><td><code>purpose</code></td><td>string</td><td><p>Filters the response by that purpose</p><ul><li> <code>GOOD</code></li><li><code>SERVICE</code></li></ul></td></tr><tr><td><code>status</code></td><td>string</td><td><p>Transfer status</p><ul><li> <code>CANCELED</code></li><li> <code>PENDING</code></li><li> <code>COMPLETE</code></li></ul></td></tr><tr><td><code>to_date</code></td><td>string</td><td>End date of the query in UNIX timestamp to milliseconds</td></tr><tr><td><code>from_date</code></td><td>string</td><td>Start date of the query in UNIX timestamp to milliseconds</td></tr></tbody></table>

### Responses

<details>

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

```json
{
    "data": [
        {
            "transfer_id": "bbe9e100-490f-11ee-9915-0e5724aafd6b",
            "transfer_status_code": "COMPLETE",
            "type": "PAYMENT",
            "quantity": 100,
            "currency": "usd",
            "user_id": "ClientAccount1",
            "rate": 1,
            "purpose": "GOOD",
            "description": "Gift card payment",
            "atx_id_charged": 1732450,
            "atx_id_credited": 1732451,
            "atx_status_charged": "1200",
            "atx_status_credited": "1200",
            "transfer_date": "2023-09-01T21:40:25.000Z"
        },
        {
            "transfer_id": "4c3aebf4-490f-11ee-9915-0e5724aafd6b",
            "transfer_status_code": "COMPLETE",
            "type": "PAYMENT",
            "quantity": 0.2,
            "currency": "eth",
            "user_id": "client_ind_quinn_49",
            "rate": 2000,
            "purpose": "GOOD",
            "description": "Gift card payment",
            "atx_id_charged": 1732440,
            "atx_id_credited": 1732441,
            "atx_status_charged": "1200",
            "atx_status_credited": "1200",
            "transfer_date": "2023-09-01T21:35:04.000Z"
        }
    ]
}
```

</details>

<details>

<summary><mark style="color:red;"><strong>422 Unprocessable Content</strong></mark></summary>

```json
{
    "error": "status must be one of the following: INITIATED, PENDING, COMPLETE"
}
```

```json
{
    "error": "purpose must be one of the following: GOOD, SERVICE"
}
```

```json
{
    "error": "type must be one of the following: PAYMENT, PAYOUT"
}
```

```json
{
    "error": "to_date must be a valid unix timestamp in milliseconds"
}
```

</details>

### Response Body

| Key                    | Description                                     |
| ---------------------- | ----------------------------------------------- |
| `transfer_id`          | Partner generated transfer and idempotency ID   |
| `transfer_status_code` | Status of the transfer                          |
| `type`                 | Transfer type                                   |
| `quantity`             | Transfer quantity                               |
| `currency`             | Trasfer currency                                |
| `user_id`              | The Connect user ID this transfer will apply to |
| `rate`                 | USD FX Rate of the transfer                     |
| `purpose`              | Transfer purpose                                |
| `description`          | Partner generated description text              |
| `atx_id_charged`       | ID of the charge account transaction            |
| `atx_id_credited`      | ID of the credit account transaction            |
| `atx_status_charged`   | Status of the charge account transaction        |
| `atx_status_credited`  | Status of the credit account transaction        |
| `transfer_date`        | Transfer Date                                   |

### Example Requests

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

```sh
curl -X GET \
  -H 'Content-type: application/json' \
  -H "Authorization: Bearer ${ENTERPRISE_API_KEY}" \
  --data '{ "from_date": "1690956422000", "to_date":"1693611060201", "type":"PAYOUT", "purpose":"GOOD", "status":"COMPLETE"}'
  'https://api.sfox.com/v1/enterprise/transfer/history'
```

{% endtab %}

{% tab title="NodeJS" %}

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

const config = {
  method: 'get',
  url: 'https://api.sfox.com/v1/enterprise/transfer/history'
  headers: {
    "Content-Type": "application/json",
    'Authorization': `Bearer ${process.env.ENTERPRISE_API_KEY}`
  },
  data: {
    from_date: '1690956422000',
    to_date: '1693611060201',
    type: 'PAYOUT',
    purpose: 'GOOD',
    status: 'COMPLETE'
  }
}
 
axios(config)
    .then((response) => {
      console.log(response.status)
      console.log(response.data)
    })
    .catch((err) => {
      console.error(err.response.status)
      console.error(err.response.data)
    });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import os

data = requests.get(
  "https://api.sfox.com/v1/enterprise/transfer/history"
  headers={
    "Authorization": f"Bearer "{os.environ['ENTERPRISE_API_KEY']}"
  },
  json={
   "from_date": "1690956422000",
   "to_date": "1693611060201",
   "type": "PAYOUT",
   "purpose": "GOOD", 
   "status": "COMPLETE"
   }
)
print(data.status_code)
print(data.json())
```

{% endtab %}
{% endtabs %}
