## What is a bank history?

Bank history is a special type of Bank record that allows for the retrieval of bank history transactions associated with a bank account.

To get started with Bank History for a bank account, the bank account must first be enrolled as a Bank History bank using the **Bank history enrollment** checkout flow.

Enroll a bank

```javascript
<script
  id="paystand_checkout"
  type="text/javascript"
  src="https://checkout.paystand.co/v4/js/paystand.checkout.js"
  ps-container-id="container-id"
  ps-env="sandbox"
></script>
<button
	class="paystand-button"
  ps-container-id="container-id"
  ps-publishableKey="1noqhele1yjgieoi8aqe4n8i"
  ps-checkoutType="checkout_bank_enrollment"
>Enroll a Bank</button>
```

## Flow of a bank history request

A bank history will begin with **lastRequestProgress** in the "ready" state. This indicates that the bank history is available to be requested.

You can request a bank history by calling the **Request a history** endpoint. When the history is requested the **lastRequestProgress** will change to the "processing" state, indicating that the request is currently being processed. In addition, the **lastRequestStatus** field will change to "inProgress". Requesting a bank history while it is already in progress will have no effect.

When the bank history is ready, a **BankHistory** event will be sent indicating that the bank history request has been processed. The **lastRequestProgress** field will turn back to "ready" indicating that it is available for further requests and **lastRequestStatus** field will change to either "hasNewResults" or "noNewResults", depending on whether or not new history has been added since the last request.

Occasionally a bank history will become disconnected, indicated by both the **lastRequestProgress** field and the **lastRequestStatus** field switching to "reconnect". When this happens, the bank must be reconnected using the **Bank History enrollment** checkout. A request for history will not be enabled when the bank history is in a "reconnect" state. Any history that had previously been requested will still be available via the **Retrieve a history** endpoint.

# Bank History Parameters

| Parameter         | Specification                                                                                      |
|-------------------|---------------------------------------------------------------------------------------------------|
| id                | **Type**: string<br>**Length**: 25<br>The unique id for the bank history bank.                   |
| object            | **Type**: string<br>**Value**: bankHistory<br>Identifies this as the bank history object.        |
| accountType       | **Type**: enum<br>**Values**: checking, savings                                                  |
| bankName          | **Type**: string<br>**Length**: 256<br>The name of the bank.                                    |
| accountName       | **Type**: string<br>**Length**: 256<br>The name of the account.                                 |
| routingNumber     | **Type**: string<br>**Length**: 32<br>The bank routing number.                                   |
| nameOnAccount     | **Type**: string<br>**Length**: 256<br>The name on the bank account.                            |
| accountHolderType | **Type**: enum<br>**Values**: individual, company                                               |
| currency          | **Type**: ISO4217 currency code<br>The currency for the bank account.                           |
| country           | **Type**: ISO 3166-1 alpha-3<br>The country where this bank account is located.                 |
| last4             | **Type**: string<br>**Length**: 4<br>The last four digits of the bank account.                  |
| lastRequestProgress| **Type**: string<br>**Enum**: reconnect, ready, processing<br>The progress of the last bank history request. |
| lastRequestStatus | **Type**: string<br>**Enum**: hasNewResults, noNewResults, reconnect, inProgress<br>The status of the last bank history request. |
| lastRequestDate   | **Type**: date string                                                                             |
| status            | **Type**: string<br>**Enum**: active, inactive<br>The overall status of the bank history         |
| created           | **Type**: date string<br>The date the bank history was created                                   |
| lastUpdated       | **Type**: date string<br>The date the bank history was last updated                              |

# History Results Parameters

| Parameter                                | Specification                                                                                                                                 |
|------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| results.id                               | **Type**: string<br>**Length**: 25                                                                                                            |
| results.amount                           | **Type**: decimal string<br>The amount of the transaction.                                                                                     |
| results.date                             | **Type**: date string<br>The date of the transaction.                                                                                          |
| results.currentBalance                   | **Type**: decimal string<br>The current balance after the transaction.                                                                          |
| results.debit                            | **Type**: boolean<br>Was the transaction a debit or credit.                                                                                     |
| results.description                      | **Type**: string<br>**Length**: 0-256<br>A description of the transaction.                                                                     |
| results.pending                          | **Type**: boolean<br>Is the transaction pending or complete.                                                                                    |
| results.recurring                        | **Type**: boolean<br>Is the transaction a recurring transaction.

Updated 1 minute ago

* * *

Updated 1 minute ago

* * *
