Skip to content
James Ross
articlePublished Updated 9 min read

EDI 850 purchase order explained for engineers

By James Ross

EDI 850 is the X12 purchase order: the buyer's electronic order, and the first step in the ordering process. It is a header with BEG, a set of party and date segments, one PO1 loop per line and a CTT line count, closed by SE. The seller answers with an 855 acknowledgment that accepts, changes or rejects it. Parsing is simple; the work is deduplicating resends and applying the changes the 855 reports.

Abstract stacked order sheets travelling between two parties with a return sheet, illustrating the EDI 850 purchase order.

The EDI 850 is the purchase order: the document a buyer sends to place an order electronically. It is the first document in the retail order lifecycle, and it is the one every later document refers back to. This article goes deeper than the overview in retailer EDI explained, without repeating it. It covers the segment structure, a worked example, the 850 to 855 handshake, and the order-modeling mistakes that cause duplicate orders.

What is an EDI 850 purchase order?

An EDI 850 is the X12 purchase order transaction set, and X12 says the purchase order process “establishes the legal contract between the parties about the purchase” (X12: supply chain transaction flow). SPS Commerce describes it the same way in practical terms: it allows buyers to place orders with sellers electronically, “contains initial order request details and is the first step in the ordering process” (SPS Commerce: EDI 850).

X12 notes that when party identifiers are already shared, an 850 can be simple: party names or ids, item ids, quantity, price, and delivery location and date. SPS lists what a typical 850 carries: the purchase order date and number, product names and codes such as SKUs, the requested ship or delivery date, locations, and optionally pricing, item descriptions and other item identifiers.

The legal framing matters for engineering. An 850 is not a notification that something happened. It is a commitment request, and your system’s job is to turn it into a canonical order exactly once.

What does an EDI 850 look like?

It is a short list of segments, each on its own line in the file, ending in a terminator. The X12 basic purchase order example, version 004010, is the smallest honest sample (X12 example 01):

ST*850*0001~
BEG*00*RL*508517*1001*20000506**NA*IEL~
N1*BY*ABC Aerospace Corporation*9*123456789-0101~
N3*1000 BOARDWALK DRIVE~
N4*SOMEWHERE*CA*98898~
PO1*1*48*EA*3*PE*MG*R5656-2~
IT8*******B0~
CTT*1~
AMT*TT*144~
SE*10*0001~

X12’s own description of that example: ST starts an 850 with control number 0001; BEG identifies an original purchase order numbered 508517, release 1001, dated May 6, 2000, where no acknowledgment is required and the invoice should be sent electronically; N1, N3 and N4 name and address the buyer; PO1 describes line 1 as 48 units at $3 each by manufacturer’s part number; IT8 says product substitution is not allowed; CTT reports one line item; AMT gives the total as $144; and SE closes the set with a count of 10 segments and the same control number.

That description contains the whole parsing contract. Control number in ST and SE must match. The SE count must equal the number of segments between and including ST and SE. CTT must agree with the line count. Those three checks are the cheapest validation you can run and the ones most often skipped.

Which segments does an 850 contain?

The example shows the core, and trading-partner guides add the rest. The table lists the segments that appear in nearly every implementation and what they establish.

Segment Name What it establishes Where this is confirmed
ST / SE Transaction set header and trailer Set id, control number, and the segment count on close X12 example 01
BEG Beginning segment for purchase order Purpose, order number, release, date; identifies the order X12 example 01
N1, N3, N4 Name, street, city/state/zip Buyer and other parties X12 example 01
PO1 Line item Line number, quantity, unit, price and a product id X12 example 01
IT8 Substitution indicator (as used in the example) Whether product substitution is allowed X12 example 01
CTT Transaction totals The number of line items X12 example 01
AMT Monetary amount A total, as in the example’s transaction total X12 example 01
DTM, REF, PID Dates, references, descriptions Requested dates, extra reference numbers, item text; added by partner guides Trading-partner guide

The X12 flow page adds the broader scope: an 850 can carry party information, order currency, tax, allowances, packaging, carrier details, prices and delivery scheduling. The tail of that list is where retailers differ, and the PO1 line is where the money is: unit of measure and price basis on that segment must survive every later document.

How does an 850 map to an 855?

The 855 is the seller’s answer, and it carries the seller’s version of the order. X12 describes the 855 as “reporting back from the seller’s purchase order system”; it “may affirm the order or may indicate changes to the 850 Purchase Order” (X12: supply chain transaction flow). The relationship between the two is the first state transition of the order.

The X12 855 example set shows the four outcomes the standard anticipates: accepted, accepted with minor changes, rejected, and acknowledged with shipment details (X12 855 examples). The accepted example is five segments long:

ST*855*0001~
BAK*11*AT*XX-1234*20170406***AE123~
PER*SU*XYZ AIRCRAFT PARTS*TE*1-800-555-1212~
CTT*0~
SE*5*0001~

X12 describes the BAK as a reply to an order with status Accepted with no detail, identifying purchase order XX-1234 dated April 6, 2017 and tied to contract AE123; PER names the supplier contact, and CTT reports no line items because nothing changed.

The mapping rules an engineer needs:

Event 850 side 855 side What the system must do
Accepted as written Original lines Accept status, no line detail Move the order to accepted; keep original quantities
Accepted with changes Original lines Status plus changed line detail Apply the seller’s quantities, dates or prices as the new truth, with an audit row
Rejected Original lines Reject status Close the order as rejected; notify the buyer’s channel
Accepted with shipment details Original lines Accept plus ship data Treat as an acknowledgment, not an ASN; the 856 still follows

The row that causes trouble is “accepted with changes.” The seller’s 855 is a counter-offer, and the buyer’s side must apply it. A system that ignores the changed quantities will ship against one number and invoice against another.

How do you model an EDI purchase order safely?

Treat the 850 as an input, not as the order. The canonical order is your own record, created from the 850 through a map, with the raw document stored beside it as evidence. Four rules keep that honest.

  1. Key on the business identity. The order key is the buyer’s purchase order number plus the release or change context, scoped to the partner. The interchange control number identifies a transmission, so it must not be the order key. Retailers resend, and a resend must resolve to the same order.
  2. Store the raw document and a hash. Keep the exact bytes and a SHA-256 of them. If the same business key arrives with different bytes, that is a change, and it should create a new revision of the document, not overwrite the old one.
  3. Validate the envelope before the content. Read the ISA, check the ISA/IEA, GS/GE and ST/SE control numbers and the SE segment count, then map the content. Reject on an envelope failure with a 997, and on a content failure with the application-layer advice the partner expects.
  4. Make unit conversion explicit. Orders in cases and shipments in eaches are both valid X12. The map must say which conversion applies for each partner and item, and the conversion must be reviewable, not buried in a transform.

Order creation should also be an idempotent operation: the same 850 delivered twice produces one order and one acknowledgment, and the second delivery is recorded as a duplicate attempt.

Where should each check run when an 850 arrives?

Each layer of the document has its own failure, and each failure has its own response. Running them in order keeps a bad file from becoming a bad order.

Layer What is checked Failure response Order created?
Transport The file arrived intact Network receipt or retry No
Envelope ISA, GS and ST control numbers match their trailers; SE count is right Functional acknowledgment reports the rejection No
Syntax Required segments present, element lengths and types valid Functional acknowledgment reports the rejection No
Application Item exists, price matches the agreement, ship-to is known Application advice to the sender, or a hold for review Held, not released
Business The seller accepts, changes or rejects The 855 Yes, in the state the 855 reports

The order is created only after the application layer passes, and it is released only after the business layer answers. An engineer who creates the order at the transport layer will eventually have orders in the system that the seller never agreed to fill, which is the failure the retail EDI overview describes as treating a 997 as acceptance.

How does the control plane handle the 850 today?

As a typed, inbound, required document behind a partner profile that has not been activated. In the repository behind the multi-brand commerce control plane, the interchange contract lists the 850, 855, 856, 810, 846, 997, 999 and 824 and models each document with a partner id, a profile version, a direction and a business key.

The partner profile fixtures declare the 850 as inbound and required, with transport-receipt and functional-acknowledgment stages expected, and the 855 as outbound and required, with a business-response stage added. That asymmetry is the point: the buyer’s 850 is acknowledged by the network and the 997, but only the seller’s 855 is a business answer.

Document revisions are immutable and hash-chained: a corrected revision must name its predecessor’s id and content hash, and unchanged content is refused. Honest status: no retailer exchange is live. The certification receipt type fixes networkCalls at 0, which means the fixtures can be captured and replayed without touching a network. Activation needs an authenticated specification, a retailer map and a routing guide, and the transport stays off until then. The same stance is described in capture-first connectors.

What breaks in 850 handling, and what we changed

No live 850 traffic has run through this system, so these are design changes made against documented failure modes, not incident write-ups.

  • Control numbers treated as order identity. A duplicate transmission is not a duplicate order and a new transmission is not always a new order. The document model carries a separate business key, so the order key never depends on the envelope.
  • Rewrites losing history. A resend with edited content could overwrite the stored order. The revision chain refuses unchanged content and requires the predecessor hash, so every change is a linked revision.
  • The 855 collapsed into a status flag. An “acknowledged” boolean cannot tell accepted from accepted-with-changes. The profile separates the stages, and the 855 is the only stage that counts as a business response.
  • Guessing the map. A generic X12 serializer would pass syntax checks and fail a retailer’s compliance rules. The decision was not to write one until a retailer’s authenticated map exists.

These are the same lessons the inventory double-decrement taught on the stock side: when a message can arrive twice, identity and idempotency belong in the schema, not in a retry loop.

Frequently asked questions

What is an EDI 850?

An EDI 850 is the X12 purchase order transaction set. The buyer sends it to place an order electronically, and it is the first step in the ordering process. It carries the purchase order number and date, the parties, the line items with quantities and prices, and the requested delivery information.

What is the difference between an 850 and an 855?

The 850 is the buyer's order and the 855 is the seller's reply. The 855 may affirm the order or indicate changes to it, such as a different quantity or date. It is the only acknowledgment in the chain that is a business commitment; the 997 only says the file was readable.

What are the main segments in an 850?

ST opens the set, BEG identifies the purchase order, N1 groups name the parties, PO1 carries each line, CTT counts the lines and SE closes the set with a segment count. Date, reference, terms and product description segments are added by the trading partner's guide.

How do you handle a duplicate 850?

Key the order on the buyer's purchase order number plus the release or change context, not on the interchange control number. Retailers resend, and a resend with the same business key must update or be ignored, never create a second order. The control number identifies a transmission, not an order.

Do I need a parser to read an 850?

You need a tokenizer that reads the ISA first to learn the separators, then splits segments and elements, validates the control numbers and counts, and hands typed segments to a mapper. The mapping from segments to your order model is the part that depends on each retailer's guide.