karrioapi / karrio

Programmable Shipping API (self-hosted)

Home Page:https://karrio.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NumberIssuerCountryCode missing from DHL XML request causing validation error

DarkSwoop opened this issue · comments

Describe the bug

I am receiving an error message from DHL stating that the XML does not have the correct format when the registration number is transmitted. It seems as though the definition of the issuing country is missing.

Error message from DHL:

{
  "messages": [
    {
      "carrier_id": "dhl_express-test",
      "carrier_name": "dhl_express",
      "code": "111",
      "message": "Error in parsing request XML:Error: cvc-complex-type.2.4.b: The content of element 'RegistrationNumber' is not complete. One of '{NumberIssuerCountryCode}' is expected. at line 122, column 34"
    }
  ]
}

Screenshots below.

And currently, the VAT ID from the shipper address is being used. If I, as a user, have entered a VAT ID in the workspace settings, it is not used. Perhaps we could use the VAT ID from the workspace settings for the registration number as a fallback if no VAT ID has been entered in the shipper address.

To Reproduce
Steps to reproduce the behavior:

  1. Enter a shipper address with federal tax id
  2. buy a label from DHL

Screenshots

image image