ediverse Explore the platform

Spotlight PEPPOL BIS Billing 3.0 The EU e-invoicing mandate is here — France Sept 2026, Belgium Jan 2026, Germany 2025.
CUSDEC D.05A

CUSDEC — EDIFACT Customs Declaration Message (D.05A)

The CUSDEC message is the customs declaration sent by a declarant to a customs administration for import or export: detailed declaration of goods, value, origin, customs regime and associated duties. It is one of the largest EDIFACT messages. This page summarises the segment structure as published by UN/CEFACT for directory D.05A.

Purpose

The CUSDEC message is the customs declaration sent by a declarant to a customs administration for import or export: detailed declaration of goods, value, origin, customs regime and associated duties. It is one of the largest EDIFACT messages.

This page focuses on the structure published by UN/CEFACT for directory D.05A. The segments listed, their status (M / C), position and repetition factor are extracted from the official file cusdec_c.htm hosted on service.unece.org.

Segment structure

The CUSDEC D.05A message has 40 header entries, 153 detail entries and 10 summary entries (segments and groups combined). Groups are shown in bold and their members are indented by actual nesting depth.

Pos.TagNameSRep.
0010UNHMessage headerM1
0020BGMBeginning of messageM1
0030CSTCustoms status of goodsC1
0040LOCPlace/location identificationC×99
0050DTMDate/time/periodC×15
0060GEIProcessing informationC×25
0070FIIFinancial institution informationC1
0080MEAMeasurementsC×5
0090EQDEquipment detailsC×999
0100SELSeal numberC×999
0110FTXFree textC×99
0120  SG1Group (×99)C×99
0130  RFFReferenceM1
0140  DTMDate/time/periodC1
0150    SG2Group (×10)C×10
0160    PACPackageM1
0170      SG3Group (×999)C×999
0180      PCIPackage identificationM1
0190      FTXFree textC1
0200        SG4Group (×5)C×5
0210        TDTTransport informationM1
0220        TPLTransport placementC1
0230          SG5Group (×99)C×99
0240          DOCDocument/message detailsM1
0250          DTMDate/time/periodC×2
0260          LOCPlace/location identificationC1
0270            SG6Group (×99)C×99
0280            NADName and addressM1
0290            RFFReferenceC×10
0300            CTAContact informationC1
0310            COMCommunication contactC×5
0320              SG7Group (×1)C1
0330              TODTerms of delivery or transportM1
0340              LOCPlace/location identificationC×2
0350              FTXFree textC1
0360                SG8Group (×25)C×25
0370                MOAMonetary amountM1
0380                  SG9Group (×1)C1
0390                  CUXCurrenciesM1
0400                  DTMDate/time/periodC1

Detail

Pos.TagNameSRep.
0410UNSSection controlM1
0420  SG10Group (×999)C×999
0430  DMSDocument/message summaryM1
0440  DTMDate/time/periodC1
0450  MEAMeasurementsC×5
0460    SG11Group (×25)C×25
0470    MOAMonetary amountM1
0480      SG12Group (×1)C1
0490      CUXCurrenciesM1
0500      DTMDate/time/periodC1
0510        SG13Group (×1)C1
0520        TODTerms of delivery or transportM1
0530        LOCPlace/location identificationC×2
0540        FTXFree textC1
0550          SG14Group (×10)C×10
0560          NADName and addressM1
0570            SG15Group (×10)C×10
0580            DOCDocument/message detailsM1
0590            DTMDate/time/periodC×2
0600            LOCPlace/location identificationC1
0610              SG16Group (×10)C×10
0620              PACPackageM1
0630                SG17Group (×999)C×999
0640                PCIPackage identificationM1
0650                FTXFree textC1
0660                RFFReferenceC1
0670                  SG18Group (×5)C×5
0680                  PYTPayment termsM1
0690                  MOAMonetary amountC1
0700                  PCDPercentage detailsC1
0710                  FTXFree textC1
0720                    SG19Group (×10)C×10
0730                    ALCAllowance or chargeM1
0740                    RTERate detailsC1
0750                    MOAMonetary amountC1
0760                    PCDPercentage detailsC1
0770                    QTYQuantityC1
0780                      SG20Group (×1)C1
0790                      CUXCurrenciesM1
0800                      DTMDate/time/periodC1
0810                        SG21Group (×9999)C×9999
0820                        LINLine itemM1
0830                        PIAAdditional product idC1
0840                        QTYQuantityC1
0850                        PRIPrice detailsC×2
0860                        PCDPercentage detailsC1
0870                        MEAMeasurementsC×15
0880                        QVRQuantity variancesC×5
0890                        MOAMonetary amountC×15
0900                        NADName and addressC×10
0910                        GIRRelated identification numbersC×9999
0920                        GEIProcessing informationC×99
0930                        LOCPlace/location identificationC1
0940                          SG22Group (×10)C×10
0950                          DOCDocument/message detailsM1
0960                          DTMDate/time/periodC×2
0970                            SG23Group (×10)C×10
0980                            ALCAllowance or chargeM1
0990                            RTERate detailsC1
1000                            MOAMonetary amountC1
1010                            PCDPercentage detailsC1
1020                            QTYQuantityC1
1030                              SG24Group (×1)C1
1040                              CUXCurrenciesM1
1050                              DTMDate/time/periodC1
1060                                SG25Group (×1)C1
1070                                TODTerms of delivery or transportM1
1080                                LOCPlace/location identificationC×2
1090                                  SG26Group (×5)C×5
1100                                  PYTPayment termsM1
1110                                  MOAMonetary amountC1
1120                                  PCDPercentage detailsC1
1130                                  FTXFree textC1
1140                                    SG27Group (×5)C×5
1150                                    IMDItem descriptionM1
1160                                    FTXFree textC1
1170                                      SG28Group (×10)C×10
1180                                      PACPackageM1
1190                                        SG29Group (×999)C×999
1200                                        PCIPackage identificationM1
1210                                        FTXFree textC1
1220                                        RFFReferenceC1
1230                                          SG30Group (×99999)C×99999
1240                                          CSTCustoms status of goodsM1
1250                                          FTXFree textC×9
1260                                          LOCPlace/location identificationC×25
1270                                          DTMDate/time/periodC×5
1280                                          MEAMeasurementsC×20
1290                                          NADName and addressC×5
1300                                          TDTTransport informationC×9
1310                                            SG31Group (×10)C×10
1320                                            PACPackageM1
1330                                              SG32Group (×999)C×999
1340                                              PCIPackage identificationM1
1350                                              FTXFree textC1
1360                                                SG33Group (×25)C×25
1370                                                MOAMonetary amountM1
1380                                                  SG34Group (×1)C1
1390                                                  CUXCurrenciesM1
1400                                                  DTMDate/time/periodC1
1410                                                    SG35Group (×999)C×999
1420                                                    RFFReferenceM1
1430                                                    DTMDate/time/periodC1
1440                                                    GINGoods identity numberC×99
1450                                                    MOAMonetary amountC1
1460                                                      SG36Group (×1)C1
1470                                                      IMDItem descriptionM1
1480                                                      FTXFree textC×5
1490                                                        SG37Group (×25)C×25
1500                                                        DOCDocument/message detailsM1
1510                                                        DTMDate/time/periodC×2
1520                                                        LOCPlace/location identificationC1
1530                                                        NADName and addressC×5
1540                                                          SG38Group (×1)C1
1550                                                          TODTerms of delivery or transportM1
1560                                                          LOCPlace/location identificationC×2
1570                                                          FTXFree textC1
1580                                                            SG39Group (×1)C1
1590                                                            GDSNature of cargoM1
1600                                                            FTXFree textC1
1610                                                              SG40Group (×25)C×25
1620                                                              GEIProcessing informationM1
1630                                                              PCDPercentage detailsC1
1640                                                              DTMDate/time/periodC1
1650                                                              RFFReferenceC1
1660                                                                SG41Group (×10)C×10
1670                                                                TAXDuty/tax/fee detailsM1
1680                                                                MOAMonetary amountC×2
1690                                                                GEIProcessing informationC1
1700                                                                  SG42Group (×1)C1
1710                                                                  QVRQuantity variancesM1
1720                                                                  QTYQuantityC1
1730                                                                    SG43Group (×1)C1
1740                                                                    RFFReferenceM1
1750                                                                    DTMDate/time/periodC1
1760                                                                      SG44Group (×50)C×50
1770                                                                      GIRRelated identification numbersM1
1780                                                                      GEIProcessing informationC×10
1790                                                                      NADName and addressC1
1800                                                                      MEAMeasurementsC×5
1810                                                                        SG45Group (×10)C×10
1820                                                                        MOAMonetary amountM1
1830                                                                          SG46Group (×1)C1
1840                                                                          CUXCurrenciesM1
1850                                                                          DTMDate/time/periodC1
1860                                                                            SG47Group (×10)C×10
1870                                                                            TAXDuty/tax/fee detailsM1
1880                                                                            MOAMonetary amountC×2
1890                                                                            GEIProcessing informationC1
1900                                                                              SG48Group (×5)C×5
1910                                                                              DOCDocument/message detailsM1
1920                                                                              DTMDate/time/periodC×2
1930                                                                              LOCPlace/location identificationC1

Summary

Pos.TagNameSRep.
1940UNSSection controlM1
1950CNTControl totalC×5
1960  SG49Group (×50)C×50
1970  TAXDuty/tax/fee detailsM1
1980  MOAMonetary amountC×2
1990  GEIProcessing informationC1
2000    SG50Group (×1)C1
2010    AUTAuthentication resultM1
2020    DTMDate/time/periodC1
2030UNTMessage trailerM1

Changes vs D.96A

Top-level differences between D.96A and D.05A for the CUSDEC message (segments directly inside header / detail / summary, ignoring nested groups). The comparison is indicative: a given tag may have evolved inside nested groups without showing up in this synthesis.

Segments added vs D.96A

  • GEI in the header section (status C, repeat ×25) — not present at the top of the corresponding D.96A section.
  • PYT in the detail section (status M, repeat ×1) — not present at the top of the corresponding D.96A section.
  • GEI in the detail section (status C, repeat ×99) — not present at the top of the corresponding D.96A section.
  • GEI in the summary section (status C, repeat ×1) — not present at the top of the corresponding D.96A section.

Segments removed vs D.96A

  • GIS in the header section — present in D.96A but missing in D.05A at the same level.
  • PAT in the detail section — present in D.96A but missing in D.05A at the same level.
  • GIS in the detail section — present in D.96A but missing in D.05A at the same level.
  • GIS in the summary section — present in D.96A but missing in D.05A at the same level.

Max-repeat changes

  • FTX (header): repeat ×1 in D.96A → ×99 in D.05A.

Structural example

Minimal example of an CUSDEC D.05A message with mandatory segments only. The goal is to show the exact version declared in UNH (CUSDEC:D:05A:UN) — not to replicate a full business case (see the CUSDEC D.96A page for an annotated example).

edifact cusdec-d05a-example.edi
UNB+UNOC:3+5410000000123:14+5410000000456:14+260514:1430+CTRL005001'
UNH+1+CUSDEC:D:05A:UN'
BGM+929+CUSDEC-2026-7811+9'
DTM+137:20260514:102'
NAD+CZ+5410000000123::9'
NAD+EX+5410000000456::9'
CST+1+850430:NCM:FR'
MOA+38:42500.00:EUR'
LOC+27+FR::ISO'
LOC+28+CN::ISO'
UNT+9+1'
UNZ+1+CTRL005001'

Common errors

  • Misaligned UNH tokens — The UNH+...+CUSDEC:D:05A:UN token must reflect exactly the directory in use — a mismatch between the UNH release and the release agreed with the partner is rejected by every strict validator.
  • Wrong UNT segment count — The value after UNT+ must include UNH and UNT themselves. By far the most common sender-side error, regardless of the directory in use.
  • Stale code lists — Between D.96A and D.05A, several code lists received new qualifiers (DTM status, RFF qualifier, NAD codes…). Reusing an older directory’s code tables triggers warnings or even rejections depending on the partner’s strict-conformance mode.

Other versions of this message available on ediverse.io: CUSDEC D.96A, CUSDEC D.01B, CUSDEC D.10A, CUSDEC D.16B, CUSDEC D.21B, CUSDEC D.24A, CUSDEC D.97A, CUSDEC D.99B, CUSDEC D.00B, CUSDEC D.02B, CUSDEC D.08A, CUSDEC D.13B, CUSDEC D.18B, CUSDEC D.20B.

X12 functional equivalent: X12 309.

← All EDIFACT versions