BAI2

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.

Key Takeaways

  • BAI2 is the dominant prior-day bank reporting format used by US corporate banks to push balances, transactions, and lockbox detail to treasury and AR systems.
  • Every BAI2 file follows a fixed nested structure of file header, group header, account header, transaction detail, account trailer, group trailer, and file trailer records.
  • Three-digit type codes classify each transaction, with credits in the 100-399 range (for example 115 lockbox deposit, 165 preauthorised ACH credit, 195 incoming wire) and debits in the 400-699 range.
  • ISO 20022 camt.053 is the modern XML successor, but BAI2 still dominates US corporate banking because most banks, ERPs, and treasury platforms have decades of working integrations.
  • Modern AI-native cash application reads BAI2 lockbox detail records and continuation lines to extract invoice-level remittance, match payments, and post cash without human keying.

Why BAI2 matters

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.

The BAI2 file structure

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.

  • 01 File Header identifies the sender, receiver, file creation date and time, and a file ID.
  • 02 Group Header opens a group of accounts, typically all the accounts for one originator on one as-of date.
  • 03 Account Identifier opens a single bank account and carries summary status codes such as opening ledger balance, closing available balance, and float positions.
  • 16 Transaction Detail records carry the actual transactions. Each 16 record has a three-digit type code, an amount, and optional text fields for bank reference numbers, customer reference numbers, and remittance text.
  • 88 Continuation records extend any record that runs longer than 80 characters, which is how lockbox detail with many invoice references is carried.
  • 49 Account Trailer, 98 Group Trailer, and 99 File Trailer close each level and carry control totals and record counts.

Common BAI2 transaction codes

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.

  • 115 Lockbox deposit, the aggregate credit for a lockbox batch.
  • 165 Preauthorised ACH credit, used for recurring ACH receipts.
  • 175 Check deposit, often used for individual deposited items.
  • 195 Incoming money transfer, the standard code for inbound wires.
  • 275 ACH credit received, used by some banks for general ACH receipts.
  • 451 ACH debit received, used when a customer-initiated debit hits the account.
  • 475 Check paid, the standard code for cleared disbursement checks.

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 versus MT940 versus ISO 20022 camt.053

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.

Common BAI2 parsing challenges

BAI2 looks simple on paper, but real bank files contain quirks that break naive parsers.

  • Continuation records (88) can split a single remittance description across many lines, so the parser has to reassemble the text before it can extract invoice numbers.
  • Banks vary in how they populate the text field on a 16 record. Some put structured remittance from the lockbox scanner, others put free-form check memo lines, and some put nothing useful at all.
  • Amount fields are unsigned and rely on the type code to indicate credit or debit, so a parser that ignores the code will post the wrong direction.
  • Time zones and as-of dates can drift when a bank transmits late, which causes duplicate posting if the AR system does not deduplicate on bank reference number.

How modern platforms use BAI2 for cash application

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.

Frequently asked questions

What does BAI2 stand for?

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.

Is BAI2 still used or has ISO 20022 replaced it?

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.

What is the difference between BAI and BAI2?

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.

Which BAI2 transaction code represents a lockbox deposit?

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.

Can BAI2 carry invoice-level remittance for cash application?

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.

How is a BAI2 file delivered to the corporate?

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.

Continue learning