Reference·X12 820·TRN
X12 820 Reference

X12 820 TRN Segment Guide: Fields, Format, and Testing Gotchas

Jul 28, 2026 · 5 min read

An 820 can carry a perfectly balanced set of premium amounts and still leave the receiving health plan stuck, because nothing in the file tells them which ACH deposit it belongs to. TRN is the segment that closes that gap, and it's the one testers skip most often because a file will parse fine without it ever being exercised for real.

Quick answer

TRN (Trace Number) is the segment in an X12 820 that assigns a unique reference number to the payment, so the health plan receiving premium funds can match this remittance file to the corresponding bank transaction. Without a usable TRN, reconciliation staff are left matching payments to deposits by dollar amount and date alone, which breaks down the moment two payments land the same day for similar totals.

The elements that actually matter in practice

TRN01 →
Trace Type Code — flags what kind of trace number this is — almost always 1, meaning a current transaction trace number assigned by the sender
TRN02 →
Reference Identification — the actual trace number, generated by the payer and expected to be unique enough to survive a lookup months later
TRN03 →
Originating Company Identifier — identifies whose numbering scheme TRN02 belongs to — typically the payer's or employer's company ID, often the same value carried in BPR10

Example

Synthetic example Generated by Synthibase
TRN*1*8842910076*1998765432

A synthetic trace number: TRN01=1 marks it as a current transaction trace, TRN02 is the unique reference the payer assigned, and TRN03 identifies the payer's company ID that issued it.

Where this trips people up

Test suites frequently generate TRN02 values that are sequential or reused across files, which never surfaces a bug until a health plan's reconciliation system rejects a payment as a duplicate because the trace number collided with one from months earlier. The other common gap is treating TRN03 as optional filler and leaving it blank or copying it verbatim from BPR10 without checking whether the two identifiers are actually supposed to match — some payers deliberately use different values for each, and a test file that always aligns them never proves out the mismatch case.

EDI 835 Remittance Advice: Complete Guide for Healthcare IT
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Generate realistic 820 trace numbers in seconds
Synthibase produces synthetic X12 820 files with unique, non-colliding TRN reference numbers on every run, so your reconciliation logic gets tested against real-world matching scenarios instead of a handful of reused values.
Start free trial →
This page is written independently by Synthibase for testing and informational purposes. It is not an official publication of HL7 International or X12/Washington Publishing Company, and is not a substitute for reviewing the official standard or your trading partner's companion guide. See our Terms of Service for full legal terms.