A plain-English introduction to Electronic Data Interchange — what it is, how X12 documents are structured, and how trading partners communicate.
EDI (Electronic Data Interchange) is the computer-to-computer exchange of business documents between companies in a standardized electronic format. Instead of printing a purchase order, faxing or emailing it, and waiting for a human to re-enter the data, EDI lets two systems exchange that purchase order automatically — in seconds, with no manual intervention.
EDI is used for Purchase Orders, invoices, shipping notices, payments, forecasts, and dozens of other business documents. It is mandatory for doing business with most large retailers and many logistics providers.
ANSI X12 (commonly called just "X12") is the EDI standard used in the United States and Canada for virtually all industries — retail, healthcare, transportation, manufacturing, and finance. x12port is built specifically around the X12 standard.
X12 is maintained by the Accredited Standards Committee X12 (ASC X12). Documents are organized into transaction sets, each identified by a 3-digit number (e.g., 850 = Purchase Order).
Every X12 document follows a strict hierarchical envelope structure:
ISA*00* *00* *ZZ*SENDERID *ZZ*RECEIVERID *230101*1200*^*00501*000000001*0*T*:~
GS*PO*SENDERID*RECEIVERID*20230101*1200*1*X*005010~
ST*850*0001~
BEG*00*SA*PO-12345**20230101~
... (transaction set segments) ...
SE*15*0001~
GE*1*1~
IEA*1*000000001~
| Segment | Name | Purpose |
|---|---|---|
ISA | Interchange Control Header | Outer envelope. Contains sender/receiver ISA IDs, test/production flag (ISA15), version number, and a unique interchange control number. |
GS | Functional Group Header | Groups related transaction sets. Contains functional ID code (e.g., "PO" for Purchase Orders), sender/receiver IDs, and group control number. |
ST | Transaction Set Header | Marks the beginning of a single transaction (e.g., one Purchase Order). Contains the transaction set identifier code (e.g., 850). |
| Body segments | — | The actual document content — line items, addresses, dates, quantities, prices, etc. |
SE | Transaction Set Trailer | Closes the transaction set. Contains segment count and transaction set control number. |
GE | Functional Group Trailer | Closes the functional group. |
IEA | Interchange Control Trailer | Closes the interchange envelope. |
| Element | Position | Meaning |
|---|---|---|
ISA06 | Element 6 | Sender's ISA Qualifier + ID (who sent this interchange) |
ISA08 | Element 8 | Receiver's ISA Qualifier + ID (who should receive it) |
ISA15 | Element 15 | T = Test, P = Production. Must be P in live exchanges. |
ISA13 | Element 13 | Interchange Control Number — must be unique per interchange |
ISA15=T (test) to a partner expecting production documents is a common mistake.
Always verify this flag before sending live transactions.
The most commonly used X12 transaction sets across industries:
| Set | Name | Used for |
|---|---|---|
| 850 | Purchase Order | Buyer places an order with a supplier. The foundational document in most EDI relationships. |
| 855 | Purchase Order Acknowledgment | Supplier confirms receipt and acceptance/rejection of an 850. Required by most retailers. |
| 856 | Ship Notice / ASN | Supplier notifies the buyer that goods have shipped. Includes carton contents, tracking, and label data. |
| 810 | Invoice | Supplier bills the buyer. Must reconcile against the 850 and 856 for three-way matching. |
| 820 | Payment Order / Remittance | Buyer sends payment detail and remittance information. |
| 997 | Functional Acknowledgment | Confirms receipt and syntactic validity of a functional group. Required for every exchange. |
| 204 | Motor Carrier Load Tender | Shipper tenders a freight load to a carrier. |
| 210 | Motor Carrier Freight Invoice | Carrier invoices the shipper for completed freight. |
| 214 | Shipment Status Message | Carrier provides in-transit status updates back to the shipper. |
| 830 | Planning Schedule / Forecast | Buyer sends a demand forecast to a supplier for production planning. |
| 832 | Price/Sales Catalog | Supplier sends product and pricing information to buyers. |
| 860 | Purchase Order Change | Buyer modifies a previously issued 850 (quantities, dates, prices). |
| 862 | Shipping Schedule | Just-in-time shipping instructions from buyer to supplier. |
| 990 | Response to Load Tender | Carrier accepts or rejects a 204 load tender. |
Trading partners exchange EDI documents over several types of connections. The method is typically dictated by the larger partner (usually a retailer or large manufacturer).
| Method | How it works | Common with |
|---|---|---|
| AS2 | Applicability Statement 2 — HTTP(S) with digital signatures and receipts (MDNs). The gold standard for high-volume, real-time EDI. | Walmart, Target, Amazon, Home Depot, Lowe's, Best Buy |
| SFTP | Secure FTP — files are placed in agreed inbox/outbox directories on a server. Simple to set up, asynchronous pickup. | Mid-market retailers, 3PLs, distributors |
| API | Modern REST/JSON integration — partner exposes an API endpoint that you POST documents to, or vice versa. | Modern ERPs, WMS systems, tech-forward partners |
| VAN | Value-Added Network — a third-party mailbox service routes documents between you and your partners. You connect once to the VAN and they route to all your partners. | SPS Commerce, TrueCommerce, GS1 US, DiCentral, 1 EDI Source |
The 997 Functional Acknowledgment is the X12 document you send back to confirm receipt of a functional group. It is mandatory in virtually all trading partner agreements and must be returned promptly — typically within 24 hours.
A 997 can indicate:
Failing to send 997s on time is a common source of chargebacks and compliance violations. Use the 997 Acknowledgment Tracker to stay current.
Before going live with a new trading partner, you exchange test documents to verify your setup.
During testing, ISA15=T (Test). Once both sides confirm everything is working, you switch to
ISA15=P (Production) and begin live exchanges.
x12port's API key system mirrors this: sandbox keys (xp_test_) for development,
live keys (xp_live_) for production.