EANCOM DESADV Despatch Advice

DESADV is the despatch advice - the EDIFACT advance ship notice. Suppliers send it when goods leave so the receiver can prepare and scan the delivery. This sample follows EANCOM D96A.

CPS groups build the packing hierarchy: consignment, pallets and cartons, each with PAC packaging and GS1 SSCC identifiers, and LIN groups list the items and quantities they contain.

At a glance

Standard
EANCOM
Version
D96A EAN007
Sent by
Supplier to buyer
Responses
CONTRL, RECADV
ediFabric .NET template
TSDESADV in EdiFabric.Templates.Edifact
OpenEDI definition
View DESADV in the spec library

DESADV structure

The full EANCOM DESADV layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 20 loops and 49 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
UNHMessage headerMandatory1
BGMBeginning of messageMandatory1
DTMDate/time/periodOptional10
RFF loopReferenceOptional10
RFFReferenceMandatory1
DTMDate/time/periodOptional1
NAD loopName and addressOptional10
NADName and addressMandatory1
RFF loopReferenceOptional10
RFFReferenceMandatory1
CTA loopContact informationOptional10
CTAContact informationMandatory1
COMCommunication contactOptional5
TOD loopTerms of delivery or transportOptional10
TODTerms of delivery or transportMandatory1
LOCPlace/location identificationOptional5
TDT loopDetails of transportOptional10
TDTDetails of transportMandatory1
LOC loopPlace/location identificationOptional10
LOCPlace/location identificationMandatory1
EQD loopEquipment detailsOptional10
EQDEquipment detailsMandatory1
MEAMeasurementsOptional5
SELSeal numberOptional25
CPS loopConsignment packing sequenceOptional9999
CPSConsignment packing sequenceMandatory1
PAC loopPackageOptional9999
PACPackageMandatory1
MEAMeasurementsOptional10
QTYQuantityOptional10
HAN loopHandling instructionsOptional10
HANHandling instructionsMandatory1
PCI loopPackage identificationOptional1000
PCIPackage identificationMandatory1
RFFReferenceOptional1
DTMDate/time/periodOptional5
GIN loopGoods identity numberOptional99
GINGoods identity numberMandatory1
LIN loopLine itemOptional9999
LINLine itemMandatory1
PIAAdditional product idOptional10
IMDItem descriptionOptional25
MEAMeasurementsOptional10
QTYQuantityOptional10
DLMDelivery limitationsOptional100
DTMDate/time/periodOptional5
FTXFree textOptional5
RFF loopReferenceOptional10
RFFReferenceMandatory1
DTMDate/time/periodOptional1
LOC loopPlace/location identificationOptional100
LOCPlace/location identificationMandatory1
DTMDate/time/periodOptional1
QTYQuantityOptional10
PCI loopPackage identificationOptional9999
PCIPackage identificationMandatory1
DTMDate/time/periodOptional5
MEAMeasurementsOptional10
QTYQuantityOptional1
GIN loopGoods identity numberOptional10
GINGoods identity numberMandatory1
DLMDelivery limitationsOptional100
HAN loopHandling instructionsOptional10
HANHandling instructionsMandatory1
QVR loopQuantity variancesOptional10
QVRQuantity variancesMandatory1
DTMDate/time/periodOptional5
CNTControl totalOptional5
UNTMessage trailerMandatory1

Mandatory segments must be sent, Optional ones only when the data applies. Trading partners often add their own rules in companion guides - ediFabric templates can be adjusted to match. Open the element-level definition in the EdiNation spec library.

Sample DESADV file

An EANCOM despatch advice with a packing hierarchy and line items. Paste it into EdiNation to see every element named and validated.

UNB+UNOB:1+SENDER1:1+RECEIVER1:1+071101:1701+131++INVOIC++1++1'
UNH+ME000001+DESADV:D:96A:UN:EAN007'
BGM+351+DES587441+9'
DTM+137:20020401:102'
DTM+11:20020403:102'
DTM+358:20020403:102'
RFF+ON:12332'
DTM+171:20020325:102'
NAD+SU+5411234512309::9'
RFF+VA:6558774'
NAD+BY+5412345000013::9'
RFF+VA:7002474'
NAD+DP+5412345123453::9'
RFF+VA:800800'
NAD+SH+5412345000105::9'
CPS+1'
PAC+2++201::9'
CPS+2+1'
PAC+1++201::9'
MEA+PD+AAB+KGM:263.2'
MEA+PD+WD+MMT:800'
MEA+PD+LN+MMT:1200'
PCI+33E'
GIN+BJ+354107380000001051'
PAC+20++CT'
LIN+1++5410738000152:SRV'
QTY+12:20'
CPS+3+1'
PAC+1++201::9'
MEA+PD+AAB+KGM:305.1'
PCI+33E'
GIN+BJ+354107380000001068'
PAC+20++CT'
LIN+2++5410738000169:SRV'
QTY+12:5'
LIN+3++5410738000176:SRV'
QTY+12:3'
LIN+4++5410738000183:SRV'
QTY+12:12'
CNT+2:4'
UNT+40+ME000001'
UNZ+2+131'

The same DESADV 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": "DESADV",
      "MessageVersionNumber_02": "D",
      "MessageReleaseNumber_03": "96A",
      "ControllingAgencyCoded_04": "UN",
      "AssociationAssignedCode_05": "EAN007"
    }
  },
  "BGM": {
    "DOCUMENTMESSAGENAME_01": {
      "Documentmessagenamecoded_01": "351"
    },
    "DOCUMENTMESSAGENUMBER_02": "DES587441",
    "MESSAGEFUNCTIONCODED_03": "9"
  },
  "DTM": [
    {
      "DATETIMEPERIOD_01": {
        "Datetimeperiodqualifier_01": "137",
        "Datetimeperiod_02": "20020401",
        "Datetimeperiodformatqualifier_03": "102"
      }
    },
    {
      "DATETIMEPERIOD_01": {
        "Datetimeperiodqualifier_01": "11",
        "Datetimeperiod_02": "20020403",
        "Datetimeperiodformatqualifier_03": "102"
      }
    },
    {
      "DATETIMEPERIOD_01": {
        "Datetimeperiodqualifier_01": "358",
        "Datetimeperiod_02": "20020403",
        "Datetimeperiodformatqualifier_03": "102"
      }
    }
  ],
  "RFFLoop": [
    {
      "RFF": {
        "REFERENCE_01": {
          "Referencequalifier_01": "ON",
          "Referencenumber_02": "12332"
        }
      },
      "DTM": {
        "DATETIMEPERIOD_01": {
          "Datetimeperiodqualifier_01": "171",
          "Datetimeperiod_02": "20020325",
          "Datetimeperiodformatqualifier_03": "102"
        }
      }
    }
  ],
  "NADLoop": [
    {
      "NAD": {
        "PARTYQUALIFIER_01": "SU",
        "PARTYIDENTIFICATIONDETAILS_02": {
          "Partyididentification_01": "5411234512309",
          "Codelistresponsibleagencycoded_03": "9"
        }
      },
      "RFFLoop": [
        {
          "RFF": {
            "REFERENCE_01": {
              "Referencequalifier_01": "VA",
              "Referencenumber_02": "6558774"
            }
          }
        }
      ]
    },
    {
      "NAD": {
        "PARTYQUALIFIER_01": "BY",
        "PARTYIDENTIFICATIONDETAILS_02": {
          "Partyididentification_01": "5412345000013",
          "Codelistresponsibleagencycoded_03": "9"
        }
      },
      "RFFLoop": [
        {
          "RFF": {
            "REFERENCE_01": {
              "Referencequalifier_01": "VA",
              "Referencenumber_02": "7002474"
            }
          }
        }
      ]
    },
    {
      "NAD": {
        "PARTYQUALIFIER_01": "DP",
        "PARTYIDENTIFICATIONDETAILS_02": {
          "Partyididentification_01": "5412345123453",
          "Codelistresponsibleagencycoded_03": "9"
        }
      },
      "RFFLoop": [
        {
          "RFF": {
            "REFERENCE_01": {
              "Referencequalifier_01": "VA",
              "Referencenumber_02": "800800"
            }
          }
        }
      ]
    },
    {
      "NAD": {
        "PARTYQUALIFIER_01": "SH",
        "PARTYIDENTIFICATIONDETAILS_02": {
          "Partyididentification_01": "5412345000105",
          "Codelistresponsibleagencycoded_03": "9"
        }
      }
    }
  ],
  "CPSLoop": [
    {
      "CPS": {
        "HIERARCHICALIDNUMBER_01": "1"
      },
      "PACLoop": [
        {
          "PAC": {
            "NUMBEROFPACKAGES_01": "2",
            "PACKAGETYPE_03": {
              "Typeofpackagesidentification_01": "201",
              "Codelistresponsibleagencycoded_03": "9"
            }
          }
        }
      ]
    },
    {
      "CPS": {
        "HIERARCHICALIDNUMBER_01": "2",
        "HIERARCHICALPARENTID_02": "1"
      },
      "PACLoop": [
        {
          "PAC": {
            "NUMBEROFPACKAGES_01": "1",
            "PACKAGETYPE_03": {
              "Typeofpackagesidentification_01": "201",
              "Codelistresponsibleagencycoded_03": "9"
            }
          },
          "MEA": [
            {
              "MEASUREMENTAPPLICATIONQUALIFIER_01": "PD",
              "MEASUREMENTDETAILS_02": {
                "Measurementdimensioncoded_01": "AAB"
              },
              "VALUERANGE_03": {
                "Measureunitqualifier_01": "KGM",
                "Measurementvalue_02": "263.2"
              }
            },
            {
              "MEASUREMENTAPPLICATIONQUALIFIER_01": "PD",
              "MEASUREMENTDETAILS_02": {
                "Measurementdimensioncoded_01": "WD"
              },
              "VALUERANGE_03": {
                "Measureunitqualifier_01": "MMT",
                "Measurementvalue_02": "800"
              }
            },
            {
              "MEASUREMENTAPPLICATIONQUALIFIER_01": "PD",
              "MEASUREMENTDETAILS_02": {
                "Measurementdimensioncoded_01": "LN"
              },
              "VALUERANGE_03": {
                "Measureunitqualifier_01": "MMT",
                "Measurementvalue_02": "1200"
              }
            }
          ],
          "PCILoop": [
            {
              "PCI": {
                "MARKINGINSTRUCTIONSCODED_01": "33E"
              },
              "GINLoop": [
                {
                  "GIN": {
                    "IDENTITYNUMBERQUALIFIER_01": "BJ",
                    "IDENTITYNUMBERRANGE_02": {
                      "Identitynumber_01": "354107380000001051"
                    }
                  }
                }
              ]
            }
          ]
        },
        {
          "PAC": {
            "NUMBEROFPACKAGES_01": "20",
            "PACKAGETYPE_03": {
              "Typeofpackagesidentification_01": "CT"
            }
          }
        }
      ],
      "LINLoop": [
        {
          "LIN": {
            "LINEITEMNUMBER_01": "1",
            "ITEMNUMBERIDENTIFICATION_03": {
              "Itemnumber_01": "5410738000152",
              "Itemnumbertypecoded_02": "SRV"
            }
          },
          "QTY": [
            {
              "QUANTITYDETAILS_01": {
                "Quantityqualifier_01": "12",
                "Quantity_02": "20"
              }
            }
          ]
        }
      ]
    },
    {
      "CPS": {
        "HIERARCHICALIDNUMBER_01": "3",
        "HIERARCHICALPARENTID_02": "1"
      },
      "PACLoop": [
        {
          "PAC": {
            "NUMBEROFPACKAGES_01": "1",
            "PACKAGETYPE_03": {
              "Typeofpackagesidentification_01": "201",
              "Codelistresponsibleagencycoded_03": "9"
            }
          },
          "MEA": [
            {
              "MEASUREMENTAPPLICATIONQUALIFIER_01": "PD",
              "MEASUREMENTDETAILS_02": {
                "Measurementdimensioncoded_01": "AAB"
              },
              "VALUERANGE_03": {
                "Measureunitqualifier_01": "KGM",
                "Measurementvalue_02": "305.1"
              }
            }
          ],
          "PCILoop": [
            {
              "PCI": {
                "MARKINGINSTRUCTIONSCODED_01": "33E"
              },
              "GINLoop": [
                {
                  "GIN": {
                    "IDENTITYNUMBERQUALIFIER_01": "BJ",
                    "IDENTITYNUMBERRANGE_02": {
                      "Identitynumber_01": "354107380000001068"
                    }
                  }
                }
              ]
            }
          ]
        },
        {
          "PAC": {
            "NUMBEROFPACKAGES_01": "20",
            "PACKAGETYPE_03": {
              "Typeofpackagesidentification_01": "CT"
            }
          }
        }
      ],
      "LINLoop": [
        {
          "LIN": {
            "LINEITEMNUMBER_01": "2",
            "ITEMNUMBERIDENTIFICATION_03": {
              "Itemnumber_01": "5410738000169",
              "Itemnumbertypecoded_02": "SRV"
            }
          },
          "QTY": [
            {
              "QUANTITYDETAILS_01": {
                "Quantityqualifier_01": "12",
                "Quantity_02": "5"
              }
            }
          ]
        },
        {
          "LIN": {
            "LINEITEMNUMBER_01": "3",
            "ITEMNUMBERIDENTIFICATION_03": {
              "Itemnumber_01": "5410738000176",
              "Itemnumbertypecoded_02": "SRV"
            }
          },
          "QTY": [
            {
              "QUANTITYDETAILS_01": {
                "Quantityqualifier_01": "12",
                "Quantity_02": "3"
              }
            }
          ]
        },
        {
          "LIN": {
            "LINEITEMNUMBER_01": "4",
            "ITEMNUMBERIDENTIFICATION_03": {
              "Itemnumber_01": "5410738000183",
              "Itemnumbertypecoded_02": "SRV"
            }
          },
          "QTY": [
            {
              "QUANTITYDETAILS_01": {
                "Quantityqualifier_01": "12",
                "Quantity_02": "12"
              }
            }
          ]
        }
      ]
    }
  ],
  "CNT": [
    {
      "CONTROL_01": {
        "Controlqualifier_01": "2",
        "Controlvalue_02": "4"
      }
    }
  ],
  "UNT": {
    "NumberofSegmentsinaMessage_01": "40",
    "MessageReferenceNumber_02": "ME000001"
  }
}

Parse and validate a DESADV 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\DespatchAdvice.txt"))
using (var reader = new EdifactReader(stream, "EdiFabric.Templates.Edifact"))
{
    var items = await reader.ReadToEndAsync();
    foreach (var transaction in items.OfType<TSDESADV>())
    {
        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 '@DespatchAdvice.txt'

Generate a DESADV file

Populate a TSDESADV object in .NET, or post JSON in the shape shown above to ediFabric Cloud, and get a valid DESADV file back.

using EdiFabric.Templates.EdifactD96A;

License.SetSerial("YOUR_SERIAL_KEY");

var transaction = new TSDESADV();

//  Message header
transaction.UNH = new UNH();
transaction.UNH.MessageReferenceNumber_01 = "0001";
transaction.UNH.MessageIdentifier_02 = new S009();
transaction.UNH.MessageIdentifier_02.MessageType_01 = "DESADV";
transaction.UNH.MessageIdentifier_02.MessageVersionNumber_02 = "D";
transaction.UNH.MessageIdentifier_02.MessageReleaseNumber_03 = "96A";
transaction.UNH.MessageIdentifier_02.ControllingAgencyCoded_04 = "UN";

//  Despatch advice number DES587441
transaction.BGM = new BGM();
transaction.BGM.DOCUMENTMESSAGENAME_01 = new C002();
transaction.BGM.DOCUMENTMESSAGENAME_01.Documentmessagenamecoded_01 = "351";
transaction.BGM.Documentmessagenumber_02 = "DES587441";
transaction.BGM.Messagefunctioncoded_03 = "9";

//  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 '@DespatchAdvice.json' \
-o 'DespatchAdvice.txt'

DESADV questions

How does DESADV describe pallets and cartons?

Each CPS group is one level in the packing hierarchy, with its parent in CPS02. PAC gives the package type and PCI/GIN the SSCC printed on the label.

What does the receiver send back?

A CONTRL for syntax and, when agreed, a RECADV receiving advice with the quantities actually received.

What is the X12 equivalent?

The X12 856 ship notice/manifest.

How do I parse and generate EANCOM DESADV files in .NET?

In .NET, install EdiFabric and EdiFabric.Templates.Edifact, read the file with EdifactReader into TSDESADV 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.

Parse your first DESADV in five minutes

The Community plan is free forever and needs no credit card. It includes ediFabric .NET, Native and Cloud.