BAI2 Parser
Describes the BAI2 bank statement format, supported banks, core transaction parsing, Citibank-specific enhancements, and known limitations of the BAI2 parser.
BAI2 is an industry-standard bank statement format. All BAI2 parsers share the same core field set but differ in bank-specific quirks (decimal handling, currency maps, regex patterns). Use this topic to determine whether a bank statement file delivered by your bank is supported, what data is extracted, and what is ignored.
Supported banks:
Citi Bank -> Exhaustive support
Truist
Wells Fargo
Background: How a BAI2 file is structured
BAI2 is a plain text, comma-delimited format. Every line is a record identified by the number at the start of the line. Records are read in sequence to build up the context for each transaction.
01, <file header> ← ignored by all parsers
02, <bank header> ← sets bank ID, as-of date, and currency (Citibank only)
03, <account header> ← sets account number, currency, amount sign
16, <transaction> ← one transaction; references bank+account header above
88, <continuation> ← additional text for the preceding 16, record
88, <continuation> ← further continuation lines possible
16, <next transaction>
...
How to identify a BAI2 file: The first line of the file must end with 2/ (e.g., 01,SENDER,RECEIVER,yyMMdd,hhmm,1,64,2/). Files that do not match this are rejected by all BAI2 parsers. BAI3 has no such version check.
Amount encoding: Amounts in the file are integers — no decimal point. The parser inserts the decimal based on the currency. For example, USD 12345 → 123.45.
Date format: yyMMdd (2-digit year, e.g., 260421 = April 21, 2026).
Core transaction processing supported
Transaction amount parsing with multi-currency decimal handling
Currency code extraction
Value date and fund type date parsing
Bank reference number extraction
Customer account reference number extraction
Bank account number extraction
Transaction classification and codes supported
Detail Type codes (Example: 142, 165, etc)
Multi-line continuation records (Code 88)
Transaction description extraction from continuation records
Funds availability handling
Funds availability is not handled.
Bank-specific enhancements
Supports Citibank-specific parsing:
Original amount extraction using regex
FX rate extraction using regex
Bank charge extraction using regex
What are not supported
Does not support opening and closing balance parsing
Does not support account summaries or totals
Does not support sender or remitter identification