The BAI2 format is a standardised method used to transmit electronic banking information, especially for reporting financial activities and transactions. It follows a specific structure that helps ensure consistency and clarity in data exchange. Below is a simplified breakdown of the key components of a BAI2 file:
-
Header Record (Type Code 01)
The file header marks the beginning of a file. It identifies the sender and the receiver of the transmission, and it describes the structure of the file. -
Group Header (Type Code 02)
The group header identifies a group of accounts, all of which are from the same originator and include the same As-of-Date. - Account Identifier and Summary Status (Type Code 03)
This record identifies the account number and reports summary and status information. Summary information may be accompanied by an item count and funds availability distribution. An 03 record must be used to identify each account.
-
Transaction Detail (Type Code 16)
This record reports transaction detail with accompanying text and reference numbers. -
Account Trailer Record (Type Code 49)
The Account Trailer record provides account level control totals. -
Group Trailer (Type Code 98)
The Group Trailer record provides group level control totals. - File Trailer (Type Code 99)
The File Trailer record provides file control totals.
Transformation overview
The BAI2 data is transformed into three distinct outputs, differentiated by a custom field called “Data Type.” These outputs are organised to make it easier to work with specific parts of the data:
- TransactionDetail: This output captures all transaction details from the BAI2 file. It provides a clear view of the individual transactions.
- OpeningClosingBalance: This output contains the opening and closing balance information.
- AccountSummary: This output includes other balance types that might be relevant for specific use cases. It can be filtered to show only the balances used as opening or closing balances in cases where they exist.
Mapping specification
Each BAI2 data element is mapped to its corresponding field. The mapping includes any necessary data transformation, date formatting, as well as the rules or logic applied during the transformation process.
“TransactionDetail” mapping
Duco field name | BAI2 Field | Data Transformation & Rules |
DataType | - | |
File_SenderIdentification | 01 Sender ID | |
File_ReceiverIdentification | 01 Receiver ID | |
File_CreationDate | 01 File Creation Date | Transformed into YYYY-MM-DD |
File_CreationTime | 01 File Creation Time | |
File_IdentificationNumber | 01 File ID | |
File_PhysicalRecordLength | 01 Physical Record Length | |
File_BlockSize | 01 Block Size | |
File_VersionNumber | 01 Version Number | |
Group_UltimateReceiverIdentification | 02 Ultimate Receiver ID | |
Group_OriginatorIdentification | 02 Originator ID | |
Group_Status | 02 Group Status | |
Group_AsOfDate | 02 As-of-Date | Transformed into YYYY-MM-DD |
Group_AsOfTime | 02 As-of-Time | |
Group_CurrencyCode | 02 Currency Code | If currency is absent, then default USD |
Group_AsOfDateModifier | 02 As-of-Date Modifier | Transformer into Text, as in BAI2 library this field has Code data type |
Account_CustomerAccountNumber | 03 Customer Account Number | |
Account_CurrencyCode | 03 Currency Code |
If currency is absent, then currency from Group_CurrencyCode If Group_CurrencyCode is absent, then default USD |
Transaction_TypeCode | 16 Type Code | |
Transaction_TypeCode_Description | - | Custom field, added for description of Transaction_TypeCode |
Transaction_Amount | 16 Amount | Transformed into Decimal, Account_CurrencyCode determines the number of implied decimal places. |
Transaction_FundsType | 16 Funds Type | |
Transaction_ImmediateAvailabilityAmount | - | Transformed into Decimal, Account_CurrencyCode determines the number of implied decimal places. |
Transaction_OneDayAvailabilityAmount | - | Transformed into Decimal, Account_CurrencyCode determines the number of implied decimal places. |
Transaction_TwoPlusDayAvailability | - | |
Transaction_NumberOfDistributions | - | |
Transaction_AvailabilityInDays | - | |
Transaction_AvailableAmount | - | Transformed into Decimal, Account_CurrencyCode determines the number of implied decimal places. |
Transaction_ValueDate | - | Transformed into YYYY-MM-DD |
Transaction_ValueTime | - | |
Transaction_BankReferenceNumber | 16 Bank Reference Number | |
Transaction_CustomerReferenceNumber | 16 Customer Reference Number | |
Transaction_Text | 16 Text |
“OpeningClosingBalance” mapping
Duco Field | BAI2 Field | Data Transformation & Rules |
DataType | - | |
Account_CustomerAccountNumber | 03 Customer Account Number | |
Account_CurrencyCode | 03 Currency Code |
If currency is absent, then currency from Group_CurrencyCode If Group_CurrencyCode is absent, then default USD |
Account_OpeningBalance | 03 Amount |
Populated if [03 Type Code] = 010 (Opening Balance); Transformed into Decimal, Account_CurrencyCode determines the number of implied decimal places. |
Account_OpeningBalanceDate | 02 As-of-Date |
Populated if [03 Type Code] = 010 (Opening Balance); Transformed into YYYY-MM-DD |
Account_ClosingBalance | 03 Amount |
Populated if [03 Type Code] = 015 (Opening Balance); Transformed into Decimal, Account_CurrencyCode determines the number of implied decimal places. |
Account_ClosingBalanceDate | 02 As-of-Date |
Populated if [03 Type Code] = 015 (Opening Balance); Transformed into YYYY-MM-DD |
“AccountSummary” mapping
Duco Field | BAI2 Field | Data Transformation & Rules |
DataType | - | |
File_SenderIdentification | 01 Sender ID | |
File_ReceiverIdentification | 01 Receiver ID | |
File_CreationDate | 01 File Creation Date | Transformed into YYYY-MM-DD |
File_CreationTime | 01 File Creation Time | |
File_IdentificationNumber | 01 File ID | |
File_PhysicalRecordLength | 01 Physical Record Length | |
File_BlockSize | 01 Block Size | |
File_VersionNumber | 01 Version Number | |
Group_UltimateReceiverIdentification | 02 Ultimate Receiver ID | |
Group_OriginatorIdentification | 02 Originator ID | |
Group_Status | 02 Group Status | |
Group_AsOfDate | 02 As-of-Date | Transformed into YYYY-MM-DD |
Group_AsOfTime | 02 As-of-Time | |
Group_CurrencyCode | 02 Currency Code | If currency is absent, then default USD |
Group_AsOfDateModifier | 02 As-of-Date Modifier | Transformer into Text, as in BAI2 library this field has Code data type |
Account_CustomerAccountNumber | 03 Customer Account Number | No transformation required |
Account_CurrencyCode | 03 Currency Code |
If currency is absent, then currency from Group_CurrencyCode If Group_CurrencyCode is absent, then default USD |
Account_TypeCode | 03 Type Code | |
Account_TypeCode_Description | - | Custom field, added for description of Account_TypeCode |
Account_Amount | 03 Amount | Transformed into Decimal, Account_CurrencyCode determines the number of implied decimal places. |
Account_ItemCount | 03 Item Count | |
Account_FundsType | 03 Funds Type | |
Account_Funds_ImmediateAvailabilityAmount | - | Transformed into Decimal, Account_CurrencyCode determines the number of implied decimal places. |
Account_Funds_OneDayAvailabilityAmount | - | Transformed into Decimal, Account_CurrencyCode determines the number of implied decimal places. |
Account_Funds_TwoPlusDayAvailability | - | |
Account_Funds_NumberOfDistributions | - | |
Account_Funds_AvailabilityInDays | - | |
Account_Funds_AvailableAmount | - | Transformed into Decimal, Account_CurrencyCode determines the number of implied decimal places. |
Account_Funds_ValueDate | - | Transformed into YYYY-MM-DD |
Account_Funds_ValueTime | - | |
Account_ControlTotal | 49 Number of Records | |
Account_NumberofRecords | 49 Group Control Total |
Data Transformation and Rules
Date fields
- In BAI2 date fields are coming in YYMMDD format, transformed into YYYY-MM-DD format.
Time field
- In BAI2 time fields are coming as Strings in Military format (2400); originator time zone. Time fields are transformed as String, because some processors use 9999 to indicate the end of the day, which is not a valid time format.
Amount field
- Amount fields in BAI2 format are coming as Integers, without a decimal point “.”. Instead, 0, 1, 2 or 3 characters at the end of the field are designated as implied decimal places. The currency code determines the number of implied decimal places. The implied decimal for most currency codes is two (2) places. Amount fields are transformed as Decimals with consideration of the above rule and exceptions (see the list of currency codes and implied decimal places here, page 80).
Example: $150,097.36 is 15009736. The currency “USD” implies 2 decimal places.
- Status amounts are signed positive “+” or negative “-” in BAI2 format. Positive amounts are expressed without the “+” sign.
Currency field
- The currency field is optional. If it is not populated, the default currency for a group of accounts is used – USD. Default currency for account – currency code in group header.