BAI2
BAI2 is a flat-file bank reporting format, defined by the Bank Administration Institute, that banks use to transmit prior-day balances, transaction detail, and lockbox remittance from the bank to a corporate treasury or AR system.
BAI2 is the file format that quietly moves trillions of dollars of payment information between US banks and their corporate clients every night. The Bank Administration Institute published the original BAI specification in the 1980s, and the version 2 release became the de facto standard for prior-day reporting. When a treasurer opens a cash position report at 7am, or when an AR team posts yesterday's lockbox receipts before lunch, the underlying data almost always arrived as a BAI2 file dropped onto an SFTP server overnight.
For AR and cash application specifically, BAI2 is the carrier wave for lockbox remittance. The bank receives paper checks and electronic payments into a lockbox account, captures the remittance detail, and packages everything into a BAI2 file that the AR system parses to match payments to open invoices.
A BAI2 file is a plain text file made of fixed record types arranged in a strict nested hierarchy. Each level opens with a header and closes with a trailer, which lets a parser validate the file as it reads.
The three-digit type codes are what make BAI2 readable to software. Codes 100-399 cover credits, and codes 400-699 cover debits. A handful of codes do most of the work for AR teams.
Banks differ in exactly which codes they use, and any cash application implementation has to confirm the code mapping with each bank during onboarding.
BAI2 is not the only prior-day reporting format. Two alternatives matter.
MT940 is the SWIFT message format used widely in Europe and for cross-border reporting. It carries similar information to BAI2 but uses SWIFT field tags rather than BAI three-digit codes, and its line length and character set rules are different.
ISO 20022 camt.053 is the modern XML-based bank-to-customer statement message. It is structured, self-describing, and carries richer remittance data, including the full ISO 20022 remittance information block that maps cleanly to invoice-level reference numbers. Regulators and major banks are pushing camt.053 as the strategic successor, and pain.001 plus camt.053 are now the backbone of real-time payment rails.
Despite that, BAI2 still dominates US corporate banking. Most US banks publish BAI2 by default, most ERPs ingest BAI2 natively, and migration projects are expensive enough that finance teams keep BAI2 running alongside camt.053 for years.
BAI2 looks simple on paper, but real bank files contain quirks that break naive parsers.
An agentic cash application platform treats the BAI2 file as a stream of payment events, not a static report. It ingests the file as soon as it lands, parses the nested structure, and routes each 16 record into a matching pipeline based on the type code. Lockbox records (115 and adjacent codes) flow into invoice-level matching, where AI models read the continuation text, extract invoice numbers, customer names, and amounts, and propose matches against open AR.
Wire and ACH receipts (195, 165, 275) flow into a different lane that combines remittance from BAI2 with separate remittance advice files such as EDI 820 or emailed remittance PDFs. The platform stitches the two sources together so that a single wire with a separate EDI 820 ends up as one matched payment, not two open items. Reconciliation then closes the loop by comparing BAI2 closing balances to posted cash, surfacing any breaks for the cash application analyst to clear.
BAI2 stands for Bank Administration Institute format version 2. The Bank Administration Institute published the original BAI cash management balance reporting specification in the 1980s, and version 2 became the standard US format for prior-day bank reporting.
BAI2 is still the dominant prior-day reporting format in US corporate banking. ISO 20022 camt.053 is the strategic successor and most large banks now offer it, but legacy ERP integrations, treasury systems, and AR platforms still rely on BAI2, so most corporates run both formats in parallel for years.
BAI is the original Bank Administration Institute cash management reporting format. BAI2 is the version 2 revision that added structured transaction detail records, continuation records, and a wider library of three-digit type codes. When people say BAI today they almost always mean BAI2.
Code 115 is the standard credit code for a lockbox deposit batch. Some banks also use related codes in the 100-series for individual deposited items inside the batch, and a few use bank-specific codes, so the exact mapping should be confirmed with each bank during onboarding.
Yes. Lockbox detail and continuation records (type 16 plus type 88) carry the remittance text captured by the bank's lockbox scanner, which typically includes invoice numbers, customer references, and check memo lines. An AI-native cash application engine parses that text to match payments to open invoices automatically.
Banks almost always deliver BAI2 files by SFTP or a secure file transfer portal on an overnight schedule, with the prior-day file landing in the early morning. Some banks also support intraday BAI2 files that refresh multiple times during the business day for tighter cash positioning.