EDI 821 Explained: Format, Segments & Annotated Example

What Is EDI 821?
The EDI 821 is the X12 Financial Information Reporting transaction set. It carries account-level financial data from a financial institution to its customer, and in daily use it works as a bank balance and activity report. Each file names the reporting bank, lists one or more accounts, gives the balances for each account and, optionally, includes the individual transactions that moved those balances. The standard itself is maintained by the Accredited Standards Committee X12.
The 821 belongs to functional group FR (Financial Reporting). That GS01 value matters. Translators route inbound files by functional group code and transaction set ID, so a wrong GS01 can send a bank file to the wrong map or leave it sitting unprocessed in a mailbox.
Who Sends and Receives the 821
Banks and other financial institutions are the senders. Corporate treasury, accounts receivable, cash management and finance operations teams sit on the receiving end. Most files arrive once a day with prior-day reporting, and some banks add intraday files during business hours. Delivery usually runs over AS2, SFTP or a value-added network (VAN), the same channels many companies already use for customer and supplier documents. If you are building connectivity for the first time, our overview of how to set up EDI covers the basics.
What the 821 Reports
A typical file reports opening and closing ledger balances, available and collected balances, float, and summary totals of credits and debits. When the bank includes item-level detail, each entry carries a type code, an amount, a bank reference and a description. Common examples are ACH credits, lockbox deposits, incoming and outgoing wires, and paid checks.
X12 Versions: 4010 vs. 5010
Most banks still support version 004010, and many also offer 005010. Element definitions and code lists can differ between the two. The acknowledgment changes as well: 4010 environments typically return a 997, while 5010 environments often use a 999. Confirm the version in GS08 and ISA12 before you build any maps, and get the answer in writing from the bank.

Seamless EDI & ERP Integration
Connect your ERP, WMS, and business systems with automated EDI processing that eliminates manual data entry and reduces errors.
Schedule a Discussion
EDI 821 Format Explained
The 821 follows the standard X12 hierarchy. An interchange envelope wraps a functional group, which in turn wraps one or more transaction sets. Inside each set, segments are organized into heading, detail and summary areas, and loops repeat to cover multiple accounts, balances and transactions. For broader background on the standard and its history, see the ASC X12 entry on Wikipedia.
Envelope Structure and Delimiters
Every file runs ISA > GS > ST*821 > ... > SE > GE > IEA. The ISA segment is fixed length at 106 characters. Its fourth character defines the element separator, ISA16 defines the component (sub-element) separator, and the character immediately after ISA16 is the segment terminator. In 5010, ISA11 carries the repetition separator; in 4010, that position holds the standards identifier "U". Never hardcode delimiters. Read them from the ISA on every file, because a bank can change them during a platform upgrade with little notice.
Heading, Detail and Summary Areas
The heading identifies the report: ST, BGN (purpose code, reference and date), DTM (report or as-of dates) and the N1 loop (bank and party names). The detail area repeats for each account. It typically includes ACT (account identification), BAL (balance detail), TSU (transaction summary) and FIR (financial information or item detail). Some implementations group accounts under an ENT (entity) loop, which helps when one company reports on behalf of several subsidiaries. The summary area closes with SE, whose SE01 count includes both the ST and SE segments.
EDI 821 Segment Reference Table
The reference below lists each segment with its name, its purpose and its usual requirement level, in the order the segments appear in a file:
- ST, Transaction Set Header: identifies the 821 and its control number. Required.
- BGN, Beginning Segment: purpose code, report reference and creation date. Required.
- DTM, Date/Time Reference: as-of or report dates. Optional, though most banks send it.
- N1 loop, Name: bank and account-holder parties. Optional.
- ENT, Entity: groups accounts by legal entity or subsidiary. Implementation-dependent.
- ACT, Account Identification: account number and account name. Required for each account.
- BAL, Balance Detail: balance type, qualifier and amount. Repeats once per balance.
- TSU, Transaction Summary: counts and totals by category. Optional.
- FIR, Financial Information: individual transaction detail. Optional and repeating.
- SE, Transaction Set Trailer: segment count and control number. Required.
Loop repetition limits, element order and code lists vary by bank and version. Treat this list as a starting map, then verify every segment against your trading partner's implementation guide.

EDI 821 Example: Annotated Sample File
The sample below reports prior-day activity for one operating account at a fictional bank. It uses 4010 envelopes, "*" as the element separator and "~" as the segment terminator. All names, numbers and qualifier values are illustrative. Code lists at a real bank will differ, so use this file to understand structure, not as a production specification.
Raw X12 821 Sample
ISA*00* *00* *ZZ*BANKID *ZZ*COMPANYID *250314*0600*U*00401*000000123*0*P*>~
GS*FR*BANKID*COMPANYID*20250314*0600*123*X*004010~
ST*821*0001~
BGN*00*RPT20250314*20250314~
DTM*007*20250313~
N1*BK*FIRST EXAMPLE BANK~
ENT*1~
ACT*123456789*ACME DISTRIBUTION OPERATING~
BAL*M*OL*1250000.00~
BAL*M*CL*1310500.00~
BAL*M*CA*1295500.00~
TSU*CR*2*185000.00~
TSU*DR*2*124500.00~
FIR*165*135000.00*ACH0313001*ACH CREDIT CUSTOMER PMT~
FIR*115*50000.00*LBX0313002*LOCKBOX DEPOSIT~
FIR*495*99500.00*WIR0313003*OUTGOING WIRE SUPPLIER~
FIR*475*25000.00*CHK004512*CHECK PAID~
SE*16*0001~
GE*1*123~
IEA*1*000000123~
Segment-by-Segment Walkthrough
- ISA/GS: Interchange from BANKID to COMPANYID. GS01 = FR confirms a financial reporting group, and GS08 = 004010 sets the version.
- ST8210001: Transaction set 821, control number 0001.
- BGN*00: Original report (purpose code 00), reference RPT20250314, created March 14, 2025.
- DTM00720250313: Effective or as-of date for the balances. Qualifier choice is bank-specific.
- N1*BK: Identifies the reporting bank.
- ENT*1: Opens the first entity grouping.
- ACT: Account 123456789, named ACME DISTRIBUTION OPERATING.
- BAL: BAL01 is the balance type, BAL02 the amount qualifier and BAL03 the amount. Here OL, CL and CA stand in for opening ledger, closing ledger and closing available. Your bank defines the real codes.
- TSU: Two credits totaling 185,000.00 and two debits totaling 124,500.00. Element order is illustrative.
- FIR: One line per item. The type codes mirror common BAI-style codes: 165 ACH credit, 115 lockbox, 495 outgoing wire and 475 check paid. Each line also holds an amount, a unique reference and free-text detail.
- SE*16: Sixteen segments from ST through SE, matching control number 0001.
- GE/IEA: One transaction set and one functional group, with matching control numbers.
Human-Readable Translation
Translated into plain accounting terms, the file says this about account 123456789:
- Opening ledger on 03/13/2025: 1,250,000.00 USD
- Plus ACH credit (ACH0313001): 135,000.00
- Plus lockbox deposit (LBX0313002): 50,000.00
- Less outgoing wire (WIR0313003): 99,500.00
- Less check paid #4512: 25,000.00
- Closing ledger: 1,310,500.00
- Closing available, after 15,000.00 of float: 1,295,500.00
The math ties out: 1,250,000 plus 185,000 minus 124,500 equals 1,310,500. Run the same proof on every inbound file, and treat a mismatch as a hard stop rather than a warning.

EDI 821 vs. BAI2, camt.052/053 and Related X12 Sets
Banks report balances in several formats, and most corporates end up receiving more than one. Knowing where the 821 fits helps you set clear requirements with each bank and design a single internal data model that absorbs all of them.
821 vs. BAI2 and ISO 20022
BAI2 is a flat, comma-delimited balance reporting format widely used by US banks, now maintained by X9 under the name BTRS. ISO 20022 camt.052 delivers intraday account reports, and camt.053 delivers end-of-day statements in XML with richer remittance and party data. The 821 overlaps with all three. It suits companies that already run an X12 translator and want bank data flowing through the same pipeline as their purchase orders, invoices and shipping notices.
821 vs. 820, 822, 823 (and Why It Is Not the 812)
The 820 carries payment orders and remittance advice; our guide to understanding EDI 820 explains it in detail. The 822 reports account analysis, meaning bank service charges and fees. The 823 delivers lockbox deposit detail. The 812 is a Credit/Debit Adjustment exchanged between trading partners and has nothing to do with bank balance reporting, so keep it separate from the 821 in your maps and documentation.
Choosing or Supporting Multiple Formats
Ask each bank which formats and versions it supports, how intraday reporting works, and how its transaction codes are assigned. Then normalize every format into one internal structure: account, balance type, amount, date and item detail. Downstream cash and reconciliation logic stays the same no matter which format a given bank sends.
Consider a hypothetical distributor with accounts at three banks: one sends BAI2, another sends the 821 in 4010, and a third sends camt.053. If each format feeds its own reconciliation rules, every bank change turns into a finance project. If all three land in one common record first, the matching logic only has to be written once, and adding a fourth bank becomes a mapping task instead of a rebuild.
Implementing EDI 821: Bank-to-ERP Workflow
A reliable 821 integration moves through four stages: receive, acknowledge, validate and map. Automate each stage, and alert someone when any of them fails before the treasury team starts its day.
Receipt and 997/999 Acknowledgment
Receive the file over the agreed channel and archive the raw data unchanged. Return a 997 for 4010 or a 999 for 5010, if your bank requires one. Monitor for missing files by account and business day. A file that never shows up is as damaging as one that fails parsing, and these gaps are a classic example of silent EDI failures that go unnoticed until a cash position looks wrong.
Validation Checks
Run these checks against each file:
- Envelope control numbers match across ISA/IEA, GS/GE and ST/SE.
- SE01 equals the actual segment count.
- Each account appears in your bank account master.
- Required BAL qualifiers are present.
- Dates fall on the expected business day.
- Opening balance plus net activity equals closing ledger.
- The file is not a duplicate of one already processed.
Mapping Balances and Transactions
Map closing ledger and available balances to cash positioning and forecasting. Map FIR detail to bank reconciliation, matching lockbox and ACH credits to open AR and matching paid checks and wires to AP. Maintain a cross-reference table from bank transaction codes to GL accounts and reconciliation rules, and review it whenever a bank adds new codes. Keep every balance and item tied to the BGN reference as well, so an auditor can trace any GL entry back to the original file.
Common EDI 821 Errors and Fixes
- Delimiter mismatch: parse delimiters from the ISA instead of assuming "*" and "~".
- Missing ACT or BAL qualifiers: reject the file and report it to the bank with the specific account and segment.
- Date format errors: confirm CCYYMMDD vs. YYMMDD by version and segment.
- SE count errors: recount segments from ST through SE inclusive.
- Unmapped transaction codes: route them to an exception queue rather than a suspense GL account.
Simplify Your EDI 821 Integration with a WMS
The 821 is compact, but production-grade handling is not. You need delimiter-aware parsing, version-specific maps, acknowledgments, balance proofs and clean hand-offs to ERP and treasury systems. When you evaluate a warehouse management system and the EDI layer around it, ask whether bank reporting files could travel through the same monitored channel as the order, shipping and warehouse documents your operation already exchanges. A setup built that way can apply one set of alerts, one archive and one escalation process to every inbound file, whether it comes from a retailer, a 3PL or a bank.
Useful questions to raise with the platform you evaluate:
- Which X12 versions and functional groups can its translator accept, including FR?
- Are delimiters read from each ISA rather than configured once per partner?
- Where do unmapped codes land, and can finance staff see and clear them?
- How does it detect a file that never arrives?
Request a Call to discuss your EDI integration plans with Comparatio.
Frequently Asked Questions
What is an EDI 821 file used for?
An EDI 821 file is a bank balance and activity report sent from a financial institution to a corporate customer. It lists accounts, ledger and available balances, and optionally individual items such as ACH credits, wires and paid checks. Treasury teams use it for daily cash positioning, while accounting teams use the item detail for bank reconciliation.
What is the difference between EDI 821 and BAI2?
Both report bank balances and transactions, but they use different structures. BAI2, now maintained by X9 as BTRS, is a flat comma-delimited file, while the 821 is an X12 transaction set with ISA and GS envelopes. Companies that already run an X12 translator often prefer the 821 because it fits the pipeline they use for other EDI.
Do I need to send a 997 back for an 821?
Only if your bank requires it, so confirm during onboarding. When an acknowledgment is expected, 4010 implementations usually return a 997 functional acknowledgment, and 5010 implementations often return a 999. Either one tells the bank the file arrived and passed syntax checks, which helps both sides spot transmission problems early.
How is EDI 820 different from EDI 821?
The 820 carries payment orders and remittance advice, telling a payee what is being paid and why. The 821 reports what already happened in a bank account, including balances and posted items. A company might receive an 820 from a customer explaining a payment, then see that same payment arrive as an ACH credit on the next 821.
How can I tell if an 821 file is valid?
Check that control numbers match between ISA and IEA, GS and GE, and ST and SE, and that SE01 equals the real segment count. Then confirm every account exists in your bank master and that the opening balance plus credits minus debits equals the closing ledger figure. Also reject duplicate files that were already processed.
Table of Contents
Subscribe to the Blog
Get the latest EDI insights delivered to your inbox.
Related Articles

November 12, 2026
EDI ROI: 4 Savings Levers and a Payback Formula Execs Trust
Build an EDI ROI case executives trust: four savings buckets, EDI ACH cash application, payback and 3-year ROI formulas, plus a worked distributor example.
Read More →
November 3, 2026
Difference Between Credit Card Processing and EDI Processing
Learn the difference between credit card processing and EDI processing: one moves money, the other moves orders, invoices and remittance data. Compare costs.
Read More →
October 27, 2026
EDI Software Cost: The 6 Hidden Drivers Behind Your Quote
Learn the six drivers behind EDI software cost, how per-partner, per-document, subscription and managed pricing differ, and how to build a realistic TCO.
Read More →Tell us who your trading partners are
Send us your partner list, and we’ll tell you which maps already exist and what a go-live plan looks like.