ORDERS — Purchase Order Message (D.96A)
On this page
The ORDERS message tells the seller that the buyer intends to place an order for goods or services, on terms agreed upstream.
- ORDERS — Purchase order, from buyer to supplier (this message).
- ORDRSP — Order response, from supplier to buyer.
- DESADV — Despatch advice, from supplier to buyer.
- RECADV — Receiving advice, from buyer to supplier.
- INVOIC — Invoice, from supplier to buyer.
- REMADV — Remittance advice, from buyer to supplier.
Purpose
Per the official UN/CEFACT definition, ORDERS is "intended to specify details for goods or services ordered on conditions agreed between the seller and the buyer". In practice, ORDERS handles spot orders (a one-off cart) as well as call-offs against a blanket contract, JIT replenishment in automotive, and service orders. It is not the right vehicle for post-acceptance changes — those go through the ORDCHG message.
Segment structure
A D.96A ORDERS message has three sections: a Header, a Detail (repeatable LIN group, up to 200,000 lines per interchange), and a Summary. The table below summarises the segments allowed at the outermost level, in canonical order.
Header
Mandatory header segments: UNH M , BGM M , and DTM M . Other header segments are conditional: PAI C , ALI C , IMD C , FTX C .
Then come segment groups SG1 through SG24, in this exact order: SG1 RFF,
SG2 NAD+LOC+FII (parties — buyer, seller, ship-to…), SG3
DOC, SG4 CTA+COM, SG5 TAX+MOA+LOC, SG6
CUX (currencies), SG7 PAT (payment terms), SG8
TDT (transport), SG9 PAC+MEA (packaging), SG10
EQD+HAN+MEA+FTX, SG11 SCC+FTX+RFF, SG12 APR,
SG13 ALC (allowance/charge), SG14 RCS+RFF+DTM+FTX.
Detail (line item)
The Detail section sits entirely inside SG25, a loop built around the LIN M segment. Each line can carry PIA , IMD , MEA , QTY , PCD , ALI , DTM , MOA , GIN , GIR , QVR , DOC , PAI , and FTX .
Beyond LIN itself, 28 nested groups describe line-level concerns: classifications (SG26
CCI+CAV+MEA), line-specific payment terms (SG27 PAT), pricing
(SG28 PRI+CUX+APR+RNG+DTM), references (SG29 RFF), packaging
(SG30 PAC+MEA+PCI+GIN), location/quantity per site (SG31
LOC+QTY+DTM), line taxes (SG32 TAX+MOA+LOC), line-specific
parties (SG33 NAD+LOC+RFF+DOC+CTA), allowances/charges (ALC groups),
line transport, equipment, etc.
The spec permits up to 200,000 repetitions of the SG25 loop per interchange — a ceiling rarely reached for retail orders, but common for manufacturing or spare-parts orders.
Summary
The Summary section contains: UNS M , MOA , CNT , then group SG54 ( ALC + ALI + MOA ) for global allowances/charges, and finally UNT M .
Mandatory / conditional
Four segments are strictly mandatory in every D.96A ORDERS:
UNH— opens the message, carries the reference and the version.BGM— gives the function code (220 = order), the order number, and the document status.UNS+S— separates Detail from Summary.UNT— closes the message, declares the segment count and the reference (which must match UNH).
On top of those, at least one header DTM (typically DTM+137 — Document
Date) and at least one LIN in the Detail. Any "business" payload (NAD
parties, PRI prices, CUX currencies) is technically conditional at the standard level —
it's the sector subsets (EANCOM, Odette…) and the trading agreement that make it
mandatory in practice.
Real-world example
A typical retail order between a buying group (buyer) and a manufacturer (supplier), for two products identified by their GTIN-13:
UNB+UNOC:3+5410000000123:14+5410000000456:14+260513:1430+CTRL000001'
UNH+1+ORDERS:D:96A:UN:EAN008'
BGM+220+ORDER789+9'
DTM+137:20260513:102'
DTM+2:20260520:102'
NAD+BY+5410000000123::9'
NAD+SU+5410000000456::9'
LIN+1++3520000001234:EN'
IMD+F++:::Acoustic guitar, mahogany finish'
QTY+21:2'
PRI+AAA:849.00'
LIN+2++3520000005678:EN'
IMD+F++:::Capo, spring loaded'
QTY+21:5'
PRI+AAA:19.50'
UNS+S'
CNT+2:2'
UNT+15+1'
UNZ+1+CTRL000001' UNB— interchange between two GLNs (qualifier:14) on 13 May 2026, 14:30.BGM+220+ORDER789+9— type 220 (order), number ORDER789, status 9 (Original).DTM+137— document date.DTM+2— requested delivery date.NAD+BY/NAD+SU— Buyer and Supplier, identified by GLN.- Two
LINwith their IMD, QTY (qualifier 21 = ordered quantity), and PRI (AAA = net calculation). UNT+15+1— 15 segments in the message (UNH and UNT included), reference "1" matching UNH.
Common errors
- Wrong UNT segment count — the value after
UNT+must include UNH and UNT themselves. This is the single most common error on the sender side, and the one most validators trip on (see our validator). - Out-of-sync message reference — UNH and UNT must carry the exact same identifier. Same applies between
UNB[4]andUNZ[1]for the interchange reference. - Unescaped reserved characters — a
+inside a buyer reference must be preceded by the release character (default?). Same for:,'and?itself. - Date format —
DTM+137expects a value matching the qualifier in component 3 (102 = CCYYMMDD). An ISO date (2026-05-13) will be rejected. - Encoding — the syntax level declared in UNB[0] (UNOA, UNOB, UNOC…) must match the actual encoding. UNOA forbids accented characters; UNOC (Latin-1) accepts most of them.
Related messages
In a full EDI flow ORDERS is part of a conversation:
- ORDRSP D.96A — the supplier response (accept / change / reject).
- DESADV D.96A — the despatch advice (ASN), once the order is packed.
- RECADV D.96A — the buyer receipt advice.
- INVOIC D.96A — the invoice, eventually.
- CONTRL D.96A — the automatic syntactic acknowledgment.
JSON equivalent
For developers consuming ORDERS in API-style architectures, here is the JSON projection that matches the example above. This mapping is not normative — it's an ediverse convention to ease integration in TypeScript / Python environments:
{
"interchange": {
"controlRef": "CTRL000001",
"from": { "id": "5410000000123", "qualifier": "14" },
"to": { "id": "5410000000456", "qualifier": "14" },
"datetime": "2026-05-13T14:30:00Z",
"syntax": { "id": "UNOC", "version": "3" }
},
"message": {
"ref": "1",
"type": "ORDERS",
"version": { "syntax": "D", "release": "96A", "agency": "UN", "association": "EAN008" }
},
"purchaseOrder": {
"number": "ORDER789",
"function": "220",
"status": "9",
"documentDate": "2026-05-13",
"deliveryDate": "2026-05-20",
"parties": {
"buyer": { "gln": "5410000000123" },
"supplier": { "gln": "5410000000456" }
},
"lines": [
{ "ref": 1, "gtin": "3520000001234", "description": "Acoustic guitar, mahogany finish", "quantity": { "ordered": 2 }, "price": { "net": 849.00 } },
{ "ref": 2, "gtin": "3520000005678", "description": "Capo, spring loaded", "quantity": { "ordered": 5 }, "price": { "net": 19.50 } }
],
"totals": { "lineCount": 2 }
}
}