Skip to main content

Developers · Schemas

Schemas and the CN 23 field map

One JSON Schema for postal items. It follows the CN 22 and CN 23 customs declaration, which the UPU ITMATT message carries in electronic form.

Downloads

JSON Schema draft 2020-12. Use the SHA-256 value to check your copy.

JSON Schema 2020-12

postal-items.v1.json

Batch, dispatch, item and contents.

SHA-256:
ddfdad6b61137e8e68298b39716200a95c2a577914c9bae8bca4b74b59d87884
Size:
8,237 B
Download

Example

postal-items.v1.example.json

One dispatch with one item. It passes the schema.

SHA-256:
02cf9af6f851f2b89d658b9fe4cf82bdd2270f1739ef89b3e9b081ed783bec4a
Size:
1,179 B
Download

OpenAPI 3.1Planned

postal-api.v1.yaml

The API description, published with the sandbox.

CN 23 content, Allied field and ACE record

Postal items carry no master or house air waybill. The S10 item identifier plays that role (WCO-UPU Guidelines on Exchange of Electronic Advance Data, 2025).
CN 23 content, Allied field and ACE record
CN 22 / CN 23 contentAllied fieldACE, entry type 13
S10 item identifieritem_idSE15 bill (air: SFP + S10, issuer blank; truck, rail, ocean: issuer SFP); AE 23-record type M
SendersenderSE30 name and SE35 address (mandatory)
AddresseeaddresseeSE30 consignee by name and address; Final Delivered To party
Category of itemnature_code (UPU code list 136)Screening input
Quantity and detailed descriptioncontents[].description, quantitySE40 commercial description (mandatory)
Net weightcontents[].net_weight_kgQuantity and weight when a specific duty rate applies
Valuecontents[].value, currencySE60 line value (mandatory); $2,500 limit (code 323)
HS tariff numbercontents[].hs_code10-digit HTSUS number and Chapter 99 numbers (SE60), assigned by Allied
Country of origincontents[].origin_countryCountry of origin

Item fields

The fields of one item.
Item fields
FieldTypeRequiredRule
item_idstringYesUPU S10: 2 letters, 8 digits, check digit, 2 letters.
nature_codeintegerYesUPU code list 136.
senderobjectYesName and address (line 1, city, country).
addresseeobjectYesName and U.S. address with a 5-digit ZIP code.
contents[]arrayYes1 to 99 lines.
contents[].descriptionstringYes3 to 200 characters, specific enough to classify.
contents[].quantityintegerYes1 or more.
contents[].net_weight_kgnumberYesMore than 0.
contents[].valuestringYesDecimal with 2 places, for example 45.00.
contents[].hs_codestringYes6 to 10 digits.
contents[].origin_countrystringYesISO 3166-1 alpha-2 country code.
currencystringYesISO 4217 currency code.
gross_weight_kgnumberYesMore than 0.
postage_paid, insurancestringNoDecimal with 2 places.
receptacle_idstringNoUPU S9 identifier of the bag that holds the item.

Item nature codes

UPU code list 136.
Item nature codes
CodeMeaning
11Sale of goods
111Commercial sale of goods (business to business)
21Returned goods
31Gift
32Commercial sample
91Documents
999Other

Example batch

The file postal-items.v1.example.json.
postal-items.v1.example.json
{  "batch_ref": "POST-DISPATCH-2026-10-01-A",  "sent_at": "2026-10-01T09:30:00Z",  "dispatch": {    "dispatch_id": "DISPATCH-0001",    "mode": "AIR",    "carrier": "EXAMPLE AIRLINE",    "flight_or_trip": "XX123",    "us_port_code": "4701",    "expected_arrival_date": "2026-10-02"  },  "items": [    {      "item_id": "CP123456785CA",      "nature_code": 11,      "sender": {        "name": "EXAMPLE SHOP LTD",        "address": {          "line1": "100 EXAMPLE ST",          "city": "TORONTO",          "region": "ON",          "postal_code": "M5V1A1",          "country": "CA"        }      },      "addressee": {        "name": "JANE SAMPLE",        "address": {          "line1": "100 MAIN ST",          "city": "NEWARK",          "state": "NJ",          "zip5": "07102"        }      },      "contents": [        {          "description": "WOMEN'S KNITTED COTTON SWEATER",          "quantity": 1,          "net_weight_kg": 0.4,          "value": "45.00",          "hs_code": "611020",          "origin_country": "CA"        }      ],      "currency": "CAD",      "gross_weight_kg": 0.5,      "postage_paid": "18.50"    }  ]}

Start with a data test

Send us a sample dispatch in JSON, CSV or Excel. We report each gap in the data before the first entry. Quote on request.

Call (908) 291-8001 or email mail@alliedchb.com