X12 850 example: a purchase order explained segment by segment
A complete ANSI X12 850 purchase order, version 004010, with what each segment and element means. The companies, people and numbers are fictional; the structure is what a buyer sends to a supplier.
The complete 850 file
One segment per line here for reading. The tilde (~) ends each segment, the asterisk (*) separates elements, and > separates components. These three characters are declared by the ISA segment itself.
ISA*00* *00* *ZZ*NOVAIRSENDER *ZZ*ACMEBUYER *260906*1200*U*00401*000000905*0*P*>~ GS*PO*NOVAIR*ACME*20260906*1200*905*X*004010~ ST*850*0001~ BEG*00*SA*PO-2026-0042**20260906~ REF*DP*072~ PER*BD*MARIE DUPONT*TE*0102030405~ FOB*PP~ DTM*002*20260915~ N1*BY*ACME DISTRIBUTION*92*ACME01~ N3*12 RUE DE LA GARE~ N4*PARIS**75010*FR~ N1*SE*NOVAIR SUPPLIES*92*NOV01~ PO1*1*120*EA*4.75**BP*ART-1001*UP*340093500001~ PID*F****HDMI CABLE 2M~ PO1*2*48*EA*12.30**BP*ART-1002*UP*340093500002~ PID*F****USB-C ADAPTER~ CTT*2~ SE*16*0001~ GE*1*905~ IEA*1*000000905~
Open this sample in the free online EDI viewer (nothing uploaded)
ISA: the only fixed-width segment
ISA has 16 elements of fixed length, and the whole segment is exactly 106 characters. A translator reads the separators from fixed positions: the element separator is character 4, the component separator is character 105 (here >) and the segment terminator is character 106 (here ~).
- ISA05 and ISA07: the sender and receiver ID qualifiers (ZZ, mutually defined).
- ISA06 and ISA08: the sender and receiver IDs, always padded with spaces to 15 characters.
- ISA09 and ISA10: the date (YYMMDD) and the time (HHMM).
- ISA12: the version of the interchange control segments (00401).
- ISA13: the interchange control number, 000000905, repeated by IEA02.
- ISA15: P for production, T for test.
A sender ID padded to 14 characters instead of 15 shifts every position after it: the separators read are wrong and the whole file falls apart. It is the first thing to check when a single-line X12 file is rejected before any transaction set is read.
GS and GE: the functional group
GS*PO*NOVAIR*ACME*20260906*1200*905*X*004010 opens a group of purchase orders (functional identifier PO), from the application sender to the receiver, with the group control number 905 and the version 004010. GE*1*905 closes it: one transaction set, same control number.
ST to SE: the purchase order itself
- ST*850*0001: transaction set 850, Purchase Order, control number 0001.
- BEG*00*SA*PO-2026-0042**20260906: purpose 00 (Original), type SA (Stand-alone Order), the PO number and the PO date.
- REF*DP*072: a reference, here the department number.
- PER*BD: the buyer's contact and a phone number (TE).
- DTM*002*20260915: qualifier 002, Delivery Requested.
- N1*BY and N1*SE: the buying party and the selling party, with their IDs (qualifier 92, assigned by buyer); N3 and N4 give the address.
- PO1*1*120*EA*4.75**BP*ART-1001*UP*340093500001: line 1, 120 each at 4.75, the buyer's part number (BP) and the UPC (UP).
- PID*F****HDMI CABLE 2M: a free-form description of the item.
- CTT*2: two line items, which must equal the number of PO1 segments.
- SE*16*0001: 16 segments from ST to SE, both included, and the control number of ST.
Why an 850 gets rejected
- SE01 does not match the number of segments from ST to SE.
- CTT01 does not match the number of PO1 lines.
- IEA02 differs from ISA13, or GE02 from GS06, or SE02 from ST02.
- ISA is not exactly 106 characters, so the separators are read in the wrong place.
- A mandatory segment such as BEG or PO1 is missing, or N1 has no entity identifier code.
Frequently asked questions
What is an X12 850?
The ANSI X12 transaction set for a purchase order. A buyer sends it to a supplier; it carries the PO number and date, the parties, the delivery date and one PO1 segment per line item.
What is the difference between 004010 and 005010?
They are two versions of the X12 standard, declared in GS08. Many retail and supply-chain partners still use 004010; the version a partner expects is in their implementation guide.
Why does ISA have so many spaces?
Because every ISA element has a fixed length. Empty authorization fields and short IDs are padded with spaces so that the segment is always 106 characters long.
How do I read an X12 file?
Open it in EDI Reader for VS Code, or drop it on the free online EDI viewer: each segment is named, each element labelled, and known codes are explained. Nothing is uploaded.
Read your own files the same way
EDI Reader for VS Code names every segment and code of your EDIFACT and X12 files, on your machine. Free, no account; Pro adds the check, CSV and JSON export and folder checks.
A format or an in-house rule of your own? We build it in five working days, at a fixed price: EUR 490 + VAT where applicable, per work package. See the work packages