CUSDEC — EDIFACT Customs Declaration Message (D.13B)
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.13B.
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.13B. 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.13B 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.
Header
| Pos. | Tag | Name | S | Rep. |
|---|---|---|---|---|
00010 | UNH | Message header | M | 1 |
00020 | BGM | Beginning of message | M | 1 |
00030 | CST | Customs status of goods | C | 1 |
00040 | LOC | Place/location identification | C | ×99 |
00050 | DTM | Date/time/period | C | ×15 |
00060 | GEI | Processing information | C | ×25 |
00070 | FII | Financial institution information | C | 1 |
00080 | MEA | Measurements | C | ×5 |
00090 | EQD | Equipment details | C | ×999 |
00100 | SEL | Seal number | C | ×999 |
00110 | FTX | Free text | C | ×99 |
00120 | SG1 | Group (×99) | C | ×99 |
00130 | RFF | Reference | M | 1 |
00140 | DTM | Date/time/period | C | 1 |
00150 | SG2 | Group (×10) | C | ×10 |
00160 | PAC | Package | M | 1 |
00170 | SG3 | Group (×999) | C | ×999 |
00180 | PCI | Package identification | M | 1 |
00190 | FTX | Free text | C | 1 |
00200 | SG4 | Group (×5) | C | ×5 |
00210 | TDT | Transport information | M | 1 |
00220 | TPL | Transport placement | C | 1 |
00230 | SG5 | Group (×99) | C | ×99 |
00240 | DOC | Document/message details | M | 1 |
00250 | DTM | Date/time/period | C | ×2 |
00260 | LOC | Place/location identification | C | 1 |
00270 | SG6 | Group (×99) | C | ×99 |
00280 | NAD | Name and address | M | 1 |
00290 | RFF | Reference | C | ×10 |
00300 | CTA | Contact information | C | 1 |
00310 | COM | Communication contact | C | ×5 |
00320 | SG7 | Group (×1) | C | 1 |
00330 | TOD | Terms of delivery or transport | M | 1 |
00340 | LOC | Place/location identification | C | ×2 |
00350 | FTX | Free text | C | 1 |
00360 | SG8 | Group (×25) | C | ×25 |
00370 | MOA | Monetary amount | M | 1 |
00380 | SG9 | Group (×1) | C | 1 |
00390 | CUX | Currencies | M | 1 |
00400 | DTM | Date/time/period | C | 1 |
00410 | SG10 | Group (×99) | C | ×99 |
00420 | EFI | External file link identification | M | 1 |
00430 | CED | Computer environment details | C | ×99 |
00440 | COM | Communication contact | C | ×9 |
00450 | RFF | Reference | C | ×9 |
00460 | DTM | Date/time/period | C | ×9 |
00470 | QTY | Quantity | C | ×9 |
Detail
| Pos. | Tag | Name | S | Rep. |
|---|---|---|---|---|
00480 | UNS | Section control | M | 1 |
00490 | SG11 | Group (×999) | C | ×999 |
00500 | DMS | Document/message summary | M | 1 |
00510 | DTM | Date/time/period | C | 1 |
00520 | MEA | Measurements | C | ×5 |
00530 | SG12 | Group (×25) | C | ×25 |
00540 | MOA | Monetary amount | M | 1 |
00550 | SG13 | Group (×1) | C | 1 |
00560 | CUX | Currencies | M | 1 |
00570 | DTM | Date/time/period | C | 1 |
00580 | SG14 | Group (×1) | C | 1 |
00590 | TOD | Terms of delivery or transport | M | 1 |
00600 | LOC | Place/location identification | C | ×2 |
00610 | FTX | Free text | C | 1 |
00620 | SG15 | Group (×10) | C | ×10 |
00630 | NAD | Name and address | M | 1 |
00640 | SG16 | Group (×10) | C | ×10 |
00650 | DOC | Document/message details | M | 1 |
00660 | DTM | Date/time/period | C | ×2 |
00670 | LOC | Place/location identification | C | 1 |
00680 | SG17 | Group (×10) | C | ×10 |
00690 | PAC | Package | M | 1 |
00700 | SG18 | Group (×999) | C | ×999 |
00710 | PCI | Package identification | M | 1 |
00720 | FTX | Free text | C | 1 |
00730 | RFF | Reference | C | 1 |
00740 | SG19 | Group (×5) | C | ×5 |
00750 | PYT | Payment terms | M | 1 |
00760 | MOA | Monetary amount | C | 1 |
00770 | PCD | Percentage details | C | 1 |
00780 | FTX | Free text | C | 1 |
00790 | SG20 | Group (×10) | C | ×10 |
00800 | ALC | Allowance or charge | M | 1 |
00810 | RTE | Rate details | C | 1 |
00820 | MOA | Monetary amount | C | 1 |
00830 | PCD | Percentage details | C | 1 |
00840 | QTY | Quantity | C | 1 |
00850 | SG21 | Group (×1) | C | 1 |
00860 | CUX | Currencies | M | 1 |
00870 | DTM | Date/time/period | C | 1 |
00880 | SG22 | Group (×9999) | C | ×9999 |
00890 | LIN | Line item | M | 1 |
00900 | PIA | Additional product id | C | 1 |
00910 | QTY | Quantity | C | 1 |
00920 | PRI | Price details | C | ×2 |
00930 | PCD | Percentage details | C | 1 |
00940 | MEA | Measurements | C | ×15 |
00950 | QVR | Quantity variances | C | ×5 |
00960 | MOA | Monetary amount | C | ×15 |
00970 | NAD | Name and address | C | ×10 |
00980 | GIR | Related identification numbers | C | ×9999 |
00990 | GEI | Processing information | C | ×99 |
01000 | LOC | Place/location identification | C | 1 |
01010 | SG23 | Group (×10) | C | ×10 |
01020 | DOC | Document/message details | M | 1 |
01030 | DTM | Date/time/period | C | ×2 |
01040 | SG24 | Group (×10) | C | ×10 |
01050 | ALC | Allowance or charge | M | 1 |
01060 | RTE | Rate details | C | 1 |
01070 | MOA | Monetary amount | C | 1 |
01080 | PCD | Percentage details | C | 1 |
01090 | QTY | Quantity | C | 1 |
01100 | SG25 | Group (×1) | C | 1 |
01110 | CUX | Currencies | M | 1 |
01120 | DTM | Date/time/period | C | 1 |
01130 | SG26 | Group (×1) | C | 1 |
01140 | TOD | Terms of delivery or transport | M | 1 |
01150 | LOC | Place/location identification | C | ×2 |
01160 | SG27 | Group (×5) | C | ×5 |
01170 | PYT | Payment terms | M | 1 |
01180 | MOA | Monetary amount | C | 1 |
01190 | PCD | Percentage details | C | 1 |
01200 | FTX | Free text | C | 1 |
01210 | SG28 | Group (×99) | C | ×99 |
01220 | IMD | Item description | M | 1 |
01230 | FTX | Free text | C | 1 |
01240 | SG29 | Group (×10) | C | ×10 |
01250 | PAC | Package | M | 1 |
01260 | SG30 | Group (×999) | C | ×999 |
01270 | PCI | Package identification | M | 1 |
01280 | FTX | Free text | C | 1 |
01290 | RFF | Reference | C | 1 |
01300 | SG31 | Group (×99) | C | ×99 |
01310 | EFI | External file link identification | M | 1 |
01320 | CED | Computer environment details | C | ×99 |
01330 | COM | Communication contact | C | ×9 |
01340 | RFF | Reference | C | ×9 |
01350 | DTM | Date/time/period | C | ×9 |
01360 | QTY | Quantity | C | ×9 |
01370 | SG32 | Group (×99999) | C | ×99999 |
01380 | CST | Customs status of goods | M | 1 |
01390 | FTX | Free text | C | ×9 |
01400 | LOC | Place/location identification | C | ×25 |
01410 | DTM | Date/time/period | C | ×5 |
01420 | MEA | Measurements | C | ×20 |
01430 | NAD | Name and address | C | ×5 |
01440 | TDT | Transport information | C | ×9 |
01450 | SG33 | Group (×10) | C | ×10 |
01460 | PAC | Package | M | 1 |
01470 | SG34 | Group (×999) | C | ×999 |
01480 | PCI | Package identification | M | 1 |
01490 | FTX | Free text | C | 1 |
01500 | SG35 | Group (×25) | C | ×25 |
01510 | MOA | Monetary amount | M | 1 |
01520 | SG36 | Group (×1) | C | 1 |
01530 | CUX | Currencies | M | 1 |
01540 | DTM | Date/time/period | C | 1 |
01550 | SG37 | Group (×999) | C | ×999 |
01560 | RFF | Reference | M | 1 |
01570 | DTM | Date/time/period | C | 1 |
01580 | GIN | Goods identity number | C | ×99 |
01590 | MOA | Monetary amount | C | 1 |
01600 | SG38 | Group (×1) | C | 1 |
01610 | IMD | Item description | M | 1 |
01620 | FTX | Free text | C | ×5 |
01630 | SG39 | Group (×25) | C | ×25 |
01640 | DOC | Document/message details | M | 1 |
01650 | DTM | Date/time/period | C | ×2 |
01660 | LOC | Place/location identification | C | 1 |
01670 | NAD | Name and address | C | ×5 |
01680 | SG40 | Group (×1) | C | 1 |
01690 | TOD | Terms of delivery or transport | M | 1 |
01700 | LOC | Place/location identification | C | ×2 |
01710 | FTX | Free text | C | 1 |
01720 | SG41 | Group (×1) | C | 1 |
01730 | GDS | Nature of cargo | M | 1 |
01740 | FTX | Free text | C | 1 |
01750 | SG42 | Group (×25) | C | ×25 |
01760 | GEI | Processing information | M | 1 |
01770 | PCD | Percentage details | C | 1 |
01780 | DTM | Date/time/period | C | 1 |
01790 | RFF | Reference | C | 1 |
01800 | SG43 | Group (×10) | C | ×10 |
01810 | TAX | Duty/tax/fee details | M | 1 |
01820 | MOA | Monetary amount | C | ×2 |
01830 | GEI | Processing information | C | 1 |
01840 | SG44 | Group (×1) | C | 1 |
01850 | QVR | Quantity variances | M | 1 |
01860 | QTY | Quantity | C | 1 |
01870 | SG45 | Group (×1) | C | 1 |
01880 | RFF | Reference | M | 1 |
01890 | DTM | Date/time/period | C | 1 |
01900 | SG46 | Group (×50) | C | ×50 |
01910 | GIR | Related identification numbers | M | 1 |
01920 | GEI | Processing information | C | ×10 |
01930 | NAD | Name and address | C | 1 |
01940 | MEA | Measurements | C | ×5 |
01950 | SG47 | Group (×10) | C | ×10 |
01960 | MOA | Monetary amount | M | 1 |
01970 | SG48 | Group (×1) | C | 1 |
01980 | CUX | Currencies | M | 1 |
01990 | DTM | Date/time/period | C | 1 |
02000 | SG49 | Group (×10) | C | ×10 |
02010 | TAX | Duty/tax/fee details | M | 1 |
02020 | MOA | Monetary amount | C | ×2 |
02030 | GEI | Processing information | C | 1 |
02040 | SG50 | Group (×5) | C | ×5 |
02050 | DOC | Document/message details | M | 1 |
02060 | DTM | Date/time/period | C | ×2 |
02070 | LOC | Place/location identification | C | 1 |
Summary
| Pos. | Tag | Name | S | Rep. |
|---|---|---|---|---|
02080 | UNS | Section control | M | 1 |
02090 | CNT | Control total | C | ×5 |
02100 | SG51 | Group (×50) | C | ×50 |
02110 | TAX | Duty/tax/fee details | M | 1 |
02120 | MOA | Monetary amount | C | ×2 |
02130 | GEI | Processing information | C | 1 |
02140 | SG52 | Group (×1) | C | 1 |
02150 | AUT | Authentication result | M | 1 |
02160 | DTM | Date/time/period | C | 1 |
02170 | UNT | Message trailer | M | 1 |
Changes vs D.96A
Top-level differences between D.96A and D.13B 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
GEIin the header section (status C, repeat ×25) — not present at the top of the corresponding D.96A section.EFIin the header section (status M, repeat ×1) — not present at the top of the corresponding D.96A section.CEDin the header section (status C, repeat ×99) — not present at the top of the corresponding D.96A section.QTYin the header section (status C, repeat ×9) — not present at the top of the corresponding D.96A section.PYTin the detail section (status M, repeat ×1) — not present at the top of the corresponding D.96A section.GEIin the detail section (status C, repeat ×99) — not present at the top of the corresponding D.96A section.EFIin the detail section (status M, repeat ×1) — not present at the top of the corresponding D.96A section.CEDin the detail section (status C, repeat ×99) — not present at the top of the corresponding D.96A section.COMin the detail section (status C, repeat ×9) — not present at the top of the corresponding D.96A section.GEIin the summary section (status C, repeat ×1) — not present at the top of the corresponding D.96A section.
Segments removed vs D.96A
GISin the header section — present in D.96A but missing in D.13B at the same level.PATin the detail section — present in D.96A but missing in D.13B at the same level.GISin the detail section — present in D.96A but missing in D.13B at the same level.GISin the summary section — present in D.96A but missing in D.13B at the same level.
Max-repeat changes
FTX(header): repeat ×1 in D.96A → ×99 in D.13B.
Structural example
Minimal example of an CUSDEC D.13B message with mandatory segments only. The goal is to show the exact version declared in UNH (CUSDEC:D:13B:UN) — not to replicate a full business case (see the CUSDEC D.96A page for an annotated example).
UNB+UNOC:3+5410000000123:14+5410000000456:14+260514:1430+CTRL013001'
UNH+1+CUSDEC:D:13B: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+CTRL013001' Common errors
- Misaligned UNH tokens — The
UNH+...+CUSDEC:D:13B:UNtoken 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.13B, 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.
Related messages
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.18B, CUSDEC D.20B.
X12 functional equivalent: X12 309.