The BAI2 file format is a fixed-width, comma-delimited standard that banks use to deliver account balance and transaction data to corporate treasury systems. Every file is built from four nested levels — file, group, account, and transaction — with each level opened by a header record and closed by a trailer record that carries control totals for validation. Fields inside a record are separated by commas, each record ends with a forward slash, and every transaction and balance is classified by a three-digit type code.
The Four-Level Hierarchy
Every BAI2 file follows the same nesting order, and reading one is a matter of stepping through those levels in sequence.
- File: The outermost container, opened by a File Header (Record Type 01) and closed by a File Trailer (Record Type 99).
- Group: A subset within the file that typically represents one originating bank. Opened by a Group Header (Record Type 02) and closed by a Group Trailer (Record Type 98).
- Account: An individual bank account within a group. Opened by an Account Identifier (Record Type 03) and closed by an Account Trailer (Record Type 49).
- Transaction: A single debit or credit within an account, captured in a Transaction Detail record (Record Type 16). Overflow text spills into Continuation Records (Record Type 88).
The matched header-trailer pairs at each level let processing software validate the file as it descends. A corporation banking with five institutions can receive five groups in a single file, each holding many accounts, each holding many transactions, and the nesting keeps every figure traceable back to its parent.
What Each Record Type Contains
File Header (01)
The File Header is always the first line. It identifies the sender and receiver using identification numbers that are typically the bank’s routing number or a tax ID, and it stamps the file with a creation date and time so the receiving system can detect duplicates or process files in order.1Scotiabank. ScotiaConnect BAI2 Export File Specification It also carries a file identification number and the physical record length the file was built with.
Group Header (02)
Each group opens with an as-of date and time indicating the reporting period the data covers. It also carries a group status code that tells the receiver how to interpret the contents:2SouthState Bank. BAI-2 Format – Cash Management Balance Reporting Specifications
- 1 (Update): The most common value, used for regular previous-day and same-day reports.
- 2 (Deletion): Indicates the group should replace or remove previously sent data.
- 3 (Correction): Flags corrected data that supersedes an earlier transmission.
- 4 (Test Only): Marks test data that should not be processed as real financial activity.
The Group Header also specifies a currency code, which controls how every dollar amount below it is interpreted. Accounts in multiple currencies must be split across separate groups.
Account Identifier (03)
The Account Identifier opens the data block for a specific account. It contains the account number and summary balance information reported through standardized type codes. Code 010 represents the opening ledger balance and code 015 represents the closing ledger balance.3Goldman Sachs Developer. BAI Codes Available balances and other position data appear here as well, giving a snapshot of where the account started and ended for the period.
Transaction Detail (16)
Transaction Detail records follow the Account Identifier and list every individual debit or credit that hit the account during the reporting period. Each record carries a transaction type code, an amount, and optional reference numbers and descriptive text.2SouthState Bank. BAI-2 Format – Cash Management Balance Reporting Specifications Type code 475 identifies a check paid; code 165 flags a preauthorized ACH credit.3Goldman Sachs Developer. BAI Codes
Continuation Record (88)
When a record’s descriptive text or reference data exceeds the physical record length, the overflow goes onto a Continuation Record on the next line. Type 88 records can follow any other record type, including other continuation records, so there is no practical limit on how much detail a transaction can carry.1Scotiabank. ScotiaConnect BAI2 Export File Specification Longer remittance details and check image references live here.
How Type Codes Are Numbered
The three-digit type codes in BAI2 are structured so you can categorize a transaction at a glance, before ever looking up the specific code:4Oracle Help Center. BAI2 Transaction Types
- 001–099: Account-level status codes, including summary balances (opening ledger, closing ledger, available balance) reported in the Record Type 03.
- 100: Total credits summary for the account.
- 101–399: Individual credit transaction codes. Incoming wires, ACH credits, deposit items, and other funds received.
- 400: Total debits summary for the account.
- 401–699: Individual debit transaction codes. Checks paid, ACH debits, outgoing wires, and fees.
- 920–999: Reserved for custom codes that banks define for client-specific reporting needs.
Anything in the 100s, 200s, or 300s is money coming in. Anything in the 400s, 500s, or 600s is money going out. Banks publish their own code mapping guides listing every code they use, and treasury management systems should be configured to recognize the codes each bank sends.
Trailer Records and Control Totals
Each level closes with a trailer that acts as a built-in accuracy check. The Account Trailer (Record Type 49) totals every amount in the preceding 03, 16, and 88 records for that account and reports a count of all records in the block.2SouthState Bank. BAI-2 Format – Cash Management Balance Reporting Specifications If any record was dropped or corrupted, the totals will not match.
The Group Trailer (Record Type 98) aggregates totals across all accounts in the group and reports the account and record counts.1Scotiabank. ScotiaConnect BAI2 Export File Specification The File Trailer (Record Type 99) provides the grand total for the entire file and counts every record from the first header to the last trailer.2SouthState Bank. BAI-2 Format – Cash Management Balance Reporting Specifications
When a control total mismatch occurs at any level, most treasury systems reject the entire file rather than import potentially incomplete data. The standard fix is to contact the bank, which can investigate whether the file was corrupted in transit or generated incorrectly and provide a corrected retransmission.5Oracle Help Center. BAI2 File Import Error Messages
Field and Formatting Rules
Fields within a record are separated by commas, and every record ends with a forward slash to signal the line is complete.6East West Bank. BAI2 Reporting Reference Guide Those two characters are the backbone of the format’s parsing logic.
The standard physical record length is 80 characters per line. When a record’s data exceeds that limit, the remainder flows into a Continuation Record on the next line rather than extending the line.2SouthState Bank. BAI-2 Format – Cash Management Balance Reporting Specifications The fixed width is a legacy of older mainframe systems and persists because so many processing platforms depend on it.
Monetary amounts are expressed without decimal points. The currency code in the Group Header determines the implied decimal places. For U.S. dollar accounts, amounts use two implied decimal places, so $150.00 appears as 15000 in the file.1Scotiabank. ScotiaConnect BAI2 Export File Specification Dates follow the YYMMDD format, and times use 24-hour military notation as HHMM.6East West Bank. BAI2 Reporting Reference Guide Account numbers are reported without leading zeros.
A Minimal File, Line by Line
A minimal BAI2 file with one group, one account, and one transaction fits together like this, with values separated by commas and each line ending in a slash:7TD Bank. BAI Format
- 01 (File Header): Sender ID, receiver ID, creation date 060321, creation time 0829, file ID 001, record length 80.
- 02 (Group Header): Originator ID, destination ID, status code 1 (update), as-of date 060317, currency CAD.
- 03 (Account Identifier): Account number 10200123456, currency code, opening and closing balance type codes with amounts.
- 88 (Continuation): Additional summary data that did not fit on the 03 line, including total credits and total debits with item counts.
- 16 (Transaction Detail): Type code 108 (credit), amount, availability info, and descriptive text “Store104.”
- 49 (Account Trailer): Control total of all amounts in this account block, plus a record count of 9.
- 98 (Group Trailer): Group control total, account count of 2, and total record count of 25.
- 99 (File Trailer): File control total, group count of 1, and grand total record count of 27.
The receiving system reads the 01 record to confirm sender and structure, then steps through each group and account, accumulating totals. At each trailer it compares running totals against the stated control figures. If every level matches, the file is accepted.
Where BAI2 Is Heading
BAI2 has been the dominant bank-to-corporate reporting format in the United States for decades, but the industry is gradually moving toward ISO 20022, a global XML-based messaging standard. For bank statement reporting specifically, the ISO 20022 equivalent is the camt.053 message, which can carry the same balance and transaction data in a richer, more structured form. Where BAI2 is constrained to 80-character lines and three-digit numeric type codes, camt.053 uses standardized business transaction codes consistent across countries and banks, and it can carry structured remittance information with sub-transaction detail that BAI2 has no clean way to represent.
The Federal Reserve’s Fedwire Funds Service has already implemented ISO 20022 messaging, with further format enhancements scheduled for November 2026.8Federal Reserve Bank Services. ISO 20022 Upcoming Releases BAI2 is not going away soon, though. Most U.S. banks still generate it as their primary reporting format, and the installed base of treasury systems built around BAI2 parsing is very large. For most corporate treasury operations, supporting both formats through a multi-year transition is the practical path.