Reference·REF Segment·REF02
X12 837P Reference

What Is X12 837P REF02? Reference Identification, Explained for Testers

Jul 27, 2026 · 4 min read
← REF01 REF*G1 →

REF02 is just a string — nothing in the segment itself enforces that a value claiming to be a prior authorization number actually looks like one the payer issued, which is exactly the kind of thing that slips past syntax validation and only fails once a real adjudication system checks it.

Quick answer

REF02 is the second element of the REF segment — the actual reference value being carried, whose format, length, and meaning depend entirely on the qualifier code sitting in REF01 immediately before it.

What this element contains

Format
Free-form alphanumeric string — up to 50 characters, no fixed structure defined by X12 itself
Meaning
Fully dependent on REF01 — the same string could be an auth number, a claim number, or a chart number
Round-trip
Sometimes echoed by the payer — prior auth and referral numbers in particular are often validated against what the payer already has on file

Example

Synthetic example Generated by Synthibase
REF*G1*AUTH88213221*

AUTH88213221 in REF02 is only meaningful because REF01 = G1 tells the reader it is a prior authorization number. Synthetic claim data.

Where this trips people up

Test data generators that produce REF02 values with a random string generator, decoupled from what a real payer-issued authorization or referral number actually looks like, pass structural validation every time but fail any downstream check that verifies the reference against the payer's own records — a gap that stays invisible until claims hit a real adjudication system.

Testing X12 837P REF: The Fields Your System Actually Needs to Handle
How to Validate X12 EDI Files Before Payer Submission
X12 278 Prior Authorization: Format, Fields, and Testing Guide
Generate reference values that look and behave like the real thing
Synthibase generates synthetic REF02 values formatted the way real payer-issued authorization, referral, and claim numbers are formatted — not arbitrary strings that only pass syntax checks.
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.