Problem


I have tried printing a DHL Express shipping label and am seeing an error returned:

Error in parsing request XML:Error: Datatype error: In element 'CommodityCode' : Value '' with length '0' is less than minimum length facet of '2'.. at line 123, column 24


Solution


The following error is returned due to the Commodity Code value not being provided to the DHL Express.

If your items do not have any tariff codes added, please follow steps described in this article.


However if your items already have the Tariff Codes added, please check the below:


1. Go to Shipping > Integrations > DHL Express > PropertiesDouble-check to which Item Extended Property Commodity Code is linked:


Go to Inventory > My Inventory > click on the SKU from Order > Extended Properties. Double-check that Item Extended Property is present (the name should be identical to the one in the Properties for DHL Express) with the correct value.

2. If you are using purely Order Extended Properties, go to Shipping > Integrations > Properties for DHL Express. Double-check to which Order Extended Property Commodity Code is linked:


Go to Orders > Open Orders > Edit the Order in question > Extended Properties. Double-check that Order Extended Property is present (name should be identical to the one in the Properties for DHL Express) with the correct value.

Commodity Code property is the same as HSTariffCode property in other shipping integrations (for example, Royal Mail OBA). If HSTariffCode extended property is already imported into the items under HSTariffCode name (or any other), it can be linked to the Commodity Code property and be used further.

Additional information

Shipping - HS Tariff Code and Country of Origin