EDI-X12 EDI-X12 by datax3.com
Guide

Getting started with EDI X12

A 30-minute primer. By the end, you'll be able to read an X12 file, explain it to a non-technical colleague, and tell a retailer's EDI team what they actually need from you.

What EDI X12 actually is

X12 is a fixed-grammar text format. Every business document — purchase order, invoice, ship notice — is written as a sequence of segments. Each segment starts with a 2- or 3-character code (BEG, REF, PO1) and ends with a terminator (typically ~). Segments group into transactions, transactions group into function groups, function groups go inside an interchange envelope.

A minimal 850 looks like this:

ISA*00*          *00*          *ZZ*SENDERID       *ZZ*RECEIVERID    *250506*1200*U*00401*000000001*0*P*>~
GS*PO*SENDERID*RECEIVERID*20250506*1200*1*X*004010~
ST*850*0001~
BEG*00*SA*PO12345**20250506~
REF*VR*VENDOR1~
N1*ST*WAREHOUSE A~
N3*123 MAIN ST~
N4*DALLAS*TX*75201*US~
PO1*1*5*EA*12.50**VC*ABC123~
CTT*1~
SE*8*0001~
GE*1*1~
IEA*1*000000001~

How to read it

  1. ISA says "from SENDERID to RECEIVERID, on 2025-05-06 at 12:00, this is interchange #1, version 00401."
  2. GS says "this is a group of POs (PO), one transaction, version 004010."
  3. ST says "this is an 850 (purchase order), transaction control number 0001."
  4. BEG is the PO header: PO type "00" (original), purpose "SA" (stand-alone), PO number PO12345, date 2025-05-06.
  5. REF*VR is the vendor reference: "VR" qualifier means vendor ID, value VENDOR1.
  6. N1*ST / N3 / N4 is the ship-to address.
  7. PO1 is line 1: 5 each of vendor part ABC123 at $12.50.
  8. CTT is the line count.
  9. SE / GE / IEA close everything in reverse, with control numbers that must match.

The five things that go wrong

  1. Mismatched control numbers. The number in IEA must equal the number in ISA. Same for GE/GS and SE/ST.
  2. Wrong delimiters. The ISA segment declares the delimiters. If the rest of the file uses different ones, every segment is wrong.
  3. Missing required segments. Partners often require REF, DTM, or N1 segments the X12 baseline doesn't.
  4. Bad qualifier codes. REF*VR vs REF*IA vs REF*PO — each means something different. The implementation guide lists which qualifiers your partner accepts.
  5. Wrong envelope IDs. ISA sender/receiver IDs are partner-assigned. If they don't match what the partner expects, the file is rejected before it's even parsed.

Your first hour

  1. Open the validator. Click Load sample 850 to populate Window 1.
  2. Click Validate. You'll see a clean structural report.
  3. Change the SE*8*0001 to SE*9*0001. Re-validate. You'll get an "SE segment count mismatch" error. This is the kind of error retailers reject for.
  4. Click Explain with AI. The AI walks through the file segment by segment.
  5. Get your partner's implementation guide PDF. Compare each required segment to the sample.

What you still need

Next steps

Ready?

Open the validator, paste a file, and start reading.

Open the validator