Reference·X12 837P·REF
X12 837P Reference

Testing X12 837P REF: The Fields Your System Actually Needs to Handle

Jul 27, 2026 · 6 min read

REF is one of the most reused segments in all of X12 — the exact same structure shows up in eligibility inquiries, prior auth requests, remits, and claims alike — and what it actually means at any given spot depends entirely on a two-character qualifier in REF01. Get that qualifier wrong when building or reading test data and you attach a real-looking reference number to the wrong purpose entirely.

Quick answer

REF (Reference Identification) is a generic two-element segment used throughout X12 to attach a supplementary reference number to whatever loop it appears in. In an 837P claim it shows up repeatedly — prior authorization numbers, referral numbers, original claim numbers for corrections — with REF01 stating what kind of number REF02 holds.

Common qualifier values seen in an 837P claim

G1 →
Prior Authorization Number — links the claim to a payer-issued authorization on file — see the dedicated page below
F8 →
Original Reference Number — ties a correction or void claim back to the claim it replaces — see the dedicated page below
9F
Referral Number — carries the referral authorization number when a service required one
EA
Medical Record Identification Number — the provider's internal chart or record number for the encounter
D9
Claim/Adjustment Identifier — used in some claim-status and adjustment scenarios to reference a related claim identifier

Example

Synthetic example Generated by Synthibase
REF*G1*AUTH88213221*

Qualifier G1 tells the reader that AUTH88213221 is a prior authorization number, not a referral or claim number. Synthetic claim data.

Where this trips people up

Because REF has the same two-element shape everywhere it appears, it's easy for a mapping engine — or a hand-built test file — to drop the wrong qualifier into REF01 while the actual reference value in REF02 looks perfectly plausible either way. The segment parses cleanly and passes syntax validation regardless of which qualifier is used; the payer just reads the number as the wrong kind of reference, and that usually surfaces as a rejection or a stalled adjudication rather than an obvious syntax error.

What is X12 837P? Complete Format and Field Guide
X12 278 Prior Authorization: Format, Fields, and Testing Guide
Generate synthetic REF segments with the right qualifiers
Synthibase generates synthetic 837P claims with correctly qualified REF segments — prior auth numbers, referral numbers, original claim references — no PHI, no mismatched qualifiers.
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.