EANCOM ORDRSP Purchase Order Response Last updated: 2026-09-29
ORDRSP is the purchase order response. The supplier sends it after an ORDERS to accept, change or reject the order, in whole or line by line. This sample follows EANCOM, the GS1 subset of EDIFACT D96A.
BGM 231 identifies a purchase order response and references the order, and each LIN group carries an action code with the confirmed quantities, prices and delivery dates.
At a glance
- Standard
- EANCOM
- Version
D96A EAN009- Sent by
- Supplier to buyer
- Responses
- CONTRL
- ediFabric .NET template
TSORDRSPinEdiFabric.Templates.Edifact- OpenEDI definition
- View ORDRSP in the spec library
ORDRSP structure
The full EANCOM ORDRSP layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 32 loops and 83 segment positions, in file order. Loops are shaded and their segments indented; Max use is how many times a segment or loop may repeat.
| Segment / loop | Name | Usage | Max use |
|---|---|---|---|
UNH | Message header | Mandatory | 1 |
BGM | Beginning of message | Mandatory | 1 |
DTM | Date/time/period | Mandatory | 35 |
PAI | Payment instructions | Optional | 1 |
ALI | Additional information | Optional | 5 |
FTX | Free text | Optional | 99 |
| RFF loop | Reference | Optional | 10 |
RFF | Reference | Mandatory | 1 |
DTM | Date/time/period | Optional | 5 |
| NAD loop | Name and address | Optional | 99 |
NAD | Name and address | Mandatory | 1 |
LOC | Place/location identification | Optional | 25 |
| RFF loop | Reference | Optional | 10 |
RFF | Reference | Mandatory | 1 |
| CTA loop | Contact information | Optional | 5 |
CTA | Contact information | Mandatory | 1 |
COM | Communication contact | Optional | 5 |
| TAX loop | Duty/tax/fee details | Optional | 5 |
TAX | Duty/tax/fee details | Mandatory | 1 |
MOA | Monetary amount | Optional | 1 |
| CUX loop | Currencies | Optional | 5 |
CUX | Currencies | Mandatory | 1 |
DTM | Date/time/period | Optional | 5 |
| PAT loop | Payment terms basis | Optional | 10 |
PAT | Payment terms basis | Mandatory | 1 |
DTM | Date/time/period | Optional | 5 |
PCD | Percentage details | Optional | 1 |
MOA | Monetary amount | Optional | 1 |
| TDT loop | Details of transport | Optional | 10 |
TDT | Details of transport | Mandatory | 1 |
| LOC loop | Place/location identification | Optional | 10 |
LOC | Place/location identification | Mandatory | 1 |
| TOD loop | Terms of delivery or transport | Optional | 5 |
TOD | Terms of delivery or transport | Mandatory | 1 |
LOC | Place/location identification | Optional | 2 |
| ALC loop | Allowance or charge | Optional | 15 |
ALC | Allowance or charge | Mandatory | 1 |
ALI | Additional information | Optional | 5 |
DTM | Date/time/period | Optional | 5 |
| QTY loop | Quantity | Optional | 1 |
QTY | Quantity | Mandatory | 1 |
RNG | Range details | Optional | 1 |
| PCD loop | Percentage details | Optional | 1 |
PCD | Percentage details | Mandatory | 1 |
RNG | Range details | Optional | 1 |
| MOA loop | Monetary amount | Optional | 2 |
MOA | Monetary amount | Mandatory | 1 |
RNG | Range details | Optional | 1 |
| RTE loop | Rate details | Optional | 1 |
RTE | Rate details | Mandatory | 1 |
RNG | Range details | Optional | 1 |
| TAX loop | Duty/tax/fee details | Optional | 5 |
TAX | Duty/tax/fee details | Mandatory | 1 |
MOA | Monetary amount | Optional | 1 |
| LIN loop | Line item | Optional | 200000 |
LIN | Line item | Mandatory | 1 |
PIA | Additional product id | Optional | 25 |
IMD | Item description | Optional | 99 |
MEA | Measurements | Optional | 5 |
QTY | Quantity | Optional | 10 |
DTM | Date/time/period | Optional | 35 |
MOA | Monetary amount | Optional | 10 |
GIN | Goods identity number | Optional | 1000 |
QVR | Quantity variances | Optional | 1 |
FTX | Free text | Optional | 99 |
| PRI loop | Price details | Optional | 25 |
PRI | Price details | Mandatory | 1 |
CUX | Currencies | Optional | 1 |
| RFF loop | Reference | Optional | 999 |
RFF | Reference | Mandatory | 1 |
DTM | Date/time/period | Optional | 5 |
| PAC loop | Package | Optional | 10 |
PAC | Package | Mandatory | 1 |
| PCI loop | Package identification | Optional | 5 |
PCI | Package identification | Mandatory | 1 |
RFF | Reference | Optional | 1 |
DTM | Date/time/period | Optional | 5 |
GIN | Goods identity number | Optional | 99 |
| LOC loop | Place/location identification | Optional | 9999 |
LOC | Place/location identification | Mandatory | 1 |
QTY | Quantity | Optional | 1 |
DTM | Date/time/period | Optional | 5 |
| TAX loop | Duty/tax/fee details | Optional | 10 |
TAX | Duty/tax/fee details | Mandatory | 1 |
MOA | Monetary amount | Optional | 1 |
| NAD loop | Name and address | Optional | 99 |
NAD | Name and address | Mandatory | 1 |
| CTA loop | Contact information | Optional | 5 |
CTA | Contact information | Mandatory | 1 |
COM | Communication contact | Optional | 5 |
| ALC loop | Allowance or charge | Optional | 99 |
ALC | Allowance or charge | Mandatory | 1 |
ALI | Additional information | Optional | 5 |
DTM | Date/time/period | Optional | 5 |
| QTY loop | Quantity | Optional | 1 |
QTY | Quantity | Mandatory | 1 |
RNG | Range details | Optional | 1 |
| PCD loop | Percentage details | Optional | 1 |
PCD | Percentage details | Mandatory | 1 |
RNG | Range details | Optional | 1 |
| MOA loop | Monetary amount | Optional | 2 |
MOA | Monetary amount | Mandatory | 1 |
RNG | Range details | Optional | 1 |
| RTE loop | Rate details | Optional | 1 |
RTE | Rate details | Mandatory | 1 |
RNG | Range details | Optional | 1 |
| TAX loop | Duty/tax/fee details | Optional | 5 |
TAX | Duty/tax/fee details | Mandatory | 1 |
MOA | Monetary amount | Optional | 1 |
| TDT loop | Details of transport | Optional | 10 |
TDT | Details of transport | Mandatory | 1 |
UNS | Section control | Mandatory | 1 |
MOA | Monetary amount | Optional | 12 |
CNT | Control total | Optional | 10 |
UNT | Message trailer | Mandatory | 1 |
Sample ORDRSP file
An EANCOM order response with line-level confirmations. Paste it into EdiNation to see every element named and validated.
UNB+UNOB:1+SENDER1:16:ZZUK+RECEIVER1:01:ZZUK+071101:1701+131++ORDRSP++1++1' UNH+ME000001+ORDRSP:D:96A:UN:EAN009' BGM+231+ORSP12856+4' DTM+137:20020330:102' RFF+ON:652744' DTM+171:20020325:102' NAD+BY+5412345000013::9' RFF+VA:452282' NAD+SU+4012345500004::9' RFF+VA:87765432' LIN+1+5+3312345501102:SRV' LIN+2+3+3312345501003:SRV' PIA+1+ABC1234:SA' IMD+C++TU::9' QTY+21:48' DTM+2:20020910:102' MOA+203:26400' PRI+AAA:550:CT:AAA' PAC+4+1+CS' TAX+7+VAT+++:::17.5+S' MOA+124:4620' TDT+20++30++31' LIN+3+7+3312345501096:SRV' UNS+S' CNT+2:3' UNT+25+ME000001' UNZ+1+131'
The same ORDRSP as JSON
ediFabric turns every loop, segment and element into a named field. This is the transaction from the sample, in the JSON that ediFabric Native and Cloud return and accept.
{
"UNH": {
"MessageReferenceNumber_01": "ME000001",
"MessageIdentifier_02": {
"MessageType_01": "ORDRSP",
"MessageVersionNumber_02": "D",
"MessageReleaseNumber_03": "96A",
"ControllingAgencyCoded_04": "UN",
"AssociationAssignedCode_05": "EAN009"
}
},
"BGM": {
"DOCUMENTMESSAGENAME_01": {
"Documentmessagenamecoded_01": "231"
},
"DOCUMENTMESSAGENUMBER_02": "ORSP12856",
"MESSAGEFUNCTIONCODED_03": "4"
},
"DTM": [
{
"DATETIMEPERIOD_01": {
"Datetimeperiodqualifier_01": "137",
"Datetimeperiod_02": "20020330",
"Datetimeperiodformatqualifier_03": "102"
}
}
],
"RFFLoop": [
{
"RFF": {
"REFERENCE_01": {
"Referencequalifier_01": "ON",
"Referencenumber_02": "652744"
}
},
"DTM": [
{
"DATETIMEPERIOD_01": {
"Datetimeperiodqualifier_01": "171",
"Datetimeperiod_02": "20020325",
"Datetimeperiodformatqualifier_03": "102"
}
}
]
}
],
"NADLoop": [
{
"NAD": {
"PARTYQUALIFIER_01": "BY",
"PARTYIDENTIFICATIONDETAILS_02": {
"Partyididentification_01": "5412345000013",
"Codelistresponsibleagencycoded_03": "9"
}
},
"RFFLoop": [
{
"RFF": {
"REFERENCE_01": {
"Referencequalifier_01": "VA",
"Referencenumber_02": "452282"
}
}
}
]
},
{
"NAD": {
"PARTYQUALIFIER_01": "SU",
"PARTYIDENTIFICATIONDETAILS_02": {
"Partyididentification_01": "4012345500004",
"Codelistresponsibleagencycoded_03": "9"
}
},
"RFFLoop": [
{
"RFF": {
"REFERENCE_01": {
"Referencequalifier_01": "VA",
"Referencenumber_02": "87765432"
}
}
}
]
}
],
"LINLoop": [
{
"LIN": {
"LINEITEMNUMBER_01": "1",
"ACTIONREQUESTNOTIFICATIONCODED_02": "5",
"ITEMNUMBERIDENTIFICATION_03": {
"Itemnumber_01": "3312345501102",
"Itemnumbertypecoded_02": "SRV"
}
}
},
{
"LIN": {
"LINEITEMNUMBER_01": "2",
"ACTIONREQUESTNOTIFICATIONCODED_02": "3",
"ITEMNUMBERIDENTIFICATION_03": {
"Itemnumber_01": "3312345501003",
"Itemnumbertypecoded_02": "SRV"
}
},
"PIA": [
{
"PRODUCTIDFUNCTIONQUALIFIER_01": "1",
"ITEMNUMBERIDENTIFICATION_02": {
"Itemnumber_01": "ABC1234",
"Itemnumbertypecoded_02": "SA"
}
}
],
"IMD": [
{
"ITEMDESCRIPTIONTYPECODED_01": "C",
"ITEMDESCRIPTION_03": {
"Itemdescriptionidentification_01": "TU",
"Codelistresponsibleagencycoded_03": "9"
}
}
],
"QTY": [
{
"QUANTITYDETAILS_01": {
"Quantityqualifier_01": "21",
"Quantity_02": "48"
}
}
],
"DTM": [
{
"DATETIMEPERIOD_01": {
"Datetimeperiodqualifier_01": "2",
"Datetimeperiod_02": "20020910",
"Datetimeperiodformatqualifier_03": "102"
}
}
],
"MOA": [
{
"MONETARYAMOUNT_01": {
"Monetaryamounttypequalifier_01": "203",
"Monetaryamount_02": "26400"
}
}
],
"PRILoop": [
{
"PRI": {
"PRICEINFORMATION_01": {
"Pricequalifier_01": "AAA",
"Price_02": "550",
"Pricetypecoded_03": "CT",
"Pricetypequalifier_04": "AAA"
}
}
}
],
"PACLoop": [
{
"PAC": {
"NUMBEROFPACKAGES_01": "4",
"PACKAGINGDETAILS_02": {
"Packaginglevelcoded_01": "1"
},
"PACKAGETYPE_03": {
"Typeofpackagesidentification_01": "CS"
}
}
}
],
"TAXLoop": [
{
"TAX": {
"DUTYTAXFEEFUNCTIONQUALIFIER_01": "7",
"DUTYTAXFEETYPE_02": {
"Dutytaxfeetypecoded_01": "VAT"
},
"DUTYTAXFEEDETAIL_05": {
"Dutytaxfeerate_04": "17.5"
},
"DUTYTAXFEECATEGORYCODED_06": "S"
},
"MOA": {
"MONETARYAMOUNT_01": {
"Monetaryamounttypequalifier_01": "124",
"Monetaryamount_02": "4620"
}
}
}
],
"TDTLoop": [
{
"TDT": {
"TRANSPORTSTAGEQUALIFIER_01": "20",
"MODEOFTRANSPORT_03": {
"Modeoftransportcoded_01": "30"
},
"CARRIER_05": {
"Carrieridentification_01": "31"
}
}
}
]
},
{
"LIN": {
"LINEITEMNUMBER_01": "3",
"ACTIONREQUESTNOTIFICATIONCODED_02": "7",
"ITEMNUMBERIDENTIFICATION_03": {
"Itemnumber_01": "3312345501096",
"Itemnumbertypecoded_02": "SRV"
}
}
}
],
"UNS": {
"SECTIONIDENTIFICATION_01": "S"
},
"CNT": [
{
"CONTROL_01": {
"Controlqualifier_01": "2",
"Controlvalue_02": "3"
}
}
],
"UNT": {
"NumberofSegmentsinaMessage_01": "25",
"MessageReferenceNumber_02": "ME000001"
}
}Parse and validate an ORDRSP file
Read the file into typed objects with ediFabric .NET, or post it to the ediFabric Cloud REST API from any language and get JSON back.
using EdiFabric.Templates.EdifactD96A; License.SetSerial("YOUR_SERIAL_KEY"); using (var stream = File.OpenRead(@"C:\edi\PurchaseOrderResponse.txt")) using (var reader = new EdifactReader(stream, "EdiFabric.Templates.Edifact")) { var items = await reader.ReadToEndAsync(); foreach (var transaction in items.OfType<TSORDRSP>()) { if (transaction.IsValid(out MessageErrorContext errors)) Console.WriteLine($"{transaction.UNH.MessageReferenceNumber_01} is valid"); else Console.WriteLine(string.Join(Environment.NewLine, errors.Flatten())); } }
curl -X POST 'https://api.edination.com/v2/edifact/read' \ -H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \ -H 'Content-Type: application/octet-stream' \ --data-binary '@PurchaseOrderResponse.txt'
Generate an ORDRSP file
Populate a TSORDRSP object in .NET, or post JSON in the shape shown above to ediFabric Cloud, and get a valid ORDRSP file back.
using EdiFabric.Templates.EdifactD96A; License.SetSerial("YOUR_SERIAL_KEY"); var transaction = new TSORDRSP(); // Message header transaction.UNH = new UNH(); transaction.UNH.MessageReferenceNumber_01 = "0001"; transaction.UNH.MessageIdentifier_02 = new S009(); transaction.UNH.MessageIdentifier_02.MessageType_01 = "ORDRSP"; transaction.UNH.MessageIdentifier_02.MessageVersionNumber_02 = "D"; transaction.UNH.MessageIdentifier_02.MessageReleaseNumber_03 = "96A"; transaction.UNH.MessageIdentifier_02.ControllingAgencyCoded_04 = "UN"; // Order response number ORSP12856, accepted with proposals for change transaction.BGM = new BGM(); transaction.BGM.DOCUMENTMESSAGENAME_01 = new C002(); transaction.BGM.DOCUMENTMESSAGENAME_01.Documentmessagenamecoded_01 = "231"; transaction.BGM.Documentmessagenumber_02 = "ORSP12856"; transaction.BGM.Messagefunctioncoded_03 = "4"; // Repeating DTM transaction.DTM = new List<DTM>(); // ... set the remaining loops and segments the same way // SegmentBuilders is in the Common project of the example repository using (var stream = new MemoryStream()) { using (var writer = new EdifactWriter(stream)) { writer.Write(SegmentBuilders.BuildUnb("1")); writer.Write(transaction); } Console.WriteLine(Encoding.UTF8.GetString(stream.ToArray())); }
# the JSON returned by /read, edited or produced by your application curl -X POST 'https://api.edination.com/v2/edifact/write' \ -H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \ -H 'Content-Type: application/json' \ --data-binary '@PurchaseOrderResponse.json' \ -o 'PurchaseOrderResponse.txt'
Complete ediFabric .NET example
A complete C# program for the EANCOM ORDRSP, built on TSORDRSP in EdiFabric.Templates.Edifact. The same code is in the ediFabric .NET examples on GitHub.
using EdiFabric.Core.Model.Edi;
using EdiFabric.Framework.Readers;
using EdiFabric.Framework.Writers;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using EdiFabric.Core.Model.Edi.Edifact;
using EdiFabric.Templates.EdifactD96A;
using EdiFabric.Examples.EDIFACT.Common;
namespace EdiFabric.Examples.EDIFACT.ORDRSP
{
class Program
{
static void Main(string[] args)
{
SerialKey.Set(Common.SerialKey.Get());
Read();
Write();
}
///
/// Read Order Response
///
static void Read()
{
var ediStream = File.OpenRead(Directory.GetCurrentDirectory() + @"\..\..\..\Files\Eancom\PurchaseOrderResponse.txt");
List ediItems;
using (var ediReader = new EdifactReader(ediStream, "EdiFabric.Templates.Edifact"))
ediItems = ediReader.ReadToEnd().ToList();
var transactions = ediItems.OfType();
foreach (var transaction in transactions)
{
if (transaction.HasErrors)
{
// partially parsed
var errors = transaction.ErrorContext.Flatten();
}
}
}
///
/// Write Order Response
///
static void Write()
{
var transaction = BuildOrderResponse("ME000001");
using (var stream = new MemoryStream())
{
using (var writer = new EdifactWriter(stream))
{
writer.Write(SegmentBuilders.BuildUnb("1"));
writer.Write(transaction);
}
var ediString = stream.LoadToString();
}
}
///
/// Build order response.
/// Original from https://www.gs1.org/sites/default/files/docs/eancom/s4/ordrsp.pdf
///
static TSORDRSP BuildOrderResponse(string controlNumber)
{
var result = new TSORDRSP();
// Message header
result.UNH = new UNH();
result.UNH.MessageReferenceNumber_01 = controlNumber.PadLeft(14, '0');
result.UNH.MessageIdentifier_02 = new S009();
result.UNH.MessageIdentifier_02.MessageType_01 = "ORDRSP";
result.UNH.MessageIdentifier_02.MessageVersionNumber_02 = "D";
result.UNH.MessageIdentifier_02.MessageReleaseNumber_03 = "96A";
result.UNH.MessageIdentifier_02.ControllingAgencyCoded_04 = "UN";
// Order response number ORSP12856, accepted with proposals for change
result.BGM = new BGM();
result.BGM.DOCUMENTMESSAGENAME_01 = new C002();
result.BGM.DOCUMENTMESSAGENAME_01.Documentmessagenamecoded_01 = "231";
result.BGM.Documentmessagenumber_02 = "ORSP12856";
result.BGM.Messagefunctioncoded_03 = "4";
// Repeating DTM
result.DTM = new List();
// Message date is 30th of March 2002
var dtm1 = new DTM();
dtm1.DATETIMEPERIOD_01 = new C507();
dtm1.DATETIMEPERIOD_01.Datetimeperiodqualifier_01 = "137";
dtm1.DATETIMEPERIOD_01.Datetimeperiod_02 = "20020330";
dtm1.DATETIMEPERIOD_01.Datetimeperiodformatqualifier_03 = "102";
result.DTM.Add(dtm1);
// Repeating RFF Groups
result.RFFLoop = new List();
// Begin RFF Group
var rffLoop1 = new Loop_RFF_ORDRSP();
// Message is responding to order number 652744
rffLoop1.RFF = new RFF();
rffLoop1.RFF.REFERENCE_01 = new C506();
rffLoop1.RFF.REFERENCE_01.Referencequalifier_01 = "ON";
rffLoop1.RFF.REFERENCE_01.Referencenumber_02 = "652744";
// Repeating DTM
rffLoop1.DTM = new List();
// Order date is 25th of March 2002
var dtmRff1 = new DTM();
dtmRff1.DATETIMEPERIOD_01 = new C507();
dtmRff1.DATETIMEPERIOD_01.Datetimeperiodqualifier_01 = "171";
dtmRff1.DATETIMEPERIOD_01.Datetimeperiod_02 = "20020325";
dtmRff1.DATETIMEPERIOD_01.Datetimeperiodformatqualifier_03 = "102";
rffLoop1.DTM.Add(dtmRff1);
// End RFF Group
result.RFFLoop.Add(rffLoop1);
// Repeating NAD Groups
result.NADLoop = new List();
// Begin NAD Group 1
var nadLoop1 = new Loop_NAD_ORDRSP();
// Buyer is identified using GLN 5412345000013
nadLoop1.NAD = new NAD();
nadLoop1.NAD.Partyqualifier_01 = "BY";
nadLoop1.NAD.PARTYIDENTIFICATIONDETAILS_02 = new C082();
nadLoop1.NAD.PARTYIDENTIFICATIONDETAILS_02.Partyididentification_01 = "5412345000013";
nadLoop1.NAD.PARTYIDENTIFICATIONDETAILS_02.Codelistresponsibleagencycoded_03 = "9";
// Repeating RFF NAD Groups
nadLoop1.RFFLoop = new List();
// Begin RFF NAD Group
var rffNadLoop1 = new Loop_RFF_ORDRSP();
// Buyer’s VAT number is 452282
rffNadLoop1.RFF = new RFF();
rffNadLoop1.RFF.REFERENCE_01 = new C506();
rffNadLoop1.RFF.REFERENCE_01.Referencequalifier_01 = "VA";
rffNadLoop1.RFF.REFERENCE_01.Referencenumber_02 = "452282";
// End RFF NAD Group
nadLoop1.RFFLoop.Add(rffNadLoop1);
// End NAD Group 1
result.NADLoop.Add(nadLoop1);
// Begin NAD Group 2
var nadLoop2 = new Loop_NAD_ORDRSP();
// Supplier is identified using GLN 4012345500004
nadLoop2.NAD = new NAD();
nadLoop2.NAD.Partyqualifier_01 = "SU";
nadLoop2.NAD.PARTYIDENTIFICATIONDETAILS_02 = new C082();
nadLoop2.NAD.PARTYIDENTIFICATIONDETAILS_02.Partyididentification_01 = "4012345500004";
nadLoop2.NAD.PARTYIDENTIFICATIONDETAILS_02.Codelistresponsibleagencycoded_03 = "9";
// Repeating RFF NAD Groups
nadLoop2.RFFLoop = new List();
// Begin RFF NAD Group
var rffNadLoop2 = new Loop_RFF_ORDRSP();
// Supplier’s VAT number is 87765432
rffNadLoop2.RFF = new RFF();
rffNadLoop2.RFF.REFERENCE_01 = new C506();
rffNadLoop2.RFF.REFERENCE_01.Referencequalifier_01 = "VA";
rffNadLoop2.RFF.REFERENCE_01.Referencenumber_02 = "87765432";
// End RFF NAD Group
nadLoop2.RFFLoop.Add(rffNadLoop2);
// End NAD Group 2
result.NADLoop.Add(nadLoop2);
// Repeating LIN Groups
result.LINLoop = new List();
// Begin LIN Group 1
var linLoop1 = new Loop_LIN_ORDRSP();
// First product identified by GTIN 3312345501102 is accepted
linLoop1.LIN = new LIN();
linLoop1.LIN.Lineitemnumber_01 = "1";
linLoop1.LIN.Actionrequestnotificationcoded_02 = "5";
linLoop1.LIN.ITEMNUMBERIDENTIFICATION_03 = new C212();
linLoop1.LIN.ITEMNUMBERIDENTIFICATION_03.Itemnumber_01 = "3312345501102";
linLoop1.LIN.ITEMNUMBERIDENTIFICATION_03.Itemnumbertypecoded_02 = "SRV";
// End LIN Group 1
result.LINLoop.Add(linLoop1);
// Begin LIN Group 2
var linLoop2 = new Loop_LIN_ORDRSP();
// Second product identified by GTIN 3312345501003 is amended
linLoop2.LIN = new LIN();
linLoop2.LIN.Lineitemnumber_01 = "2";
linLoop2.LIN.Actionrequestnotificationcoded_02 = "3";
linLoop2.LIN.ITEMNUMBERIDENTIFICATION_03 = new C212();
linLoop2.LIN.ITEMNUMBERIDENTIFICATION_03.Itemnumber_01 = "3312345501003";
linLoop2.LIN.ITEMNUMBERIDENTIFICATION_03.Itemnumbertypecoded_02 = "SRV";
// Repeating PIA
linLoop2.PIA = new List();
// Supplier’s article number ABC1234 is provided as an additional identification
var piaLin1 = new PIA();
piaLin1.Productidfunctionqualifier_01 = "1";
piaLin1.ITEMNUMBERIDENTIFICATION_02 = new C212();
piaLin1.ITEMNUMBERIDENTIFICATION_02.Itemnumber_01 = "ABC1234";
piaLin1.ITEMNUMBERIDENTIFICATION_02.Itemnumbertypecoded_02 = "SA";
linLoop2.PIA.Add(piaLin1);
// Repeating IMD
linLoop2.IMD = new List();
// Product is a traded unit
var imdLin1 = new IMD();
imdLin1.Itemdescriptiontypecoded_01 = "C";
imdLin1.ITEMDESCRIPTION_03 = new C273();
imdLin1.ITEMDESCRIPTION_03.Itemdescriptionidentification_01 = "TU";
imdLin1.ITEMDESCRIPTION_03.Codelistresponsibleagencycoded_03 = "9";
linLoop2.IMD.Add(imdLin1);
// Repeating QTY
linLoop2.QTY = new List();
// Ordered quantity is 48
var qtyLin1 = new QTY();
qtyLin1.QUANTITYDETAILS_01 = new C186();
qtyLin1.QUANTITYDETAILS_01.Quantityqualifier_01 = "21";
qtyLin1.QUANTITYDETAILS_01.Quantity_02 = "48";
linLoop2.QTY.Add(qtyLin1);
// Repeating DTM
linLoop2.DTM = new List();
// Date of order is 10th of September 2002
var dtmLin1 = new DTM();
dtmLin1.DATETIMEPERIOD_01 = new C507();
dtmLin1.DATETIMEPERIOD_01.Datetimeperiodqualifier_01 = "2";
dtmLin1.DATETIMEPERIOD_01.Datetimeperiod_02 = "20020910";
dtmLin1.DATETIMEPERIOD_01.Datetimeperiodformatqualifier_03 = "102";
linLoop2.DTM.Add(dtmLin1);
// Repeating MOA
linLoop2.MOA = new List();
// Value of ordered line is 26400
var moaLin1 = new MOA();
moaLin1.MONETARYAMOUNT_01 = new C516();
moaLin1.MONETARYAMOUNT_01.Monetaryamounttypequalifier_01 = "203";
moaLin1.MONETARYAMOUNT_01.Monetaryamount_02 = "26400";
linLoop2.MOA.Add(moaLin1);
// Repeating PRI Groups
linLoop2.PRILoop = new List();
// Begin PRI LIN Group
var priLin1 = new Loop_PRI_ORDRSP();
// Net calculation price is 550
priLin1.PRI = new PRI();
priLin1.PRI.PRICEINFORMATION_01 = new C509();
priLin1.PRI.PRICEINFORMATION_01.Pricequalifier_01 = "AAA";
priLin1.PRI.PRICEINFORMATION_01.Price_02 = "550";
priLin1.PRI.PRICEINFORMATION_01.Pricetypecoded_03 = "CT";
priLin1.PRI.PRICEINFORMATION_01.Pricetypequalifier_04 = "AAA";
// End PRI LIN Group
linLoop2.PRILoop.Add(priLin1);
// Repeating PAC Groups
linLoop2.PACLoop = new List();
// Begin PAC LIN Group
var pacLin1 = new Loop_PAC_ORDRSP_2();
// Product is packaged in a case
pacLin1.PAC = new PAC();
pacLin1.PAC.Numberofpackages_01 = "4";
pacLin1.PAC.PACKAGINGDETAILS_02 = new C531();
pacLin1.PAC.PACKAGINGDETAILS_02.Packaginglevelcoded_01 = "1";
pacLin1.PAC.PACKAGETYPE_03 = new C202();
pacLin1.PAC.PACKAGETYPE_03.Typeofpackagesidentification_01 = "CS";
// End PAC LIN Group
linLoop2.PACLoop.Add(pacLin1);
// Repeating TAX Groups
linLoop2.TAXLoop = new List();
// Begin TAX LIN Group
var taxLin1 = new Loop_TAX_ORDRSP();
// Product is subject to standard VAT rate of 17.5 %
taxLin1.TAX = new TAX();
taxLin1.TAX.Dutytaxfeefunctionqualifier_01 = "7";
taxLin1.TAX.DUTYTAXFEETYPE_02 = new C241();
taxLin1.TAX.DUTYTAXFEETYPE_02.Dutytaxfeetypecoded_01 = "VAT";
taxLin1.TAX.DUTYTAXFEEDETAIL_05 = new C243();
taxLin1.TAX.DUTYTAXFEEDETAIL_05.Dutytaxfeerate_04 = "17.5";
taxLin1.TAX.Dutytaxfeecategorycoded_06 = "S";
// Tax amount for product is 4620
taxLin1.MOA = new MOA();
taxLin1.MOA.MONETARYAMOUNT_01 = new C516();
taxLin1.MOA.MONETARYAMOUNT_01.Monetaryamounttypequalifier_01 = "124";
taxLin1.MOA.MONETARYAMOUNT_01.Monetaryamount_02 = "4620";
// End TAX LIN Group
linLoop2.TAXLoop.Add(taxLin1);
// Repeating TDT Groups
linLoop2.TDTLoop = new List();
// Begin TDT LIN Group
var tdtLin1 = new Loop_TDT_ORDRSP();
// Main carriage transport for the product is a truck
tdtLin1.TDT = new TDT();
tdtLin1.TDT.Transportstagequalifier_01 = "20";
tdtLin1.TDT.MODEOFTRANSPORT_03 = new C220();
tdtLin1.TDT.MODEOFTRANSPORT_03.Modeoftransportcoded_01 = "30";
tdtLin1.TDT.CARRIER_05 = new C040();
tdtLin1.TDT.CARRIER_05.Carrieridentification_01 = "31";
// End TDT LIN Group
linLoop2.TDTLoop.Add(tdtLin1);
// End LIN Group 2
result.LINLoop.Add(linLoop2);
// Begin LIN Group 3
var linLoop3 = new Loop_LIN_ORDRSP();
// Third product identified by GTIN 3312345501096 is not accepted
linLoop3.LIN = new LIN();
linLoop3.LIN.Lineitemnumber_01 = "3";
linLoop3.LIN.Actionrequestnotificationcoded_02 = "7";
linLoop3.LIN.ITEMNUMBERIDENTIFICATION_03 = new C212();
linLoop3.LIN.ITEMNUMBERIDENTIFICATION_03.Itemnumber_01 = "3312345501096";
linLoop3.LIN.ITEMNUMBERIDENTIFICATION_03.Itemnumbertypecoded_02 = "SRV";
// End LIN Group 3
result.LINLoop.Add(linLoop3);
// Message detail/summary separator
result.UNS = new UNS();
result.UNS.Sectionidentification_01 = "S";
// Repeating CNT
result.CNT = new List();
// Count of the number of LIN segments in the message
var cnt = new CNT();
cnt.CONTROL_01 = new C270();
cnt.CONTROL_01.Controlqualifier_01 = "2";
cnt.CONTROL_01.Controlvalue_02 = "3";
result.CNT.Add(cnt);
return result;
}
}
}More operations in ediFabric .NET
ORDRSP questions
How does ORDRSP accept or change an order?
BGM03 gives the message function for the whole response, and LIN02 on each line uses action codes such as 5 accepted without amendment, 3 changed or 7 not accepted.
Is ORDRSP the same as CONTRL?
No. CONTRL only confirms receipt and syntax. ORDRSP is the business answer to the order.
What is the X12 equivalent?
The X12 855 purchase order acknowledgment.
How do I parse and generate EANCOM ORDRSP files in .NET?
In .NET, install EdiFabric and EdiFabric.Templates.Edifact, read the file with EdifactReader into TSORDRSP objects and write them back with EdifactWriter. From any other language, post the file to the ediFabric Cloud REST API, which returns the same structure as JSON and converts JSON back to EANCOM.
Resources
Parse your first EANCOM ORDRSP in five minutes
The Community plan is free forever and needs no credit card. It includes ediFabric .NET, Native and Cloud with one serial key.
Sign up free Validate EDI files free