What are BAI Exports

  • The BAI export is a method for downloading your Commercial Banking Online account information for upload into other financial systems.

    The BAI export file follows the following structure:

    File Header 

    Group Header [for each day’s data] 

    Account Header [for each account for the given day, includes balance]   

    Transaction Details [for each transaction item for the given account on given day]

    Account Trailer

    Group Trailer

    File Trailer

     

    Each line of the BAI file will start with a two-numbered record type followed by a number of fields. Each field is separated by a comma and each line will end with a forward slash </>.

     

    Two Code
    Number
    Description 
    01 File Header
    02 Group Header
    03 Account Header (for each account, includes balance)
    16 Transaction Details (for each transaction item)
    49 Account Trailer
    88 Continuation of the previous line on to the next line
    98 Group Trailer
    99 File Trailer




    File Header


    Example of a File header

    01,00000000,000000000,171115,0916,78113,,,2


    The File header line signifies the start of the File and contains information on the time and date of the file extract. As you can see in the example above each field is separated by a comma.

    The information in the fields will follow this order:

    File Header
    Field No
    Field Size  Data 
    1 2 Always 01 – signifies start of file
    2 8 Always zero filled
    3 9 Always zero filled
    4 6 Date of export in format YYMMDD
    5 4 Time of export in format HHMM (24 –hr clock)
    6 1-13 Unique File Identification Number
    7 0 Blank
    8 0 Blank
    9 1 Always 2



    Group Header


    Example of a Group Header

    02,,00000000,1,171115,0916,GBP,2/


    The Group header signifies the start of a group of data, in most cases this will be a day of transactions.

    The information in the fields will follow this order:

     

    Group Header
    Field No
    Field Size  Data 
    1 2 Always 02 – signifies start of each Bank’s report
    2 0 Blank
    3 9 Individual Bank’s identification number
    000000001 = Lloyds Bank
    4 1 Always 1
    5 6 Date relating to individual Bank’s data in Format YYMMDD
    6 4 Time (optional)
    7 3 SWIFT currency code (Default GBP)
    8 1 Always 2

     




    Account Header – Balance Records


    Example of an Account Header 

    03,776123-00702468,GBP,015,56,,Z,045,56,,Z,972,56,,Z,974,56,0,,Z,990,0,,Z/

    The account header will give information for each account for the day specified in the Group Heading and will include balance information. 

    The information in the fields will follow this order:

    Account Header Field No Field Size Data
    1 2 Always 03 – signifies balance record
    2 15 Sort code - account number (with hyphen)
    3 3 SWIFT currency code
    4 3 BAI Balance code (see table below)
    5 Variable Amount signed in pence
    6 0 Blank
    7 1 Z’

     

    Fields 4 to 7 will repeat for each balance that is reported.

    Debit figures are shown by the presence of a ‘–’ symbol preceding the value.

    Transaction Details

    Example of Transaction Details

    16,169,200,Z,,TEST,F/FLOW TEST PYMT
    88,TRNID=00000000022-4
    88,TRNIDDATE=20180119
    88,ADVREF=311763106183601701900110TEST 


    The transaction record gives transaction information of the account that was specified in the Account Header.

    The information in the fields will follow this order:

     

    Transaction Details Field No Field Size  Data 
    1 2 Always 16 – signifies a transaction code
    2 3 BAI Transaction code (see table below)
    3 Variable Amount signed in pence
    4i 6 Value date in format YYMMDD
    4ii 0 Blank
    5 (7) 0 Blank
    6 (8) 0 Blank
    7 (9) Variable Entry narrative

     




    Account Trailer


    Example of an Account Trailer

    49,224,3/


    The Account trailer indicates the end of the account information that was opened in the Account header.

    The information in the fields will follow this order:

    Account Trailer Field No Field Size Data
    1 2 Always 49 – signifies account trailer
    2 Variable Hash total of the accounts 03 and 16 record value
    3 Variable No. of 03,16 and 88 records for this account plus this 49 record

     




    Multiple Accounts


    If you have requested more than one account to be included in the report the file will begin at the Account header (03) for the next account.

    Group Trailer

    Example of Group Trailer

    98,0,2,6/


    The Group trailer indicates the end of the Group information that was opened in the Group header.

    The information in the fields will follow this order:

     

    Group Trailer Field No Field Size  Data 
    1 2 Always 98 – signifies group trailer
    2 Variable Hash total of all 03 and 16 records reported by the Bank
    3 Variable Number of records reported
    4 Variable Number of 03,16, 88 and 49 records reported plus the 02 and 98 group records

     




    File Trailer


    Example of File trailer

    99,393109,95,1389/


    The File trailer indicates the end of the File information that was opened in the File header.

    The information in the fields will follow this order:

     

    File Trailer Field No Field Size Data
    1 2 Always 99 – signifies file trailer
    2 Variable Hash total of all amounts within each group’s records
    3 Variable Number of groups reported
    4 Variable Total number of records reported, including the 01, 02, 03, 16, 88,  and 49 records and the closing 98 and 99 records



    BAI Balance and Transaction codes - Sterling Account



     

    Code      Balance Description Code      Credit Description Code      Debit Description
    015 Closing Ledger Balance 155 ATM Cash Deposit 445 ATM Withdrawal
    045 Closing Cleared Balance 169 CHAPS or International Payment      466 Direct Debit
    972 Projected Cleared Balance Day +1      174 Bank Giro Credits 468 Card Transaction
    974 Projected Cleared Balance Day +2 189 ATM Cheque Deposit 475 Cheque Paid
    990 Total Uncleared Funds 201 Counter Deposit 508 Counter Withdrawal
        229 Faster Payment 529 D/D Funds Returned (Unpaid D/D)
        233 Reversal of Faster Payment 548 Faster Payment Sent
        241 Account Credit 566 Account Debit
        244 Interest Gross 641 Sweeping
        268 Sweeping 699 Sundry Debits
        399 Sundry Credit 962 CHAPS Debit

     




     BAI Balance and Transaction codes - Currency Account



     

    Code      Balance Description   Code       Credit Description Code       Debit Description
    015 Closing Ledger Balance 242 Inter Account Transfer      567 Inter Account Transfer     
    045 Closing Cleared Balance 243 Interest 568 Interest
    972 Projected Cleared Balance Day +1             
    974 Projected Cleared Balance Day +2        

Calls may be monitored or recorded in case we need to check we have carried out your instructions correctly and to help improve our quality of service.

Lloyds Bank plc Registered Office: 25 Gresham Street, London EC2V 7HN. Registered in England and Wales no. 2065. Telephone: 020 7626 1500.

Authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority under registration number 119278.

We subscribe to the Lending Code; copies of the Code can be obtained from www.lendingstandardsboard.org.uk.

Eligible deposits with us are protected by the Financial Services Compensation Scheme (FSCS). We are covered by the Financial Ombudsman Service (FOS). Please note that due to FSCS and FOS eligibility criteria not all business customers will be covered.