> For the complete documentation index, see [llms.txt](https://docs.sms4sats.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sms4sats.com/api-reference/get-history.md).

# Get History

<mark style="color:blue;">`GET`</mark> `https://api2.sms4sats.com/history`

Returns the complete funding history for a prepaid API Key, including all top-up transactions and their amounts.

#### Headers

| Name        | Type   | Required | Description   |
| ----------- | ------ | -------- | ------------- |
| `X-API-Key` | String | Yes      | Your API Key. |

{% tabs %}
{% tab title="200: OK" %}
{% code overflow="wrap" %}

```javascript
{
  status: 'OK', 
  totalAmount: 349500,
  orders: [ 
    {
      amount: 9500,
      createdAt: 1668612831730,
      desc: 'fund account',
      description: 'fund account',
      holdinvoice: true,
      preimage: 'xxx',
      preimageHash: 'sha256(xxx)',
      price: 9500,
      userId: 'APIKEY'
    },
    ...
  ],
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request" %}

```javascript
{
    status: 'error',
    reason: 'X-API-Key header is missing.'
}
```

{% endtab %}
{% endtabs %}

### Response Fields

| Field                   | Type    | Description                                      |
| ----------------------- | ------- | ------------------------------------------------ |
| `status`                | String  | `OK` on success                                  |
| `totalAmount`           | Number  | Total satoshis funded across all transactions    |
| `orders`                | Array   | List of funding transactions                     |
| `orders[].amount`       | Number  | Amount funded in this transaction (satoshis)     |
| `orders[].createdAt`    | Number  | Unix timestamp (milliseconds) of the transaction |
| `orders[].description`  | String  | Transaction description                          |
| `orders[].holdinvoice`  | Boolean | Whether this was a hold invoice                  |
| `orders[].preimage`     | String  | Lightning payment preimage                       |
| `orders[].preimageHash` | String  | SHA256 hash of the preimage                      |
| `orders[].price`        | Number  | Price paid (satoshis)                            |
| `orders[].userId`       | String  | The API Key associated with this transaction     |

{% hint style="info" %}
Get in touch for volume discounts: <sales@sms4sats.com>.
{% endhint %}
