EDI Basics

A plain-English introduction to Electronic Data Interchange — what it is, how X12 documents are structured, and how trading partners communicate.

What is EDI?

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.

The X12 Standard

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).

Document Structure

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~
SegmentNamePurpose
ISAInterchange Control HeaderOuter envelope. Contains sender/receiver ISA IDs, test/production flag (ISA15), version number, and a unique interchange control number.
GSFunctional Group HeaderGroups related transaction sets. Contains functional ID code (e.g., "PO" for Purchase Orders), sender/receiver IDs, and group control number.
STTransaction Set HeaderMarks the beginning of a single transaction (e.g., one Purchase Order). Contains the transaction set identifier code (e.g., 850).
Body segmentsThe actual document content — line items, addresses, dates, quantities, prices, etc.
SETransaction Set TrailerCloses the transaction set. Contains segment count and transaction set control number.
GEFunctional Group TrailerCloses the functional group.
IEAInterchange Control TrailerCloses the interchange envelope.

Key ISA fields

ElementPositionMeaning
ISA06Element 6Sender's ISA Qualifier + ID (who sent this interchange)
ISA08Element 8Receiver's ISA Qualifier + ID (who should receive it)
ISA15Element 15T = Test, P = Production. Must be P in live exchanges.
ISA13Element 13Interchange Control Number — must be unique per interchange
⚠️ Sending ISA15=T (test) to a partner expecting production documents is a common mistake. Always verify this flag before sending live transactions.

Transaction Sets

The most commonly used X12 transaction sets across industries:

SetNameUsed for
850Purchase OrderBuyer places an order with a supplier. The foundational document in most EDI relationships.
855Purchase Order AcknowledgmentSupplier confirms receipt and acceptance/rejection of an 850. Required by most retailers.
856Ship Notice / ASNSupplier notifies the buyer that goods have shipped. Includes carton contents, tracking, and label data.
810InvoiceSupplier bills the buyer. Must reconcile against the 850 and 856 for three-way matching.
820Payment Order / RemittanceBuyer sends payment detail and remittance information.
997Functional AcknowledgmentConfirms receipt and syntactic validity of a functional group. Required for every exchange.
204Motor Carrier Load TenderShipper tenders a freight load to a carrier.
210Motor Carrier Freight InvoiceCarrier invoices the shipper for completed freight.
214Shipment Status MessageCarrier provides in-transit status updates back to the shipper.
830Planning Schedule / ForecastBuyer sends a demand forecast to a supplier for production planning.
832Price/Sales CatalogSupplier sends product and pricing information to buyers.
860Purchase Order ChangeBuyer modifies a previously issued 850 (quantities, dates, prices).
862Shipping ScheduleJust-in-time shipping instructions from buyer to supplier.
990Response to Load TenderCarrier accepts or rejects a 204 load tender.

Connection Methods

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).

MethodHow it worksCommon 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
ℹ️ If you're not sure which connection method a trading partner requires, check their EDI Implementation Guide — most large retailers publish these. Your partner's EDI team can also tell you directly.

The 997 Acknowledgment

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:

  • A (Accepted) — the functional group was received and is syntactically valid
  • E (Accepted with Errors) — accepted but contains notes or minor issues
  • R (Rejected) — the functional group failed validation and must be resent

Failing to send 997s on time is a common source of chargebacks and compliance violations. Use the 997 Acknowledgment Tracker to stay current.

Test vs. Production

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.

✨ x12port Assistant
Free AI support • No credits needed
Hi! I’m the x12port AI Assistant. Ask me anything about EDI, your account, or how to use x12port. 👋