ANSI X12 EDI reference
The ANSI X12 hub: 9 transaction sets, 30 segments
Transaction sets
X12 transaction sets (9)
Business documents identified by a three-digit code. Each links to its full reference page.
Purchase Order
The X12 850 is an electronic purchase order sent by a buyer or retailer to a supplier, carrying PO number, ship-to parties, line items, quantities, and delivery dates.
856Advance Ship Notice (ASN)
The X12 856 advance ship notice (ASN) tells a buyer what shipped, when, and how cartons and items are packed — often before the shipment arrives.
810Invoice
The X12 810 is an electronic invoice from supplier to buyer, carrying invoice number, dates, PO references, line items, and totals for payment processing.
997Functional Acknowledgment
The X12 997 functional acknowledgment confirms whether a partner accepted the syntax of your outbound functional group — not whether the business document was approved.
862Shipping Schedule
The X12 862 shipping schedule is sent by a buyer to a supplier to authorize precise ship/delivery quantities and timing, typically supplementing the 830 planning schedule in just-in-time manufacturing.
875Grocery Products Purchase Order
The 875 grocery products purchase order is the UCS-standard order a grocery buyer sends to a supplier, carrying order identification, parties, and line items for food and grocery distribution.
880Grocery Products Invoice
The 880 grocery products invoice is the UCS-standard invoice a supplier sends to a grocery buyer, carrying invoice identification, parties, line items, and allowance/charge detail.
945Warehouse Shipping Advice
The X12 945 warehouse shipping advice is sent by a warehouse or 3PL to the depositor (seller) to confirm what was actually shipped against a 940 warehouse shipping order.
947Warehouse Inventory Adjustment Advice
The X12 947 warehouse inventory adjustment advice is sent by a warehouse or 3PL to the depositor to report inventory adjustments — damage, count corrections, or status changes — with reason codes.
Segments
X12 segments (30)
Reusable building blocks identified by a two- or three-letter tag. Each links to its full reference page.
Interchange Control Header
The ISA segment opens every X12 interchange. It declares element and segment separators, identifies the sender and receiver, and assigns the interchange control number partners use for correlation.
GSFunctional Group Header
GS groups related transaction sets (for example all purchase orders in one batch). GS01 functional ID tells parsers whether the group carries PO, invoice, or acknowledgement traffic.
STTransaction Set Header
ST opens each transaction set inside a functional group. ST01 is the transaction set identifier; ST02 is the control number partners reference in 997 AK2 loops.
BEGBeginning Segment for Purchase Order
BEG is the business header for EDI 850 purchase orders. It carries the PO number partners use for matching, invoicing, and ASN correlation.
PO1Baseline Item Data
PO1 repeats for each line on an 850. It binds quantity, unit of measure, pricing, and product identifiers (UPC, SKU, vendor part number).
BSNBeginning Segment for Ship Notice
BSN opens an 856 ASN. It identifies the shipment, purpose code, and ship date — the anchors retailers use to match trailers and invoices.
HLHierarchical Level
HL builds the shipment → order → pack → item tree in an 856. HL03 parent ID links each level so retailers can reconcile nested quantities.
BIGBeginning Segment for Invoice
BIG opens an 810 invoice. It carries invoice number, invoice date, and the purchase order number used to match the original 850 and 856.
TDSTotal Monetary Value Summary
TDS states the invoice total. Partners compare TDS against summed IT1 amounts; mismatches are hard rejects or short-pay triggers.
N1Name
N1 identifies trading parties in a transaction — ship-to, bill-to, buyer, seller, remit-to. N101 entity identifier and N104 ID codes must match partner enrollment or documents reject before line items are evaluated.
REFReference Identification
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.
IT1Baseline Item Data (Invoice)
IT1 describes each invoiced line on an 810 — quantity, unit of measure, unit price, and product identifiers. IT107 and IT113 tie lines back to the original PO and ASN for three-way match.
PIDProduct Item Description
PID adds descriptive text or structured product attributes to line items. Some retailers require PID for private-label SKUs; others treat it as optional when GTIN is present.
CTTTransaction Totals
CTT01 reports the number of line items in the transaction set. Validators compare CTT01 to actual PO1/IT1/HL counts — mismatches trigger 997 rejects.
GEFunctional Group Trailer
GE ends each GS..GE envelope. GE01 counts ST..SE transaction sets; GE02 must match GS06 group control number referenced in 997 AK1.
BAKBeginning Segment for PO Acknowledgment
BAK opens an 855 purchase order acknowledgement. BAK02 type codes (AC=acknowledge with detail, AD=accept, RJ=reject) tell the retailer how you intend to fulfill the PO.
CLDLoad Detail
CLD describes cartons or handling units within an HL shipment loop — quantity per carton, packaging code, and weight. CLD pairs with REF and MAN (SSCC) segments for scan-based receiving.
AK1Functional Group Response Header
AK1 in a 997 identifies the functional group (GS) being acknowledged. AK102 echoes GS06 so you can correlate responses to outbound batches.
AK2Transaction Set Response Header
AK2 loops inside a 997 for each transaction set acknowledged. AK201 is the transaction set ID; AK202 matches your ST02.
AK5Transaction Set Response Trailer
AK5 closes each AK2 loop with the transaction set disposition. AK501 A/E/R is the first field integrators check after sending.
AK9Functional Group Response Trailer
AK9 summarizes the entire functional group's disposition after all AK2 loops. AK901 A/E/P/R tells integrators whether any transaction set in the group failed.
SETransaction Set Trailer
SE ends each ST..SE envelope. SE01 counts segments including ST and SE; SE02 must match ST02.
LINItem Identification
LIN appears at item-level HL loops in 856 ASNs. It binds shipped product IDs and quantities to the original PO lines for retailer receiving and three-way match.
DTMDate/Time Reference
DTM carries qualifier-coded dates and times used throughout X12 documents — requested ship dates, delivery windows, invoice dates, and service periods. DTM01 says which date the DTM02 value represents.
N3Address Information
N3 carries the street address lines for a party identified by the preceding N1 segment. It pairs with N4 (city/state/postal) to complete ship-to, bill-to, and remit-to addresses.
N4Geographic Location
N4 completes the address for a party in an N1 loop by carrying city, state or province, postal code, and country code. It follows N3 street lines and is used for routing and tax determination.
PERAdministrative Communications Contact
PER attaches a contact to a party or document — buyer, seller, or shipping contact — with a function code and communication numbers such as telephone, email, and fax.
TD1Carrier Details (Quantity and Weight)
TD1 reports packaging code, lading quantity, and gross weight for a shipment or handling unit. It supports carrier handoff and receiving reconciliation, most often on 856 ASNs.
TD5Carrier Details (Routing Sequence/Transit Time)
TD5 conveys routing and carrier details — the SCAC carrier code, transportation method, and routing sequence — so buyers know how a shipment moves. It is common on 856 ASNs and routing requests.
SACService, Promotion, Allowance, or Charge Information
SAC reports allowances (deductions) and charges (additions) such as freight, handling, or promotional discounts. SAC01 declares allowance vs charge; getting it wrong skews invoice totals and triggers deductions.
FAQ
X12 questions
ANSI X12 is the US EDI standard maintained by X12. It defines transaction sets (business documents like 850 purchase orders and 810 invoices) built from reusable segments (like N1 for parties and DTM for dates), which in turn hold data elements.
A transaction set is a complete business document, identified by a three-digit code (850, 856, 810, and so on). A segment is a reusable building block inside a transaction set, identified by a two- or three-letter tag (BEG, PO1, N1, DTM) that groups related data elements.
This hub links all 9 transaction sets SignalEDI documents — including 850 purchase orders, 856 advance ship notices, 810 invoices, and 997 functional acknowledgments — plus the 30 segments referenced across them.
Map and validate X12 documents with SignalEDI
Send and receive 850, 856, 810, and more as JSON, with segment-level mapping and a free EDI validator.