Documentation Index
Fetch the complete documentation index at: https://docs.ledgerbox.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Bank Statement model (BANK_STATEMENT) is designed to extract and structure information from US bank statements. It captures key details including bank information, account holder details, account balances, transactions, and checks.
Model Details
- Model ID:
BANK_STATEMENT
- Supported Locales:
en-US
- Version: GA
- Release Date: November 30, 2024
Schema Structure
The Bank Statement model extracts the following information:
Root Level Fields
| Field | Type | Description |
|---|
BankName | string | Listed name of the bank |
AccountHolderName | string | Name of the account holder |
AccountHolderAddress | string | Address of the account holder |
StatementStartDate | string (ISO date) | Start date of the bank statement |
StatementEndDate | string (ISO date) | End date of the bank statement |
Accounts | Account[] | Array of accounts on the statement |
Account Fields
Each account in the Accounts array contains:
| Field | Type | Description |
|---|
AccountNumber | string | Account number on the bank statement |
AccountType | string | Type of account (e.g., “Checking”, “Savings”) |
EndingBalance | number | Ending balance for the statement period |
Transactions | Transaction[] | Array of transactions |
Transaction Fields
Each transaction in the Transactions array contains:
| Field | Type | Description |
|---|
Date | string (ISO date) | Transaction date |
Description | string | Transaction description |
DepositAmount | number | undefined | Amount of deposit |
WithdrawalAmount | number | undefined | Amount of withdrawal |
Example Usage
import { createJob } from '@your-package/api';
// Create a job for processing bank statements
const job = await createJob({
model: 'BANK_STATEMENT',
files: [/* your files */]
});
// Example response structure
const statementData = {
bankAddress: '123 Main St, Redmond, WA 98052',
bankName: 'Contoso Bank',
accountHolderAddress: '456 Main St, Redmond, WA 98052',
accountHolderName: 'JOHN DOE',
statementStartDate: '2024-01-01T00:00:00.000Z',
statementEndDate: '2024-01-31T00:00:00.000Z',
accounts: [
{
accountNumber: '987-654-3210',
accountType: 'Checking',
beginningBalance: 1488.03,
endingBalance: 1488.03,
totalServiceFees: 0.0,
transactions: [
{
date: '2024-01-17T00:00:00.000Z',
description: 'OnlineTransfer From Chk...6609 Transaction#: 6373187418',
checkNumber: '6609',
depositAmount: 1500.0
}
],
checks: [
{
number: '7175',
date: '2024-01-11T00:00:00.000Z',
amount: 150.0
}
]
}
]
};
## Date Handling
The model accepts dates in two formats:
- ISO 8601 datetime strings
- YYYY-MM-DD format strings
All dates are automatically converted to ISO format during processing.
## Type Definitions
You can import the following TypeScript types for use in your application:
```typescript
import type {
Document,
DocumentTypeBase
} from '@your-package/models';
type BankStatement = Document<'BANK_STATEMENT'>;
Field Validation Rules
- All monetary amounts (balances, transaction amounts) must be non-negative numbers
- Account numbers and check numbers are stored as strings to preserve leading zeros
- Service fees default to 0 if not specified
- Check numbers in transactions are normalized to undefined if null or empty
- Transactions must have either a deposit amount or withdrawal amount (or neither), but not both