BAI · cash management
How a BAI2 file is read: records, then type codes
BAI2 numbers everything and names nothing. Records are found by a two-digit code, fields by counting commas, and the direction of a movement is not a sign on the amount — it is the first digit of a three-digit type code. Without that code set in front of you the file is a column of digits.
The account every page here reads
EUR- Published by
- BAI
- What it carries
- One account, one day, summarized before it is itemized.
- Account
- ES21 0049 0001 5323 4567 8901
Closing balance · Aug 14, 2026EUR 2,990,901.67
The definition
What a BAI2 file actually is
The cash-management file American banks report balances and transactions in, and the one format here that states the day’s summary before it states a single movement.
BAI2 is the Bank Administration Institute’s cash-management reporting format. A file opens with an 01 header and closes with a 99 trailer. Inside it, an 02 record opens a group and carries the as-of date, and an 03 record opens an account and states the day as repeating summary groups of four fields — type code, amount, item count, funds type. Type 010 is the opening ledger balance, 100 the total credits, 400 the total debits and 015 the closing ledger balance. A 16 record is one transaction. Each level closes with its own trailer: 49 for the account, 98 for the group, 99 for the file.
- Who sends it
- Your bank, usually onto an SFTP endpoint or through a host-to-host link, and often several times a day for the same account. American banks publish it as a matter of course, and banks elsewhere publish it when their US customers ask for it.
- When it arrives
- The 02 record’s as-of date tells you which day you are holding, and its modifier tells you whether the file is intraday or final. The same account can be reported several times before it is reported for the last time, so a reader that ignores the modifier will count a morning twice.
- What it looks like
- Comma-delimited text with a slash ending each record, and continuation records where a line runs long. Amounts are minor units, unsigned and with no separator. Empty fields are still written, because a field is a position between two commas and a missing comma moves everything after it.
What its parts are called
- BAI2 type codes
- BAI2 record 16
- BAI2 03 record
- BAI2 015 closing ledger
- BAI2 vs MT940
The file
One account’s day, summarized and then itemized
The same account and the same three movements as every other page in this library. The 03 record states the whole day before you have seen a single 16 record, and the 16 records have to add up to it.
02,,0049,1,260814,,EUR,2/ 03,2345678901,EUR,010,286411247,,,100,18204655,1,,400,5525735,2,,015,299090167,,/ 16,165,18204655,,BK26081401,4471QX,NORTE TESORERIA SL FRA 4471/ 16,455,4231890,,BK26081402,MD-88214,NORTE SUMINISTROS SL SUMINISTRO JULIO/ 16,408,1293845,,BK26081403,,COMISION MANTENIMIENTO 3T/
Where each fact lives in this file
- Which account it is
- 03 · 2
- The balance it opened on
- 03 · 010
- One movement, and which way it went
- 16 · 2 · 3
- The day it was booked, and the day the money is yours
- 02 · 5
- What the bank wrote about it
- 16 · 7
- The reference that ties it to a payment
- 16 · 5 · 6
- The balance it closed on
- 03 · 015
What comes out
The amount is unsigned. The type code is the direction.
Nothing in a 16 record says debit or credit. A three-digit number in field 2 does, and that number carries a great deal more than a sign.
We read the type code first, because everything else depends on it: 100 through 399 is money in, 400 through 699 is money out, and the specific code separates a lockbox deposit from a wire from a returned item without reading a word of the text field. Then come the amount, the bank reference in field 5 and the customer reference in field 6. The 16 records are checked against the 03 summary that claims to total them, and a file whose detail does not reach its own summary is rejected naming the group that failed.
The part no published code set covers is the bank’s own extension. Codes above 699 belong to the bank, and a customer type code carries whatever that bank agreed with its customers. We hold those per bank as a versioned rule set rather than as code, so a file read last year is read again when the rule set improves. Field 7 is free text and gets the same treatment as any other narrative on this site.
- Which account it is03 · 2
- ES21 0049 0001 5323 4567 8901
- The balance it opened on03 · 010
- EUR 2,864,112.47
- One movement, and which way it went16 · 2 · 3
- EUR +182,046.55
- The day it was booked, and the day the money is yours02 · 5
- Aug 15, 2026
- What the bank wrote about it16 · 7
- NORTE TESORERIA SL · FRA 4471
- The reference that ties it to a payment16 · 5 · 6
- 4471QX
- The balance it closed on03 · 015
- EUR 2,990,901.67
Numbered is not the same as unreadable. Send us a file and the code set is ours.
Next
The same day, in the formats that use words
MT940 tags its fields and pushes the rest into free text. CAMT.053 gives every reference an element of its own and states the direction in a word. CAMT.052 answers before the day closes what BAI2 answers after it. Norma 43 makes the same trade BAI2 makes, without even the commas.
Formats to read beside it
- MT940 The SWIFT end-of-day statement, and the free-text field under every line
- CAMT.053 The ISO 20022 closed statement, every reference in its own element
- CAMT.052 The same account before the close, with two interim balances
- CSB43 · N43 The Spanish fixed-width statement, where position is the field name
The same day written in four formats, side by side, is on Format library
Asked about BAI2
The questions a practitioner actually types
- 01What are BAI2 type codes?
- Three-digit numbers that say what a record is and which way the money went. 010, 015, 100 and 400 are summary types on the 03 record — opening ledger, closing ledger, total credits, total debits. Detail codes run 100 through 399 for credits and 400 through 699 for debits, and the specific value separates a wire from a lockbox deposit from a returned item. Above 699 the codes belong to the bank, which is why a code set is agreed per bank rather than looked up once.
- 02What is in a BAI2 03 record?
- The account and its day. Field 2 is the account number and field 3 the currency, and after those come repeating summary groups of four fields each: type code, amount, item count, funds type. The item count is the count of the movements inside that total, so a 100 group with an item count of one is one credit of that amount. Empty fields inside a group are still written, because position is what a comma-delimited record has instead of a field name.
- 03How do you tell a debit from a credit in BAI2?
- By the type code, never by the amount. Amounts are minor units with no sign and no separator, so the same digits appear whether the money arrived or left. Field 2 of the 16 record carries the type, and the band it falls in gives you the direction before the specific code gives you the reason. Reading the amount without the code gets every payment backwards.
- 04What is the difference between BAI2 and MT940?
- Both report a day on an account and both foot to the same closing balance. MT940 names its fields with tags and leaves the counterparty in free text; BAI2 numbers its records and puts the meaning in a type code. BAI2 also states the day’s summary up front and repeats intraday more readily, which is why an American treasury team often holds a morning file and a final one. We read either and reconcile against either.
- 05Is BAI2 the same as BAI version 2?
- Yes. BAI2 is the second version of the Bank Administration Institute’s cash-management reporting format, and it is what a bank means when its download menu offers BAI. Files carrying the older layout still turn up in archives, which is one more reason a format profile is pinned to what the bank actually sends rather than to the name on the menu.
Send one BAI2 file and see it totaled.
One account, one month. Every 16 record read through its type code, every reference kept, and the 03 summary checked against the detail underneath it.
One file is enough to start, whether it is the morning one or the final one.