DevToolCase
Sign in Sign in

EDIFACT ORDERS: the purchase order message

The EDIFACT ORDERS purchase order: what it is for, its segments (BGM, DTM, NAD, LIN, QTY), key qualifiers and an annotated EANCOM D96A example.

Where ORDERS fits in the exchanges

What is the ORDERS message for?

ORDERS is the purchase order: the buyer sends it to the supplier to order goods or services, with the quantities, the requested delivery date and place, and often the agreed prices. It starts the order-to-cash flow, and its number comes back in every message that follows.

The supplier may answer with an order response (ORDRSP), then announces the goods with a despatch advice (DESADV) and bills them with an invoice (INVOIC). In retail, ORDERS is usually sent in its EANCOM version, where parties and items are identified by GS1 numbers (GLN and GTIN).

Sender: Buyer. Recipient: Supplier.

Structure of the ORDERS message

Its main segments, in the order of the D.96A directory. M means mandatory and C conditional, followed by the maximum number of repetitions; for the first segment of a segment group (SG), they apply to the whole group. Rarely used segments are left out.

SegmentGroupStatusWhat it carries
UNH Message header—M 1Message header: the message reference and its type, ORDERS:D:96A:UN:EAN008.
BGM Beginning of message—M 1Document type (220 order), order number and message function.
DTM Date/time/period—M 35Order date, requested delivery date or period.
FTX Free text—C 99Free text: delivery instructions, remarks.
RFF ReferenceSG1C 10References: contract, promotion, quotation.
NAD Name and addressSG2C 99Parties, by their GLN: buyer, supplier, delivery point, invoicee.
CTA Contact informationSG2 › SG5C 5Contact person or department of the party.
COM Communication contactSG2 › SG5C 5Phone number or e-mail address of that contact.
CUX CurrenciesSG7C 5Currency of the order.
PAT Payment terms basisSG8C 10Payment terms.
TDT Details of transportSG9C 10Transport requested: mode, carrier.
TOD Terms of delivery or transportSG11C 5Terms of delivery (Incoterms).
LIN Line itemSG25C 200000Order line: line number and GTIN of the item.
PIA Additional product idSG25C 25Other item numbers: supplier’s or buyer’s article number.
IMD Item descriptionSG25C 99Item description.
QTY QuantitySG25C 10Quantity ordered.
DTM Date/time/periodSG25C 35Delivery date of the line, when it differs from the order’s.
PRI Price detailsSG25 › SG28C 25Unit price of the item.
UNS Section control—M 1Separates the lines from the summary section (UNS+S).
CNT Control total—C 10Control totals, such as the number of lines.
UNT Message trailer—M 1Message trailer: number of segments and message reference.

Codes worth knowing

SegmentData elementCodeMeaning
BGM1001220Order
BGM12259Original: a new order
BGM12251Cancellation of an order already sent
DTM2005137Document date
DTM20052Requested delivery date
DTM2379102Date format CCYYMMDD
NAD3035BYBuyer
NAD3035SUSupplier
NAD3035DPDelivery party: where the goods go
NAD3035IVInvoicee
LIN7143ENItem number is a GTIN (EAN)
QTY606321Ordered quantity
PRI5125AAANet unit price (calculation net)
CNT60692Number of line items

Example of ORDERS message

UNA:+.? '
UNB+UNOC:3+5412345000013:14+8712345000011:14+261123:1015+ORD0001'
UNH+1+ORDERS:D:96A:UN:EAN008'
BGM+220+PO12345+9'
DTM+137:20261123:102'
DTM+2:20261127:102'
RFF+CT:CONTRACT2026'
NAD+BY+5412345000013::9'
NAD+SU+8712345000011::9'
NAD+DP+5412345000020::9'
CUX+2:EUR:9'
LIN+1++8712345100018:EN'
PIA+1+ART001:SA'
IMD+F++:::Sparkling water 6x1.5 l'
QTY+21:48'
PRI+AAA:4.75'
LIN+2++8712345100025:EN'
PIA+1+ART002:SA'
QTY+21:12'
PRI+AAA:12.5'
UNS+S'
CNT+2:2'
UNT+21+1'
UNZ+1+ORD0001'
Convert it to JSON

The example, segment by segment

SegmentMeaning
UNH+1+ORDERS:D:96A:UN:EAN008Message 1 of the interchange: an ORDERS of directory D.96A, EANCOM subset EAN008.
BGM+220+PO12345+9An order (220) numbered PO12345, sent for the first time (9, original).
DTM+2:20261127:102Delivery requested on 27 November 2026, a date written CCYYMMDD (102).
NAD+DP+5412345000020::9The delivery point, by its GLN; 9 says the code comes from GS1 (EAN).
CUX+2:EUR:9Prices and amounts of the order are in euros.
LIN+1++8712345100018:ENLine 1: the item, by its GTIN (EN).
QTY+21:4848 units ordered (21, ordered quantity).
PRI+AAA:4.75Net unit price: 4.75.
CNT+2:2Check: the message has 2 lines.
UNT+21+1End of the message: the number of segments from UNH to UNT included, then the reference given in UNH.

Related messages

In the ANSI X12 standard, used mostly in North America, the equivalent of ORDERS is the 850 transaction set (Purchase Order), which you can read with the X12 viewer.

Add this browser’s favorites to your account?

This browser has 0 favorites that your account does not have:

Either way, this browser keeps its favorites: you find them again after signing out.