Reference·TRN Segment·TRN02
X12 820 Reference

TRN02 in X12 820: A Field Guide to Reference Identification

Jul 28, 2026 · 4 min read
← TRN01 TRN03 →

TRN02 is a free-form field with no required structure, which makes it easy to generate and easy to get wrong in a way that never shows up until two payments collide months apart.

Quick answer

TRN02 is the reference identification value in the TRN segment of an X12 820 — the actual trace number a payer assigns to a specific payment. It's a free-text field with no fixed format, but it's expected to function as a unique key the receiving health plan can use to look up and reconcile the corresponding bank transaction.

The elements that actually matter in practice

TRN02
Reference Identification — the trace number itself — no fixed format is required, but real-world usage expects it to be unique within the payer's numbering scheme

Example

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

A synthetic TRN segment where TRN02=8842910076 is the trace number the payer is expected to keep unique across its outbound payment files.

Where this trips people up

Because TRN02 has no enforced format, synthetic test data generators often produce sequential or low-entropy values that look fine in isolation but collide the moment a test suite runs across a larger volume of files. That never surfaces a bug in a five-file smoke test, but it will surface one the first time a real reconciliation system rejects a payment because the trace number was already on file from a prior date — a scenario synthetic data needs to deliberately include, not just avoid.

X12 820 TRN Segment Guide: Fields, Format, and Testing Gotchas
EDI 835 Remittance Advice: Complete Guide for Healthcare IT
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Generate collision-free TRN02 values automatically
Synthibase produces synthetic X12 820 files with guaranteed-unique trace numbers, and can also generate deliberate collisions on demand so your reconciliation logic gets tested against both cases.
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.