DHL Express Shipping

Creates a DHL Express Shipping Label.

DHL Express Product Names

Product NameProduct Content CodeLocal Product CodeGlobal Product CodeProduct Description

Domestic Express

DOM

E

N

National express delivery of goods and documents

Domestic Express 09:00

DOK

H

I

National express delivery of goods and documents with delivery before 09:00 A.M.

Domestic Express 10:00

DOL

O

O

National express delivery of goods and documents with delivery before 10:00 A.M.

Domestic Express 12:00

DOT

L

1

National express delivery of goods and documents with delivery before 12:00 A.M.

MEDICAL EXPRESS*

CMX

B

C

National express shipment of medical contents and biological substances category B (UN 3373)

Express Worldwide (EU)

ECX

U

U

International express shipping of shipments not subject to customs duties within the EU internal market

Express Worldwide (DOC)

DOX

D

D

International express shipping of shipments not subject to customs duties outside the EU single market

Express 09:00 (DOC)

TDK

K

K

International express shipping of shipments not subject to customs duties with delivery before 09:00 A.M.

Express 10:30 (DOC)

TDL

J

L

International express shipping of shipments not subject to customs duties with delivery before 10:30 A.M. (USA only)

Express 12:00 (DOC)

TDT

T

T

International express shipping of shipments not subject to customs duties with delivery before 12:00 A.M.

DHL Express Envelope

XPD

X

X

International express shipping of shipments not subject to customs duty up to 300g

MEDICAL EXPRESS*

CMX

P

C

International express shipment of medical contents and biological substances category B (UN 3373) not subject to customs duties and subject to customs duties

Express Worldwide (NON-DOC)

WPX

S

P

International express shipping of dutiable shipments

Express 09:00 (NON-DOC)

TDE

G

E

International express delivery of dutiable shipments with delivery before 09:00 A.M.

Express 10:30 (NON-DOC)

TDM

M

M

International express shipping of dutiable shipments with delivery before 10:30 A.M. (only in the USA)

Express 12:00 (NON-DOC)

TDY

Y

Y

International express delivery of dutiable shipments with delivery before 12:00 A.M.

MEDICAL EXPRESS*

WMX

Q

Q

International express shipment of dutiable and non-dutiable medical contents and biological substances category B (UN 3373)

ECONOMY SELECT (EU)

ESU

V

W

International day-definite shipping of shipments not subject to customs duties within the EU internal market

ECONOMY SELECT (NON-DOC)

ESI

N

H

International day-definite shipping of dutiable shipments outside the EU single market

DHL Express Incoterms

CodeDesignationDescription

EXW

Ex Works

The seller must make the goods available to the buyer for collection at the seller's premises or at another designated location in a non-exportable and unloaded condition. The seller shall bear the costs.

FCA

Free Carrier

The seller must deliver the goods in exportable condition to the carrier named by the buyer at an agreed location. The seller shall bear the costs to the agreed location.

DDP

Delivered Duty Paid

The seller must deliver the goods ready for import, not yet unloaded, to the agreed destination. The seller shall bear the costs until the goods have reached their destination unloaded.

DAP

Delivered at Place

The seller is obliged to bring the goods to the named (agreed) destination and to make them available there for collection/unloading. The seller shall bear all costs incurred in transporting the goods to the destination. The buyer shall be responsible for customs formalities, including customs duties, taxes and other charges payable on importation of the goods.

Domestic Shipping

let result = await app.businessFunction({
    functionName: "DhlExpressShipping",
    methodName: "CreateShipment",
    plannedShippingDateAndTime: "2024-06-28T14:00:31GMT+01:00",
    productCode: "N",
    accounts: [
        {
            typeCode: "shipper",
            number: app.getFieldValue("cordCompanyId.shipperAccountNumber")
        }
    ],
    customerDetails: {
        shipperDetails: {
            postalAddress: {
                postalCode: app.getFieldValue("cordCompanyId.postalCode"),
                cityName: app.getFieldValue("cordCompanyId.postalCityName"),
                countryCode: app.getFieldValue("cordCompanyId.postalCountryCode"),
                addressLine1: app.getFieldValue("cordCompanyId.postalAddressLine1"),
                countryName: app.getFieldValue("cordCompanyId.postalCountryName")
            },
            contactInformation: {
                email: app.getFieldValue("cordCompanyId.email"),
                phone: app.getFieldValue("cordCompanyId.contactPhone"),
                companyName: app.getFieldValue("cordCompanyId.contactCompanyName"),
                fullName: app.getFieldValue("cordCompanyId.contactFullName"),
            }
        },
        receiverDetails: {
            postalAddress: {
                postalCode: app.getFieldValue("cordCustomerId.postalCode"),
                cityName: app.getFieldValue("cordCustomerId.postalCityName"),
                countryCode: app.getFieldValue("cordCustomerId.postalCountryCode"),
                addressLine1: app.getFieldValue("cordCustomerId.postalAddressLine1"),
                countryName: app.getFieldValue("cordCustomerId.postalCountryName")
            },
            contactInformation: {
                email: app.getFieldValue("cordCustomerId.email"),
                phone: app.getFieldValue("cordCustomerId.contactPhone"),
                companyName: app.getFieldValue("cordCustomerId.contactCompanyName"),
                fullName: app.getFieldValue("cordCustomerId.contactFullName"),
            }
        }
    },
    content: {
        packages: [
            {
                weight: app.getFieldValue("cordPackage.weight"),
                dimensions: {
                    length: app.getFieldValue("cordPackage.length"),
                    width: app.getFieldValue("cordPackage.width"),
                    height: app.getFieldValue("cordPackage.height")
                }
            }
        ],
        description: app.getFieldValue("cordPackage.description"),
        incoterm: "DAP",
        unitOfMeasurement: "metric"
    },
});
// show label in docViewer control
app.showBlob("docLabel", result.LabelData);
// print label via CloudGateway
app.cloudPrint({ printerName: "name of printer", blob: result.LabelData });

International Shipping

To create an international shipment, you must include line items and other parameters as part of the export declaration, and also choose the right product code (e.g. P). In the example below, we read line items from the database and then transform the flat array to the right structure with JavaScript's Array.map(). Then, we make sure to set isCustomsDeclarable, declaredValue, declaredValueCurrency, and finally include the exportDeclarationparameter with invoice details and line items prepared at the beginning.

// say you have an array of line items retrieved with app.sqlRead() with following structure
const lineItemsFromSql = [
    {
        number: 1,
        description: 'description 1',
        price: 20.23,
        quantity: 4,
        unitOfMeasurement: 'PCS',
        commodityCodeValue: '234234243',
        commodityCodeType: 'outbound',
        exportReasonType: 'permanent',
        manufacturerCode: "manufacturer-code-1",
        manufacturerCountry: "DE",
        weightnetValue: 10.05,
        weightGrossValue: 10.05,
    },
    {
        number: 2,
        description: 'description 2',
        price: 2095.14,
        quantity: 2,
        unitOfMeasurement: 'PCS',
        commodityCodeValue: '32423423',
        commodityCodeType: 'outbound',
        exportReasonType: 'permanent',
        manufacturerCode: "manufacturer-code-2",
        manufacturerCountry: "DE",
        weightnetValue: 20.10,
        weightGrossValue: 20.10,
    },
];
// we can transform the result from SQL into the required structure
// and use the `lineItems` array in the CreateShipment() call
const lineItems = lineItemsFromSql.map(oldItem => {
    return {
        number: oldItem.number,
        description: oldItem.description,
        price: oldItem.price,
        quantity: {
            value: oldItem.quantity,
            unitOfMeasurement: oldItem.unitOfMeasurement,
        },
        commodityCodes: [
            {
                typeCode: oldItem.commodityCodeType,
                value: oldItem.commodityCodeValue,
            },
        ],
        exportReasonType: oldItem.exportReasonType,
        manufacturerCountry: oldItem.manufacturerCountry,
        weight: {
            netValue: oldItem.weightnetValue,
            grossValue: oldItem.weightGrossValue,
        },
    };
});

let result = await app.businessFunction({
    functionName: "DhlExpressShipping",
    methodName: "CreateShipment",
    plannedShippingDateAndTime: "2024-06-28T14:00:31GMT+01:00",
    productCode: "P",
    accounts: [
        {
            typeCode: "shipper",
            number: app.getFieldValue("cordCompanyId.shipperAccountNumber")
        }
    ],
    customerDetails: {
        shipperDetails: {
            postalAddress: {
                postalCode: app.getFieldValue("cordCompanyId.postalCode"),
                cityName: app.getFieldValue("cordCompanyId.postalCityName"),
                countryCode: app.getFieldValue("cordCompanyId.postalCountryCode"),
                addressLine1: app.getFieldValue("cordCompanyId.postalAddressLine1"),
                countryName: app.getFieldValue("cordCompanyId.postalCountryName")
            },
            contactInformation: {
                email: app.getFieldValue("cordCompanyId.email"),
                phone: app.getFieldValue("cordCompanyId.contactPhone"),
                companyName: app.getFieldValue("cordCompanyId.contactCompanyName"),
                fullName: app.getFieldValue("cordCompanyId.contactFullName"),
            }
        },
        receiverDetails: {
            postalAddress: {
                postalCode: app.getFieldValue("cordCustomerId.postalCode"),
                cityName: app.getFieldValue("cordCustomerId.postalCityName"),
                countryCode: app.getFieldValue("cordCustomerId.postalCountryCode"),
                addressLine1: app.getFieldValue("cordCustomerId.postalAddressLine1"),
                countryName: app.getFieldValue("cordCustomerId.postalCountryName")
            },
            contactInformation: {
                email: app.getFieldValue("cordCustomerId.email"),
                phone: app.getFieldValue("cordCustomerId.contactPhone"),
                companyName: app.getFieldValue("cordCustomerId.contactCompanyName"),
                fullName: app.getFieldValue("cordCustomerId.contactFullName"),
            }
        }
    },
    content: {
        packages: [
            {
                weight: app.getFieldValue("cordPackage.weight"),
                dimensions: {
                    length: app.getFieldValue("cordPackage.length"),
                    width: app.getFieldValue("cordPackage.width"),
                    height: app.getFieldValue("cordPackage.height")
                }
            }
        ],
        description: app.getFieldValue("cordPackage.description"),
        incoterm: "DAP",
        unitOfMeasurement: "metric",
        isCustomsDeclarable: true,
        declaredValue: app.getFieldValue("cordPackage.declaredValue"),
        declaredValueCurrency: "EUR",
        exportDeclaration: {
            exportReasonType: "permanent",
            placeOfIncoterm: app.getFieldValue("cordCustomerId.postalCityName"),
            lineItems: lineItems,
            invoice: {
                "number": app.getFieldValue("cordPackage.invoiceNumber"),
                "date": "2024-06-28"
            }
        }
    },
});
// show label in docViewer control
app.showBlob("docLabel", result.LabelData);
// print label via CloudGateway
app.cloudPrint({ printerName: "name of printer", blob: result.LabelData });

International Shipping with Paperless Trade (PLT)

If you want to make use of PLT and, for instance, ship from Germany to Australia, you must include a commercial invoice (CIN) plus export declaration (DCL) document, which are required for automated processing. They are passed in the documentImages field. Additionally, you must extend the exportDeclaration field as follows to include customsDocuments and, if needed, additionalCharges to free-form declare extra charges. Finally, for PLT to work, you must also select the correct value added service, in this case WY.

// say you have an array of line items retrieved with app.sqlRead() with following structure
const lineItemsFromSql = [
    {
        number: 1,
        description: 'description 1',
        price: 20.23,
        quantity: 4,
        unitOfMeasurement: 'PCS',
        commodityCodeValue: '234234243',
        commodityCodeType: 'outbound',
        exportReasonType: 'permanent',
        manufacturerCode: "manufacturer-code-1",
        manufacturerCountry: "DE",
        weightnetValue: 10.05,
        weightGrossValue: 10.05,
    },
    {
        number: 2,
        description: 'description 2',
        price: 2095.14,
        quantity: 2,
        unitOfMeasurement: 'PCS',
        commodityCodeValue: '32423423',
        commodityCodeType: 'outbound',
        exportReasonType: 'permanent',
        manufacturerCode: "manufacturer-code-2",
        manufacturerCountry: "DE",
        weightnetValue: 20.10,
        weightGrossValue: 20.10,
    },
];
// we can transform the result from SQL into the required structure
// and use the `lineItems` array in the CreateShipment() call
const lineItems = lineItemsFromSql.map(oldItem => {
    return {
        number: oldItem.number,
        description: oldItem.description,
        price: oldItem.price,
        quantity: {
            value: oldItem.quantity,
            unitOfMeasurement: oldItem.unitOfMeasurement,
        },
        commodityCodes: [
            {
                typeCode: oldItem.commodityCodeType,
                value: oldItem.commodityCodeValue,
            },
        ],
        exportReasonType: oldItem.exportReasonType,
        manufacturerCountry: oldItem.manufacturerCountry,
        weight: {
            netValue: oldItem.weightnetValue,
            grossValue: oldItem.weightGrossValue,
        },
    };
});

let result = await app.businessFunction({
    functionName: "DhlExpressShipping",
    methodName: "CreateShipment",
    plannedShippingDateAndTime: "2024-06-28T14:00:31GMT+01:00",
    productCode: "P",
    accounts: [
        {
            typeCode: "shipper",
            number: app.getFieldValue("cordCompanyId.shipperAccountNumber")
        }
    ],
    customerDetails: {
        shipperDetails: {
            postalAddress: {
                postalCode: app.getFieldValue("cordCompanyId.postalCode"),
                cityName: app.getFieldValue("cordCompanyId.postalCityName"),
                countryCode: app.getFieldValue("cordCompanyId.postalCountryCode"),
                addressLine1: app.getFieldValue("cordCompanyId.postalAddressLine1"),
                countryName: app.getFieldValue("cordCompanyId.postalCountryName")
            },
            contactInformation: {
                email: app.getFieldValue("cordCompanyId.email"),
                phone: app.getFieldValue("cordCompanyId.contactPhone"),
                companyName: app.getFieldValue("cordCompanyId.contactCompanyName"),
                fullName: app.getFieldValue("cordCompanyId.contactFullName"),
            }
        },
        receiverDetails: {
            postalAddress: {
                postalCode: app.getFieldValue("cordCustomerId.postalCode"),
                cityName: app.getFieldValue("cordCustomerId.postalCityName"),
                countryCode: app.getFieldValue("cordCustomerId.postalCountryCode"),
                addressLine1: app.getFieldValue("cordCustomerId.postalAddressLine1"),
                countryName: app.getFieldValue("cordCustomerId.postalCountryName")
            },
            contactInformation: {
                email: app.getFieldValue("cordCustomerId.email"),
                phone: app.getFieldValue("cordCustomerId.contactPhone"),
                companyName: app.getFieldValue("cordCustomerId.contactCompanyName"),
                fullName: app.getFieldValue("cordCustomerId.contactFullName"),
            }
        }
    },
    documentImages: [
        {
            imageFormat: "PDF",
            content: "base64 pdf string of invoice",
            typeCode: "CIN"
        },
        {
            imageFormat: "PDF",
            content: "base64 pdf string of export declaration",
            typeCode: "DCL"
        }
    ],
    valueAddedServices: [
        {
            serviceCode: "WY"
        }
    ],
    content: {
        packages: [
            {
                weight: app.getFieldValue("cordPackage.weight"),
                dimensions: {
                    length: app.getFieldValue("cordPackage.length"),
                    width: app.getFieldValue("cordPackage.width"),
                    height: app.getFieldValue("cordPackage.height")
                }
            }
        ],
        description: app.getFieldValue("cordPackage.description"),
        incoterm: "DAP",
        unitOfMeasurement: "metric",
        isCustomsDeclarable: true,
        declaredValue: app.getFieldValue("cordPackage.declaredValue"),
        declaredValueCurrency: "EUR",
        exportDeclaration: {
            exportReasonType: "permanent",
            placeOfIncoterm: app.getFieldValue("cordCustomerId.postalCityName"),
            lineItems: lineItems,
            invoice: {
                "number": app.getFieldValue("cordPackage.invoiceNumber"),
                "date": "2024-06-28"
            },
            customsDocuments: [
                {
                    typeCode: "CIT",
                    value: "1234567891"
                }
            ],
            additionalCharges: [
                {
                    value: 23.50,
                    caption: "heavy package",
                    typeCode: "other"
                }
            ]
        }
    },
});
// show label in docViewer control
app.showBlob("docLabel", result.LabelData);
// print label via CloudGateway
app.cloudPrint({ printerName: "name of printer", blob: result.LabelData });

Last updated