Skip to content
James Ross
articlePublished Updated 10 min read

EDI 856 (advance ship notice) explained for engineers

By James Ross

EDI 856 is the X12 ship notice, also called an advance ship notice or ASN. It is sent by the seller when goods ship and tells the buyer which orders are in the shipment, how the goods are packed and how each container is identified. The structure is a BSN header followed by a tree of HL segments, usually shipment, order, pack and item. The parsing is the easy part; the hard part is matching each retailer's map of that tree.

Abstract tree of pallets, cartons and items linked to a floating document, illustrating the EDI 856 hierarchy.

An EDI 856 is the document a seller sends to say what is in a shipment, and the fastest way to understand it is as a tree, not a message. This article is the follow-up to retailer EDI explained, which covers the five core retail documents side by side. Here the focus is one document: the segments that make up the 856, how the HL hierarchy works, how to model it in an order system, and where the agreement with each retailer decides more than the standard does.

What is an EDI 856?

An EDI 856 is the X12 ship notice/manifest transaction set, commonly called an advance ship notice or ASN. The seller sends it when goods ship, and it tells the buyer which orders the shipment fulfils, how the goods are packed and how each container is identified.

X12 describes it as “a critical transaction that ties the order to the delivery process.” The shipment is built from pallets, cases or drums, item, quantity and lot, batch or serial data are captured for each, and the delivery can comprise one or more purchase orders, so one 856 may reference several orders (X12: supply chain transaction flow). SPS Commerce compares it to “a very detailed packing list” (SPS Commerce: EDI 856).

The practical purpose is receiving. When the 856 is accurate, the buyer’s warehouse scans a container label, finds the matching record, and books the receipt against the right order without a manual check. That is also why retailers can penalize a wrong one, which comes up below.

Where does the 856 sit in the order lifecycle?

It sits between acknowledgment and invoice. The buyer sends an 850 purchase order, the seller replies with an 855 acknowledgment, the seller ships and sends the 856, and the invoice follows as an 810. The earlier article walks through that sequence in retail EDI explained; the 850 deep dive covers the document that starts it.

Two properties of the 856 make it different from its neighbors:

  • It is physical. The 850 and 855 are about commitments. The 856 describes real cartons with real identifiers, so it must be produced from warehouse or carrier data, not from the order alone.
  • It is time-bound. SPS Commerce states that the ASN “should be sent at the time of the physical shipment” and that trading partners typically require it to arrive prior to the shipment (SPS Commerce: EDI 856). An 856 generated by a nightly batch after the truck has left is late by design.

What segments make up an EDI 856?

The 856 is a header, a repeating hierarchical detail loop and a summary. The table lists the segments that matter in practice and what each one carries; which of them are mandatory is decided by the retailer’s guide, not by this list.

Segment Name What it carries Source for the description
ST / SE Transaction set header and trailer The set id (856), a control number, and the segment count on close SPS Commerce article
BSN Beginning segment for ship notice Purpose code, shipment identification, date and time; mandatory and unique to the 856 SPS Commerce article
HL Hierarchical level The tree: id, parent, level code, child flag; the only required detail segment SPS Commerce article
TD1, TD5, TD3, TD4 Carrier details How the shipment is moved and which company is moving it SPS Commerce: EDI 856
REF Reference identification Extra reference numbers, such as purchasing numbers SPS Commerce: EDI 856
DTM Date/time reference Key dates, such as when the shipment left the warehouse SPS Commerce: EDI 856
N1 to N4 Name and address The parties involved and their addresses SPS Commerce: EDI 856
LIN, SN1, PO4, PID Item detail Item identification, shipped quantity, physical pack data and description; segments the article lists as able to sit inside the HL loop, with item-level placement being common practice SPS Commerce article
MAN Marks and numbers Container identifiers that are matched to the inbound containers by barcode or RFID X12: supply chain transaction flow
CTT Transaction totals A count, optional by the standard but common SPS Commerce article

The SPS article also lists optional sub-loops inside the HL loop for equipment details, hazardous materials, load detail, parties and monetary amounts, and notes a rule worth remembering: the sub-loops are not mandatory, but if you include one, certain segments inside it become mandatory. A generator that emits an empty optional loop will fail validation for a reason that is not obvious from the error.

How does the HL hierarchy work?

HL turns a flat list of segments into a tree. Each HL segment has four elements: HL01 is a unique id for that occurrence, HL02 points to the id of its parent, HL03 is the level code, and HL04 says whether child HL segments follow. HL03 tells the parser that the segments after it, up to the next HL, describe one level of the tree: the shipment, an order, a pack or an item. These element meanings come from the X12 definition of the segment, which published trading-partner guides repeat.

The most common structure uses four levels, written S, O, P and I:

  1. S, shipment. One per ASN. Carrier, weight, ship date and ship-from and ship-to parties live here.
  2. O, order. One per purchase order covered by the shipment. This is where the buyer’s PO number is referenced, and why one ASN can span several orders.
  3. P, pack. One per carton, pallet or other container, with its identifier in a MAN segment.
  4. I, item. One per item in a pack, with LIN for identification, SN1 for the shipped quantity and unit of measure, and optional PO4 for physical pack details.

Some partners add a tare level for pallets above packs, and some drop the pack level. BSN05, the hierarchical structure code, is where a document declares which structure it uses. Whether it must be sent is the retailer’s call.

A constructed example, not taken from any retailer, shows the shape for one order with one carton holding one item. Control numbers and counts are illustrative:

ST*856*0001~
BSN*00*SHIP-10045*20261201*1230*0001~
HL*1**S~
TD1*CTN25*1****G*12*LB~
DTM*011*20261201~
HL*2*1*O~
PRF*PO-77123~
HL*3*2*P~
MAN*GM*00000123450000000017~
HL*4*3*I~
LIN**VN*SKU-1001~
SN1**24*EA~
CTT*4~
SE*14*0001~

Read it as a tree. HL 1 is the shipment. HL 2 has parent 1, so it is an order under that shipment. HL 3 has parent 2, a pack under the order, and HL 4 has parent 3, an item in that pack. A parser that reads segments in order and keeps a stack keyed by HL01 and HL02 can rebuild this, and a generator that builds the tree from a canonical shipment model can emit it, which is the shape of the problem in both directions.

How should an order system model an ASN?

Model the shipment first and render the 856 last. The 856 is one serialization of a shipment, and a retailer’s guide is one set of rules for that serialization, so the canonical record should not look like X12.

A workable model has four entities: a shipment with carrier and dates, one or more order references, packs with container identifiers, and items with shipped quantity and unit of measure. Each pack belongs to exactly one order allocation, and each item quantity must be traceable to an order line. Generate HL ids from the tree walk at render time, not from stored values, so the ids are always consecutive and always consistent with the parent pointers.

Three checks catch most defects before transmission:

  • Quantity reconciliation. Item quantities across all packs for an order line must not exceed the ordered quantity, and the unit of measure on the SN1 must match the unit on the purchase order.
  • Identifier uniqueness. Container identifiers must be unique and must match the labels printed for the carton. SPS Commerce states that discrepancies between barcode labels and the ASN can require manual sorting and lead to chargebacks (SPS Commerce: EDI 856).
  • Count integrity. CTT and SE counts must be computed from the rendered output, never carried forward from an earlier render.

What does a trading-partner guide add on top of the standard?

It decides which segments are mandatory, which level structure is allowed, which qualifiers are valid and when the ASN is due. The SPS Commerce article notes that optional sub-loops add mandatory segments only when included. Everything above that, such as whether the shipment HL must carry id 1, whether SSCC labels are required and how pack levels are used for mixed cartons, comes from the retailer.

Question Standard answer Where the real answer lives
Is the pack level required? Optional Retailer guide
Which container id qualifier is valid? A code list in the X12 dictionary Retailer guide
How many orders per ASN? One or more Retailer guide, often one
When is the ASN due? At physical shipment Retailer routing guide, often before arrival
What happens on a mismatch? Not specified Retailer compliance rules and chargebacks

This is why we do not write a generic X12 serializer. The map is the integration, and a serializer written without the retailer’s guide is a guess that passes syntax checks and fails compliance.

How does the control plane represent the 856?

As a typed document with a revision chain, behind a partner profile that is still in certification-capture mode. In the repository behind the multi-brand commerce control plane, the interchange contract lists the document types 850, 855, 856, 810, 846, 997, 999 and 824, and a document carries a partner id, a partner profile version, a direction and a business key.

Each document has immutable revisions. A revision records a SHA-256 of its content, a byte length and a media type, and a corrected revision must reference its predecessor’s id and hash. The successor check refuses four things: a revision for a different document, a revision number that is not the next one, a predecessor that does not match, and unchanged content. A resend therefore cannot silently replace what was sent.

The partner profile marks the outbound 856 as a required document, with the transport-receipt and functional-acknowledgment stages expected, and a certification manifest pins the retailer map by version and hash. The certification receipt type fixes networkCalls at 0 (from the partner contract module). Honest status: no retailer exchange is live in this build. The profiles, fixtures and revision chain exist and are tested, and the transport stays off until a retailer’s authenticated specification, map and routing guide are in hand. The same posture is described in capture-first connectors.

What broke and what we changed

There is no production 856 traffic in this system, so there is no outage story to tell. What the build changed came from reading the failure modes the standard and the networks document, and designing against them before any exchange exists.

  • A re-render could overwrite what was sent. An ASN that is regenerated after a correction looks the same as the original to a naive store. The revision chain now requires a predecessor id and hash and rejects a revision whose content hash is unchanged, so every correction is a new, linked, auditable revision.
  • Acknowledgment states could be collapsed. A single “sent” flag hides the difference between a network receipt, a functional acknowledgment and a business response. The profile lists the acknowledgment stages expected per document, and the 856 does not expect a business response stage in the fixtures.
  • The map could be guessed. The manifest requires an authenticated specification version and hash and a retailer map version and hash before fixtures count as certification evidence. Without them the readiness check returns a blocked status with a list of blockers instead of ready-for-capture-certification.
  • Document identity could be ambiguous. The business key is a required field on the document, so a duplicate shipment cannot be mistaken for a new one by a retry.

Nothing here has been proven against a live retailer, and the article does not claim it has. What is proven is the local behavior: the contract tests and fixtures pass, and the transport is off.

Frequently asked questions

What is an EDI 856?

An EDI 856 is the X12 ship notice/manifest transaction set, usually called an advance ship notice or ASN. The seller sends it when a shipment leaves so the buyer can book the receipt before the truck arrives. It states which orders the shipment fulfils, what is in each container and how the containers are identified.

What does the HL segment do in an 856?

HL defines the tree. Each HL has a unique id, a pointer to its parent, a level code and a flag saying whether children follow. The level code says whether the segments after it describe the shipment, an order, a pack or an item. Without HL the detail segments have no context.

What is the difference between an 856 and a 997?

The 856 is a business document that describes a shipment. The 997 is a functional acknowledgment that says an interchange arrived and was syntactically usable. A clean 997 does not mean the buyer accepted the shipment data; the buyer can still reject the content at the application layer with an 824.

Is every 856 structured as shipment, order, pack, item?

No. The level codes and nesting are agreed per trading partner. Some partners want shipment, order and item with no pack level, others add a tare level, and a few want a flatter structure. The BSN hierarchical structure code declares which one a document uses, and the retailer's guide says which is allowed.

When should an ASN be sent?

At the time of the physical shipment, and it must reach the buyer before the goods do. SPS Commerce states that trading partners typically require the ASN to arrive prior to the shipment, so a design that sends it as a nightly batch after pickup will often be late.