BAI2 file format
BAI2 (Cash Management Balance Reporting Specifications, Version 2)
BAI2 is a comma-delimited bank reporting file, used mainly in North America. It carries account balances, summary totals and transaction details using numeric type codes.
US and Canadian banks send BAI2 files to corporate treasury teams, ERPs and treasury management systems. Some banks elsewhere, such as Westpac and NAB in Australia, also offer it for cash positioning and bank reconciliation.
File structure
| Code | Name | Purpose | Required |
|---|---|---|---|
01 | File Header | Opens the file. Carries sender, receiver, creation date and time, and version number 2. | Yes |
02 | Group Header | Opens a group of accounts. Carries as-of date, optional currency and as-of-date modifier. | Yes |
03 | Account Identifier and Summary | Names the account, then repeats type code, amount, item count and funds type for balances and totals. | Yes |
16 | Transaction Detail | One transaction: type code, amount, funds type, bank reference, customer reference and free text. | No |
88 | Continuation | Carries overflow from the previous 03, 16 or 88 record when it exceeds the line length. | Conditional |
49 | Account Trailer | Closes the account with a control total of its amounts and a record count. | Yes |
98 | Group Trailer | Closes the group with a control total, number of accounts and number of records. | Yes |
99 | File Trailer | Closes the file with a control total, number of groups and number of records. | Yes |
Key codes
| Code | Meaning | Source | Category |
|---|---|---|---|
010 | Opening ledger balance | HSBC; East West Bank; Westpac; Scotiabank | Balance (status) |
015 | Closing ledger balance | HSBC; East West Bank; Westpac; Scotiabank | Balance (status) |
020 | Average closing ledger, month to date | East West Bank | Balance (status) |
025 | Average closing ledger, year to date | East West Bank | Balance (status) |
030 | Current ledger balance (intraday) | HSBC; RBS Bankline | Balance (status) |
040 | Opening available balance | HSBC; East West Bank; RBS Bankline | Balance (status) |
045 | Closing available balance | HSBC; East West Bank; Westpac | Balance (status) |
050 | Average closing available, month to date | East West Bank | Balance (status) |
055 | Average closing available, year to date | East West Bank | Balance (status) |
060 | Current available balance (intraday) | HSBC; RBS Bankline | Balance (status) |
072 | One-day float | HSBC; RBS Bankline (East West Bank labels it One Day Available) | Balance (status) |
074 | Two or more days float | HSBC; RBS Bankline (East West Bank labels it Two or More Days Available) | Balance (status) |
075 | Three or more days float | HSBC; RBS Bankline | Balance (status) |
100 | Total credits | HSBC; East West Bank; Westpac; Scotiabank | Summary |
400 | Total debits | HSBC; East West Bank; Westpac; Scotiabank | Summary |
108 | Credit (any type) | HSBC developer code list | Detail credit |
115 | Lockbox deposit | HSBC | Detail credit |
142 | ACH credit received | HSBC; East West Bank; Westpac | Detail credit |
165 | Preauthorized ACH credit | HSBC | Detail credit |
175 | Check deposit package | HSBC; Westpac | Detail credit |
195 | Incoming money transfer | HSBC; East West Bank; Westpac | Detail credit |
206 | Book transfer credit | HSBC developer code list; East West Bank | Detail credit |
275 | ZBA credit | Westpac | Detail credit |
301 | Commercial deposit | HSBC | Detail credit |
354 | Interest credit | HSBC developer code list; Westpac | Detail credit |
399 | Miscellaneous credit | HSBC; East West Bank; Westpac | Detail credit |
451 | ACH debit received | HSBC; Westpac | Detail debit |
455 | Preauthorized ACH debit | HSBC | Detail debit |
466 | ACH settlement | HSBC developer code list; Westpac | Detail debit |
475 | Check paid | HSBC; East West Bank; Westpac | Detail debit |
495 | Outgoing money transfer | HSBC; Westpac | Detail debit |
506 | Book transfer debit | HSBC developer code list; East West Bank | Detail debit |
555 | Deposited item returned | HSBC; Westpac | Detail debit |
575 | Individual ZBA debit | HSBC; Westpac | Detail debit |
698 | Miscellaneous fee | HSBC; Westpac | Detail debit |
699 | Miscellaneous debit | HSBC; East West Bank; Westpac | Detail debit |
890 | Non-monetary information, neither debit nor credit | Scotiabank | Detail (non-monetary) |
Funds type 0 | Immediate availability | Scotiabank | Funds type |
Funds type 1 | One-day availability | Scotiabank | Funds type |
Funds type 2 | Two or more days availability | Scotiabank | Funds type |
Funds type S / D | Distributed availability | Scotiabank | Funds type |
Funds type V | Value dated; a value date and time follow | Scotiabank; HSBC | Funds type |
Funds type Z | Unknown availability (default) | Scotiabank; NAB | Funds type |
As-of-date modifier 1 / 2 / 3 / 4 | Interim previous day / final previous day / interim same day / final same day | Scotiabank; HSBC | 02 record |
Sample file
Synthetic example with a fictional bank and account. Real files vary by bank.
01,FICTBANK,ACMEPAYCO,261026,0700,1,80,,2/
02,ACMEPAYCO,FICTBANK,1,261025,,USD,2/
03,0001234567,USD,010,1500000,,,015,1620000,,,040,1450000,,,045,1570000,,/
88,100,250000,2,,400,130000,1,/
16,195,150000,0,WIRE0001,INV1001,INCOMING WIRE ACME TRADING LTD
16,142,100000,0,ACH0002,,ACH CREDIT REFUND
16,495,130000,0,WIRE0003,PO7788,OUTGOING WIRE TO SUPPLIER
88,BENEFICIARY REF PO7788 OCTOBER SETTLEMENT
49,6900000,7/
98,6900000,1,9/
99,6900000,1,11/
Reading balances
Read the 03 record together with any 88 records that continue it. Pair each type code with the amount after it. 010 is opening ledger, 015 closing ledger, 040 opening available and 045 closing available. Intraday files usually report 030 current ledger and 060 current available instead. Apply implied decimals from the account currency before use.
Parsing and reconciliation pitfalls
- Join 88 continuation records to the record above before splitting fields. An 88 can continue an 03 summary list or the free text of a 16.
- Amounts have no decimal point. Most banks imply two decimals, but some tie it to currency, so confirm rules for zero-decimal currencies such as JPY.
- A text field ends a 16 record without a slash terminator and may itself contain commas or slashes. Split only the fixed fields, then keep the remainder as text.
- Funds type changes the field count in a 16 record. V adds value date and time fields, so references shift position. Check other funds types against your bank guide.
- Check the 02 as-of-date modifier. Value 3 means interim same-day data, so balances are provisional and can change before the final file.
How it compares
BAI2 is a flat, comma-delimited format with numeric type codes, common in North America. MT940 uses SWIFT tags and real decimals. camt.053 is structured XML with richer remittance and party data. ASC X9 succeeded BAI2 with BTRS (X9.121), which BAI2 readers cannot always parse.
Polynopsis reads statement files like this one through a forwarding inbox and turns them into a live position alongside your API-connected accounts. See how it works.
Frequently asked questions
What is a BAI2 file?
A BAI2 file is a bank balance and transaction report in a comma-delimited text format. The Bank Administration Institute published version 2 in 1987. It nests a file, groups and accounts, and uses three-digit type codes for balances and transactions.
How do I read the 03 record in BAI2?
After the record code, read the account number and currency. Then read repeating sets of type code, amount, item count and funds type. For example, 010 is opening ledger and 045 is closing available. Continue into any following 88 records.
What does the 88 record mean in BAI2?
The 88 record is a continuation. It carries data that did not fit on the previous 03, 16 or 88 line. Append it to the record above before parsing, keeping text and field boundaries intact.
Other formats
Sources
- BAI2 statement format (BankRec) · Westpac
- BAI2 Information Reporting Specifications · HSBC
- BAI2 Reporting Reference Guide · East West Bank
- ScotiaConnect BAI2 Export File Specification · Scotiabank
- Balance and Transaction Reporting Standard (BTRS) X9.121-2012 overview · Federal Reserve Bank of Minneapolis (Remittance Coalition)
Know where all your money is.
Polynopsis gives cross-border payment teams one live position across every bank, payout partner, exchange and wallet, including money in flight, and warns before a corridor runs dry.