ORDERS — Purchase Order
Version: 2.0 — June 2026
EDIfact Standard: EANCOM D.01B
XML: v2.0
XSD: `Azuvio-CRMconnect-EDIconnect-ORDERS-v2.0.xsd`
Direction: Inbound (Partner → CRMconnect)
Trigger: Partner issues a purchase order
CRMconnect Module: Sales → Orders
The supplier's GLN (Seller/GLN) must be exactly 13 digits. If it is treated as an integer in your system, leading zeros will be lost — always send it as a string.
EDIfact D.01B
The following schema represents the list of elements in sequential order, not a complete syntactic form of the EANCOM message. It is based on the EANCOM D.01B standard. Additional information according to the GS1 guide may be inserted, but will be ignored if not listed below.
| Status | EANCOM Segment | Description |
|---|---|---|
UNA:+.? ' |
Separator specification | |
| Mandatory | UNB+UNOD:3+{GLN_Sender}:14+{GLN_Receiver}:14+{YYMMDD}:{HHMM}+{RefNo}' |
Physical file start. UNB_004/0010 = sender/receiver GLN. Test: ++++++1 at end |
| Mandatory | UNH+00001+ORDERS:D:01B:UN:EAN010' |
Start of an order |
| Mandatory | BGM+220+{OrderNo}+9' |
Document type, order number, function code. BGM_1001: 220 = purchase order; BGM_1225: 9 = original |
| Mandatory | DTM+137:{YYYYMMDD}:102' |
Order date |
| Mandatory | DTM+2:{YYYYMMDD}:102' |
Requested delivery date |
| Optional | RFF+SD:21' |
Department |
| Mandatory | NAD+SU+{GLN_Supplier}::9++{Name}+{Address}+{Town}++{PostalCode}+{Country}' |
Supplier GLN, Name, Address, Town, Postal Code, Country Code |
| Mandatory | RFF+YC1:{SupplierCodeByBuyer}' |
Supplier code assigned by the buyer |
| Mandatory | NAD+BY+{GLN_Buyer}::9++{Name}+{Address}+{Town}++{PostalCode}+{Country}' |
Buyer GLN, Name, Address, Town, Postal Code, Country Code |
| Optional | NAD+DP+{GLN_Delivery}::9++{Name}+{Address}+{Town}+++{PostalCode}+{Country}' |
Warehouse/Store GLN, Address — delivery location |
| Mandatory | LIN+{LineNo}++{EAN}:SRV' |
Main line position — product EAN barcode or internal product ID |
| Mandatory/Conditional | PIA+1+{BuyerCode}:IN' |
Buyer's internal product code |
| Optional | PIA+1+{SupplierCode}:SA' |
Supplier's internal product code |
| Mandatory | IMD+A++:::{ProductName}' |
Product name (max 256 characters) |
| Mandatory | QTY+21:{Qty}:PCE' |
21 = ordered quantity |
| Optional | QTY+59:{ConsumerUnits}:PCE' |
59 = number of consumer units in the ordered unit |
| Mandatory | MOA+66:{NetValue}' |
Net value of the ordered product |
| Optional | PRI+AAA:{NetNetPrice}' |
Net net price of the product |
| Optional | TAX+7+VAT+++:::{VATRate}+S' |
VAT rate of the ordered product |
| Mandatory | UNS+S' |
End of lines section — start of summary section |
| Mandatory | CNT+2:{LineCount}' |
Number of items in the order (LIN count) |
| Mandatory | UNT+{SegmentCount}+{MessageRef}' |
End of order — unique ID, segment count |
| Mandatory | UNZ+{MessageCount}+{InterchangeRef}' |
End of physical file — unique ID, order count |
EDIfact Example
UNA:+.? '
UNB+UNOD:3+5948914999940:14+5940475563004:14+240315:1400+77'
UNH+00001+ORDERS:D:01B:UN:EAN010'
BGM+220+45147813+9'
DTM+137:20240315:102'
DTM+2:20240320:102'
RFF+SD:21'
NAD+SU+5940000000010::9++Furnizor SRL+Str. Exemplu 1+Bucuresti++010000+RO'
RFF+YC1:42759'
NAD+BY+5940000000020::9++Retailer SRL+Bd. Unirii 10+Bucuresti++030000+RO'
NAD+DP+5940000000030::9++Depozit Central+Str. Logistica 5+Ilfov+++077000+RO'
LIN+1++4304984471105:SRV'
PIA+1+8622:IN'
IMD+A++:::Produs Demo 500ml'
QTY+21:18:PCE'
QTY+59:1:PCE'
MOA+66:12399'
PRI+AAA:5.00'
TAX+7+VAT+++:::9+S'
UNS+S'
CNT+2:1'
UNT+20+00001'
UNZ+1+77'
XML v2.0
Message structure: <Message> → <Version> → <Documents> → <Order> → <Header> + <Lines> + <Summary>
Header
| XML Element | Example | Format | M | Description |
|---|---|---|---|---|
Version |
2.0 |
Decimal (max 2 decimals) | Yes | File version |
OrderNumber |
45051454 |
Text | Yes | Order number |
ResponseNumber |
45051454 |
Number | No | Response number for multiple orders |
OrderDate |
2012-07-27 |
YYYY-MM-DD | Yes | Order date |
ExpectedDeliveryDate |
2012-08-15 |
YYYY-MM-DD | No | Expected delivery date |
ExpectedDeliveryTime |
16:00:00 |
HH:MM:SS | No | Delivery deadline time |
DocumentType |
O |
Char (1-2) | Yes | O=original, C=cancellation, R=replacement, RM=goods return, OR=order response, OC=order change |
DocumentType=OR means order response (confirmation that you received the order), not the original order. For a new order, always use DocumentType=O. Confusing these values is one of the most common implementation mistakes.
| XML Element | Example | Format | M | Description |
|---|---|---|---|---|
TestIndicator |
1 |
Number (1) | No | 1=Test, 0 or absent=Production |
OrderType |
OLS130 |
Char (6) | No | OLS130=standard delivery, OLS140=goods pickup/return |
OrderStatus |
Char (max 35) | No | Order status | |
OrderSource |
Char (max 35) | No | Order source | |
| Buyer | <Buyer> |
XML Tag | Yes | Buyer section — registered office |
Buyer/GLN |
5948909999665 |
Number (max 14) | No | Buyer GLN |
Buyer/BuyerInternalCode |
18610500 |
Number (max 9) | No | Buyer internal code |
Buyer/SAPCode |
18610500 |
Text | No | Buyer SAP code |
Buyer/BuyerName |
Text | No | Buyer name | |
Buyer/BuyerAddress |
Text | No | Buyer address | |
Buyer/BuyerPostalCode |
Text | No | Postal code | |
Buyer/BuyerTown |
Text | No | Town | |
Buyer/BuyerCountry |
Text | No | Country | |
| Seller | <Seller> |
XML Tag | Yes | Supplier section |
Seller/GLN |
5948909999665 |
Number (max 14) | Yes | Supplier GLN |
Seller/SellerInternalCode |
18610500 |
Text | No | Supplier internal code |
Seller/SAPCode |
18610500 |
Text | No | Supplier SAP code |
Seller/SellerName |
Text | No | Supplier name | |
Seller/SellerAddress |
Text | No | Supplier address | |
Seller/SellerPostalCode |
Text | No | Postal code | |
Seller/SellerTown |
Text | No | Town | |
Seller/SellerCountry |
Text | No | Country | |
| Delivery | <Delivery> |
XML Tag | Yes | Delivery location |
Delivery/GLN |
5948909999665 |
Number (max 14) | No | Delivery location GLN |
Delivery/DeliveryInternalCode |
18610500 |
Number (max 9) | No | Delivery internal code |
Delivery/SAPCode |
18610500 |
Text | No | SAP code |
Delivery/DeliveryName |
Text | No | Location name | |
Delivery/DeliveryAddressId |
Number (max 9) | Yes | Delivery address ID | |
Delivery/DeliveryAddress |
Text | No | Address | |
Delivery/DeliveryPostalCode |
Text | No | Postal code | |
Delivery/DeliveryTown |
Text | No | Town | |
Delivery/DeliveryCountry |
Text | No | Country | |
DiscountInTransit |
9438.34 |
Decimal (max 2) | No | In-transit discount at order level |
Invoicee/GLN |
5948909999665 |
Number (max 14) | No | GLN of the invoiced party (if different from buyer) |
LSP/GLN |
5948909999665 |
Number (max 14) | No | Logistics service provider GLN |
LSP/LSPInternalCode |
18610500 |
Number (max 10) | No | Logistics service provider internal code |
LSP/SAPCode |
Text | No | Logistics service provider SAP code | |
PromoCode |
XYZ1043888 |
Text | No | Promotion code at order level |
Currency |
RON |
Text (3) | No | Order currency |
DeliveryInformation |
Text (350) | No | Delivery information | |
DispatchInformation |
Text (350) | No | Dispatch information | |
DeliveryInstruction |
Text (350) | No | Delivery instructions | |
OtherNotes |
Text (350) | No | Other notes | |
ProofOfDelivery |
Text (20) | No | Proof of delivery | |
AdditionalRffNo |
Text (35) | No | Additional reference number | |
AdditionalRffDate |
YYYY-MM-DD | No | Additional reference date | |
ALPRffNo |
Text (35) | No | Returnable container reference | |
ALPRffDate |
YYYY-MM-DD | No | Returnable container reference date | |
CNERffNo |
Text (35) | No | Consolidated reference | |
CNERffDate |
YYYY-MM-DD | No | Consolidated reference date | |
NCPRffNo |
Text (35) | No | CHEP pallet reference | |
NCPRffDate |
YYYY-MM-DD | No | CHEP pallet reference date | |
SalesRegionNumber |
Text (35) | No | Sales region number | |
TransportStage |
Text (3) | No | Transport stage code (20=main carriage) |
|
TransportMode |
Text (17) | No | Transport mode (coded) | |
TransportModeCode |
Text (3) | No | 30=road transport |
Lines
| XML Element | Example | Format | M | Description |
|---|---|---|---|---|
LineNumber |
1 |
Numeric | Yes | Line number in the order |
EAN |
5941234567899 |
Number (max 14) | No | Item EAN |
ArticleName |
Aspirina |
Text (max 256) | Yes | Article name |
BuyerItemCode |
123456001001 |
Number (max 20) | Yes | Article code assigned by the buyer |
BuyerAdditionalItemCode |
254635 |
Number | No | Buyer's additional article code |
SupplierItemCode |
ABC1234 |
Text (max 35) | No | Supplier's internal article code |
QuantityPieces |
37.000 |
Decimal (max 3) | Yes | Ordered quantity in the ordered unit (pieces or cases). PackSize=1 → pieces; PackSize>1 → cases |
QuantityBax |
37.000 |
Decimal (max 3) | No | Number of cases for the ordered quantity |
QuantityPallets |
0.020 |
Decimal (max 3) | No | Number of pallets for the ordered quantity |
ConfirmedQtyPieces |
37.000 |
Decimal (max 3) | Cond | Confirmed quantity in pieces. Only with DocumentType=OR |
ConfirmedQtyBax |
37.000 |
Decimal (max 3) | Cond | Confirmed quantity in cases. Only with DocumentType=OR |
ConfirmedQtyPallets |
37.000 |
Decimal (max 3) | Cond | Confirmed quantity in pallets. Only with DocumentType=OR |
PackSize |
1.000 |
Decimal (max 3) | No | Number of pieces per case |
ReturnQuantity |
-37.000 |
Decimal (max 3) | No | Return quantity |
UnitOfMeasure |
PCE |
Allowed list | No | Unit of measure |
UnitNetPrice |
0.8645 |
Decimal (max 4) | No | Net net price per ordered unit |
LinePrice |
10.3740 |
Decimal (max 2) | No | Line total (UnitNetPrice × QuantityPieces) |
FreeGoods |
0 |
Number (0 or 1) | No | 0=no; 1=free goods |
LinePromoCode |
2343254 |
Text | No | Promotion code at line level |
BatchNo |
2343254 |
Text | No | Batch number |
BatchCode |
F |
Text | No | Batch status code |
BestBeforeDate |
2014-03-15 |
YYYY-MM-DD | No | Best before date |
If the same product comes with different expiry dates or batches, send a separate <Line> group per unique date/batch combination — do not combine on the same line.
| XML Element | Example | Format | M | Description |
|---|---|---|---|---|
Discount |
30.00 |
Decimal (max 2) | No | Percentage discount |
Bonus |
30.00 |
Decimal (max 2) | No | Bonus |
NaturalRebate |
30.00 |
Decimal (max 2) | No | Natural rebate |
LineReqDeliveryDate |
Text (YYYY-MM-DD) | No | Requested delivery date per line | |
LinePlanDeliveryDate |
Text (YYYY-MM-DD) | No | Planned delivery date per line | |
LineStatus |
Text (max 35) | No | Line status | |
LineNotes |
Comanda EXCEPTII |
Text (max 35) | No | Free text at line level |
OrderNumber (line) |
45051454 |
Number | No | Order number specific to this line |
OrderDate (line) |
2012-07-27 |
YYYY-MM-DD | No | Order date specific to this line |
Summary
| XML Element | Example | Format | M | Description |
|---|---|---|---|---|
Lines |
1 |
Number | Yes | Total number of lines in the order |
OrderedQuantity |
1 |
Number | No | Total ordered quantity (sum of all quantities) |
ConfirmedQuantity |
1 |
Number | Cond | Total confirmed quantity. Only with DocumentType=OR |
OrderedValue |
1 |
Number | No | Total net value of the order (sum of line totals) |
XSD Schema
File: `Azuvio-CRMconnect-EDIconnect-ORDERS-v2.0.xsd`
xmllint --schema Azuvio-CRMconnect-EDIconnect-ORDERS-v2.0.xsd mesaj-orders.xml --noout
CRMconnect Field Mapping
| EDI Field | EDIfact Segment / XML Element | CRMconnect Field |
|---|---|---|
| Order number | BGM+220 / OrderNumber |
Sales → Orders → PO Reference |
| Order date | DTM+137 / OrderDate |
Sales → Orders → Date |
| Requested delivery date | DTM+2 / ExpectedDeliveryDate |
Sales → Orders → Requested Delivery Date |
| Buyer GLN | NAD+BY / Buyer/GLN |
CRM → Customers → GLN |
| Delivery location GLN | NAD+DP / Delivery/GLN |
CRM → Addresses → GLN |
| Product EAN | LIN / EAN |
Products → EAN/GTIN |
| Buyer internal code | PIA+IN / BuyerItemCode |
Products → Buyer Code |
| Supplier internal code | PIA+SA / SupplierItemCode |
Products → Internal Code |
| Ordered quantity | QTY+21 / QuantityPieces |
Order Line → Quantity |
| Net net price | PRI+AAA / UnitNetPrice |
Order Line → Unit Price |
| Line net value | MOA+66 / LinePrice |
Order Line → Total |
| VAT rate | TAX+7+VAT / n/a |
Product → VAT Class |