X12 segment reference
REF — Reference Identification
Learn the X12 REF segment: PO numbers, department codes, contract references, and qualifier codes used across retail and healthcare EDI.
REF segment facts
- REF02 values must round-trip across 850 → 855 → 856 → 810 or retailers flag invoice and ASN mismatches for chargebacks.
- Department REF loops (DP qualifier) are common on big-box retail 850s and drive routing inside the buyer's ERP.
- SignalEDI validation surfaces REF/BEG/BIG cross-field mismatches before documents leave your sandbox.
What the REF segment does
REF carries business references that tie documents together — purchase order numbers, release numbers, department IDs, and internal tracking keys. Partners score REF accuracy for chargeback prevention.
Loop: Header or line-level REF loops
Key elements
| Element | Name | Description |
|---|---|---|
| REF01 | Reference identification qualifier | PO=purchase order, DP=department, CR=customer reference, IA=internal vendor number. |
| REF02 | Reference identification | The actual reference value — must match the originating document. |
Example REF segment
REF*PO*PO-1042~
Parse and validate samples with the free EDI validator or send JSON via the JSON→X12 mapping guide.
Common REF errors
- REF02 PO number mismatch vs BEG03
- Missing mandatory REF for retailer department
- Duplicate REF qualifiers in same loop
Related reference
FAQ
Frequently asked questions
Often at shipment and order levels — PO references must match the original 850 and any 855 acknowledgement.
Qualifier PO marks REF02 as a purchase order number used to link invoice or ASN back to the retailer's order.