Skip to content
James Ross
articlePublished Updated 8 min read

What is EDI? Retail X12 documents 850, 855, 856, 810 and 846 for engineers

By James Ross

What is EDI in retail? Five X12 transaction sets that carry one order from purchase to payment: 850 purchase order, 855 purchase order acknowledgment, 856 ship notice, 810 invoice and 846 inventory advice. Each is a structured, delimited document with a control number and a fixed position in the order lifecycle. The hard part is not parsing them; it is agreeing on the map with each retailer.

Five document sheets moving between a retailer building and a supplier warehouse, answering what is EDI in retail.

What is EDI, for an engineer? It is the document layer that sits under the partner and EDI work in a multi-brand commerce control plane, where partner profiles and certification fixtures exist but no retailer exchange is live. What follows is what each document does, how they connect, and where an EDI network fits.

What is EDI, and what does each document do?

An EDI document is not a message in the HTTP sense. It is a transaction set: a header segment, a table of detail segments, a summary, and a closing segment that repeats the control number and segment count. The X12 850 example shows the shape: ST*850*0001 opens the set, BEG identifies the order, PO1 carries a line, CTT counts lines, and SE*10*0001 closes the set with a segment count and the same control number (X12 example: basic purchase order).

Document Name Direction What it establishes
850 Purchase Order Buyer to seller The order: items, quantities, prices, dates, ship-to, terms
855 Purchase Order Acknowledgment Seller to buyer Acceptance, rejection or changes to the 850
856 Ship Notice/Manifest (ASN) Seller to buyer What is in the shipment, how it is packed and how it is identified
810 Invoice Seller to buyer The amount due for what was shipped
846 Inventory Inquiry/Advice Either direction Stock availability by item and location
997 Functional Acknowledgment Receiver to sender The interchange arrived and was syntactically usable
824 Application Advice Receiver to sender The content was received but rejected at the application layer

The 846 is the odd one out. An inquiry asks “what do you have?”, an advice volunteers “here is what I have”, and the advice direction is the common one in retail. It informs replenishment; it does not reserve stock or replace an order.

How the five documents map to an order lifecycle

The order lifecycle in EDI is a state machine where each document is a transition, and the acknowledgments are the guard conditions. The sequence below is the normal path; every step has an exception path.

  1. The buyer sends an 850. The purchase order is the legal contract for the goods. It carries the buyer’s order number, which every later document must reference.
  2. The seller replies with an 855. The acknowledgment accepts the order as written, accepts it with changes (a different quantity, date or price), or rejects it. A changed 855 is not a formality; it is the seller’s counter-offer, and the buyer’s systems must apply it.
  3. The seller ships and sends an 856. The ship notice describes the physical shipment: which order it fulfils, which items and quantities are in which container, and the lot, batch or serial numbers where the product requires them. The buyer uses it to book the receipt before the truck arrives.
  4. The seller sends an 810. The invoice states the amount due, normally against the shipment. In a clean flow the invoiced quantity matches the 856 quantity and the ordered quantity in the 850.

The 860 is a buyer-initiated purchase order change and the 865 is the seller’s response. Without them, partners usually allow a revised 850 and 855 under the same purchase order number until a cut-off — the ambiguity that produces duplicate orders.

The 846 sits beside this flow. A common integration bug is treating an 846 quantity as reserved stock, then promising a customer a unit that another order has already claimed.

What is inside an X12 interchange

An X12 transmission is wrapped in three nested layers, and each layer has its own control number. The Pennsylvania DHS troubleshooting guide states the rule plainly: the ISA segment is the only fixed-length record, it must be 106 positions, and the ISA/IEA, GS/GE and ST/SE control numbers must match (Pennsylvania DHS).

Layer Segments Scope Control number
Interchange ISA … IEA One transmission between two trading partners ISA13, echoed in IEA02
Functional group GS … GE A batch of similar transaction sets GS06, echoed in GE02
Transaction set ST … SE One document, such as a single 850 ST02, echoed in SE02

Two practical consequences follow. The ISA is positional, so a stray character at the front of a file shifts every field and the whole interchange fails. And the control numbers are how a receiver detects a duplicate transmission and reports which document failed in a 997.

A minimal 850 looks like this, following the X12 published example:

ST*850*0001~
BEG*00*RL*508517*1001*20000506**NA*IEL~
N1*BY*EXAMPLE BUYER*9*123456789-0101~
PO1*1*48*EA*3*PE*MG*R5656-2~
CTT*1~
SE*10*0001~

The ~ is the segment terminator and * is the element separator. Both are declared in the ISA, which is why a parser must read the ISA before it can split anything else. A file that uses a different terminator is still valid X12; a parser that hard-codes ~ is not a parser, it is a regex with a deadline.

Acknowledgments: four different promises

EDI has four acknowledgment layers, and conflating them is the most common source of “we sent it, they say they never got it” arguments.

  • Transport acknowledgment. A network receipt confirms the file arrived. It is not an EDI document and says nothing about content.
  • Functional acknowledgment (997). The receiver confirms that the interchange and functional group were syntactically valid and that the transaction set could be processed. X12 describes it as confirming receipt “and its useability to the receiving party”. A 997 can still report that a transaction set was rejected.
  • Application advice (824). The receiver confirms that the content was understood but rejected at the business layer — a bad item number, a price that does not match the contract, a ship-to that is not on file.
  • Business acknowledgment (855). The seller accepts, changes or rejects the order itself. This is the only one of the four that is a commitment about the goods.

In healthcare, the 999 reports implementation-guide compliance in place of the 997. In general retail, the 997 remains the common functional acknowledgment and the 824 covers application errors. The choice is per partner, which is why it belongs in a versioned profile rather than in code.

Where SPS Commerce fits

SPS Commerce is an EDI network, also called a value-added network or managed EDI provider. It sits between trading partners and handles the parts that are tedious and contractual: retailer-specific maps, document versions, transport, retries, acknowledgments and certification. A supplier connects once to the network and the network connects to many retailers.

That changes the engineering problem: the supplier integrates once with the network’s API or file exchange instead of certifying a transport and a map per retailer. The discipline remains. The retailer’s map defines which segments and qualifiers are mandatory, which code lists are allowed, and what the acknowledgment deadlines are.

The pattern is not a substitute for understanding the documents. When a 997 rejects a transaction set, someone still has to read the 824 or the raw document and find the line that failed.

The project research behind the multi-brand control plane reached the same conclusion: a transport-neutral interchange ledger with versioned partner profiles, immutable document revisions, attempts, technical/application/business acknowledgments and SLA obligations. The map is the integration.

Comparison: direct EDI, an EDI network, or a REST API

Option Who owns the map Time to first retailer Failure surface Best fit
Direct EDI (AS2 over HTTPS per RFC 4130, or SFTP) You Weeks to months per retailer Transport, certificates, maps, acknowledgments, retries High volume, many documents, in-house EDI team
EDI network (for example SPS Commerce) Shared: network plus your internal model Days to weeks per retailer Your payload mapping and the retailer’s data rules A supplier with several retailers and no EDI team
Retailer REST API Retailer Depends on approval and certification Auth, rate limits, async feeds, versioning A single marketplace with a mature API and low document variety

Which should you choose? Choose an EDI network when you sell through several retailers and the documents are mostly standard, because it converts a per-retailer engineering project into a configuration project. Choose direct EDI when volume and document variety justify an in-house EDI function. Choose a REST API when the partner offers a real one and your volume fits its limits. Most suppliers end up with two of the three, which is why the internal model must be transport-neutral.

What breaks in retail EDI, and what we changed

Control numbers get reused. A duplicate ISA13 makes a receiver treat a new order as a retransmission, or reject the file outright. A generator that restarts numbering after a deployment will eventually have a file rejected or misread.

The 855 change is ignored. The seller acknowledges a quantity of 40 against an ordered 48, and the buyer’s system keeps the 48. The 856 then ships 40, the 810 invoices 40, and the discrepancy surfaces in a deduction three months later.

Units of measure drift. The 850 orders in cases, the 856 ships in eaches, and the 810 invoices in cases. Nothing in the syntax is invalid; the quantities are simply not comparable. Unit conversion has to be an explicit, approved mapping, not an assumption in a transform.

A duplicate 850 is treated as a new order. Retailers resend. Without a business key that includes the buyer’s order number and the change reason, a resend creates a second order and a second shipment.

Two decisions followed: do not write a guessed generic X12 serializer, and do not collapse the acknowledgment layers into one status. The design is transport-neutral: versioned partner profiles, immutable document revisions, separate technical, application and business acknowledgment states, and no hand-rolled map.

Frequently asked questions

What is EDI?

EDI is the exchange of structured business documents between trading partners. In retail it means X12 transaction sets: the 850 purchase order, 855 acknowledgment, 856 ship notice, 810 invoice and 846 inventory advice carry one order from purchase to payment. Each is a delimited document with control numbers, and the hard part is agreeing on the map with each retailer.

What are the 850, 855, 856, 810 and 846 documents?

They are X12 transaction sets for the retail order lifecycle. The 850 is the purchase order, the 855 acknowledges or changes it, the 856 is the ship notice, the 810 is the invoice, and the 846 is an inventory inquiry or advice. The 997 and 824 carry functional and application acknowledgments rather than business commitments.

What is the difference between an 855 and a 997?

A 997 says the document arrived and was syntactically usable; an 855 says the seller accepts, changes or rejects the order. You can receive a clean 997 and a rejected 855 in the same minute. Systems that treat the 997 as order acceptance will ship against orders the seller never agreed to fulfil.

Is the 856 the same as a shipping label?

No. The 856 is the electronic ship notice that tells the buyer what is in the shipment, how it is packed and which order it fulfils. A label is a carrier artifact. The 856 may carry container marks and numbers that match the labels, which is what lets a warehouse scan a pallet and find the corresponding receipt.

Do I need to write my own X12 parser?

Read the ISA first to discover the separators, then parse segments and validate control numbers and counts. What not to write is a guessed map: which segments and qualifiers a retailer requires is contractual. Use the retailer's guide or your network's map.

Why is the ISA segment special?

The ISA is a fixed-length record of 106 positions, and it declares the element separator, the segment terminator and the interchange control number. Every other segment is variable-length and delimiter-based, so the ISA must be read positionally before anything else can be split correctly. A single misplaced character in it corrupts the entire interchange.

Can I use a REST API instead of EDI?

Sometimes. A retailer's REST API can replace EDI when it is mature, documented and rate limits fit your volume. Many large retailers still require EDI for purchase orders and invoices, and marketplaces often expose both. The durable design is a canonical order model with transport adapters, so EDI and REST feed the same state machine.