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.18B

CUSDEC — EDIFACT Customs Declaration Message (D.18B)

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.18B.

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.18B. 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.18B message has 47 header entries, 160 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.
00010UNHMessage headerM1
00020BGMBeginning of messageM1
00030CSTCustoms status of goodsC1
00040LOCPlace/location identificationC×99
00050DTMDate/time/periodC×15
00060GEIProcessing informationC×25
00070FIIFinancial institution informationC1
00080MEAMeasurementsC×5
00090EQDEquipment detailsC×999
00100SELSeal numberC×999
00110FTXFree textC×99
00120  SG1Group (×99)C×99
00130  RFFReferenceM1
00140  DTMDate/time/periodC1
00150    SG2Group (×10)C×10
00160    PACPackageM1
00170      SG3Group (×999)C×999
00180      PCIPackage identificationM1
00190      FTXFree textC1
00200        SG4Group (×5)C×5
00210        TDTTransport informationM1
00220        TPLTransport placementC1
00230          SG5Group (×99)C×99
00240          DOCDocument/message detailsM1
00250          DTMDate/time/periodC×2
00260          LOCPlace/location identificationC1
00270            SG6Group (×99)C×99
00280            NADName and addressM1
00290            RFFReferenceC×10
00300            CTAContact informationC1
00310            COMCommunication contactC×5
00320              SG7Group (×1)C1
00330              TODTerms of delivery or transportM1
00340              LOCPlace/location identificationC×2
00350              FTXFree textC1
00360                SG8Group (×25)C×25
00370                MOAMonetary amountM1
00380                  SG9Group (×1)C1
00390                  CUXCurrenciesM1
00400                  DTMDate/time/periodC1
00410                    SG10Group (×99)C×99
00420                    EFIExternal file link identificationM1
00430                    CEDComputer environment detailsC×99
00440                    COMCommunication contactC×9
00450                    RFFReferenceC×9
00460                    DTMDate/time/periodC×9
00470                    QTYQuantityC×9

Detail

Pos.TagNameSRep.
00480UNSSection controlM1
00490  SG11Group (×999)C×999
00500  DMSDocument/message summaryM1
00510  DTMDate/time/periodC1
00520  MEAMeasurementsC×5
00530    SG12Group (×25)C×25
00540    MOAMonetary amountM1
00550      SG13Group (×1)C1
00560      CUXCurrenciesM1
00570      DTMDate/time/periodC1
00580        SG14Group (×1)C1
00590        TODTerms of delivery or transportM1
00600        LOCPlace/location identificationC×2
00610        FTXFree textC1
00620          SG15Group (×10)C×10
00630          NADName and addressM1
00640            SG16Group (×10)C×10
00650            DOCDocument/message detailsM1
00660            DTMDate/time/periodC×2
00670            LOCPlace/location identificationC1
00680              SG17Group (×10)C×10
00690              PACPackageM1
00700                SG18Group (×999)C×999
00710                PCIPackage identificationM1
00720                FTXFree textC1
00730                RFFReferenceC1
00740                  SG19Group (×5)C×5
00750                  PYTPayment termsM1
00760                  MOAMonetary amountC1
00770                  PCDPercentage detailsC1
00780                  FTXFree textC1
00790                    SG20Group (×10)C×10
00800                    ALCAllowance or chargeM1
00810                    RTERate detailsC1
00820                    MOAMonetary amountC1
00830                    PCDPercentage detailsC1
00840                    QTYQuantityC1
00850                      SG21Group (×1)C1
00860                      CUXCurrenciesM1
00870                      DTMDate/time/periodC1
00880                        SG22Group (×9999)C×9999
00890                        LINLine itemM1
00900                        PIAAdditional product idC1
00910                        QTYQuantityC1
00920                        PRIPrice detailsC×2
00930                        PCDPercentage detailsC1
00940                        MEAMeasurementsC×15
00950                        QVRQuantity variancesC×5
00960                        MOAMonetary amountC×15
00970                        NADName and addressC×10
00980                        GIRRelated identification numbersC×9999
00990                        GEIProcessing informationC×99
01000                        LOCPlace/location identificationC1
01010                          SG23Group (×10)C×10
01020                          DOCDocument/message detailsM1
01030                          DTMDate/time/periodC×2
01040                            SG24Group (×10)C×10
01050                            ALCAllowance or chargeM1
01060                            RTERate detailsC1
01070                            MOAMonetary amountC1
01080                            PCDPercentage detailsC1
01090                            QTYQuantityC1
01100                              SG25Group (×1)C1
01110                              CUXCurrenciesM1
01120                              DTMDate/time/periodC1
01130                                SG26Group (×1)C1
01140                                TODTerms of delivery or transportM1
01150                                LOCPlace/location identificationC×2
01160                                  SG27Group (×5)C×5
01170                                  PYTPayment termsM1
01180                                  MOAMonetary amountC1
01190                                  PCDPercentage detailsC1
01200                                  FTXFree textC1
01210                                    SG28Group (×99)C×99
01220                                    IMDItem descriptionM1
01230                                    FTXFree textC1
01240                                      SG29Group (×10)C×10
01250                                      PACPackageM1
01260                                        SG30Group (×999)C×999
01270                                        PCIPackage identificationM1
01280                                        FTXFree textC1
01290                                        RFFReferenceC1
01300                                          SG31Group (×99)C×99
01310                                          EFIExternal file link identificationM1
01320                                          CEDComputer environment detailsC×99
01330                                          COMCommunication contactC×9
01340                                          RFFReferenceC×9
01350                                          DTMDate/time/periodC×9
01360                                          QTYQuantityC×9
01370                                            SG32Group (×99999)C×99999
01380                                            CSTCustoms status of goodsM1
01390                                            FTXFree textC×9
01400                                            LOCPlace/location identificationC×25
01410                                            DTMDate/time/periodC×5
01420                                            MEAMeasurementsC×20
01430                                            NADName and addressC×5
01440                                            TDTTransport informationC×9
01450                                              SG33Group (×10)C×10
01460                                              PACPackageM1
01470                                                SG34Group (×999)C×999
01480                                                PCIPackage identificationM1
01490                                                FTXFree textC1
01500                                                  SG35Group (×25)C×25
01510                                                  MOAMonetary amountM1
01520                                                    SG36Group (×1)C1
01530                                                    CUXCurrenciesM1
01540                                                    DTMDate/time/periodC1
01550                                                      SG37Group (×999)C×999
01560                                                      RFFReferenceM1
01570                                                      DTMDate/time/periodC1
01580                                                      GINGoods identity numberC×99
01590                                                      MOAMonetary amountC1
01600                                                        SG38Group (×1)C1
01610                                                        IMDItem descriptionM1
01620                                                        FTXFree textC×5
01630                                                          SG39Group (×25)C×25
01640                                                          DOCDocument/message detailsM1
01650                                                          DTMDate/time/periodC×2
01660                                                          LOCPlace/location identificationC1
01670                                                          NADName and addressC×5
01680                                                            SG40Group (×1)C1
01690                                                            TODTerms of delivery or transportM1
01700                                                            LOCPlace/location identificationC×2
01710                                                            FTXFree textC1
01720                                                              SG41Group (×1)C1
01730                                                              GDSNature of cargoM1
01740                                                              FTXFree textC1
01750                                                                SG42Group (×25)C×25
01760                                                                GEIProcessing informationM1
01770                                                                PCDPercentage detailsC1
01780                                                                DTMDate/time/periodC1
01790                                                                RFFReferenceC1
01800                                                                  SG43Group (×10)C×10
01810                                                                  TAXDuty/tax/fee detailsM1
01820                                                                  MOAMonetary amountC×2
01830                                                                  GEIProcessing informationC1
01840                                                                    SG44Group (×1)C1
01850                                                                    QVRQuantity variancesM1
01860                                                                    QTYQuantityC1
01870                                                                      SG45Group (×1)C1
01880                                                                      RFFReferenceM1
01890                                                                      DTMDate/time/periodC1
01900                                                                        SG46Group (×50)C×50
01910                                                                        GIRRelated identification numbersM1
01920                                                                        GEIProcessing informationC×10
01930                                                                        NADName and addressC1
01940                                                                        MEAMeasurementsC×5
01950                                                                          SG47Group (×10)C×10
01960                                                                          MOAMonetary amountM1
01970                                                                            SG48Group (×1)C1
01980                                                                            CUXCurrenciesM1
01990                                                                            DTMDate/time/periodC1
02000                                                                              SG49Group (×10)C×10
02010                                                                              TAXDuty/tax/fee detailsM1
02020                                                                              MOAMonetary amountC×2
02030                                                                              GEIProcessing informationC1
02040                                                                                SG50Group (×5)C×5
02050                                                                                DOCDocument/message detailsM1
02060                                                                                DTMDate/time/periodC×2
02070                                                                                LOCPlace/location identificationC1

Summary

Pos.TagNameSRep.
02080UNSSection controlM1
02090CNTControl totalC×5
02100  SG51Group (×50)C×50
02110  TAXDuty/tax/fee detailsM1
02120  MOAMonetary amountC×2
02130  GEIProcessing informationC1
02140    SG52Group (×1)C1
02150    AUTAuthentication resultM1
02160    DTMDate/time/periodC1
02170UNTMessage trailerM1

Changes vs D.96A

Top-level differences between D.96A and D.18B 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.
  • EFI in the header section (status M, repeat ×1) — not present at the top of the corresponding D.96A section.
  • CED in the header section (status C, repeat ×99) — not present at the top of the corresponding D.96A section.
  • QTY in the header section (status C, repeat ×9) — 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.
  • EFI in the detail section (status M, repeat ×1) — not present at the top of the corresponding D.96A section.
  • CED in the detail section (status C, repeat ×99) — not present at the top of the corresponding D.96A section.
  • COM in the detail section (status C, repeat ×9) — 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.18B at the same level.
  • PAT in the detail section — present in D.96A but missing in D.18B at the same level.
  • GIS in the detail section — present in D.96A but missing in D.18B at the same level.
  • GIS in the summary section — present in D.96A but missing in D.18B at the same level.

Max-repeat changes

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

Structural example

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

edifact cusdec-d18b-example.edi
UNB+UNOC:3+5410000000123:14+5410000000456:14+260514:1430+CTRL018001'
UNH+1+CUSDEC:D:18B: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+CTRL018001'

Common errors

  • Misaligned UNH tokens — The UNH+...+CUSDEC:D:18B: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.18B, 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.05A, CUSDEC D.08A, CUSDEC D.13B, CUSDEC D.20B.

X12 functional equivalent: X12 309.

← All EDIFACT versions