karrioapi / karrio

Programmable Shipping API (self-hosted)

Home Page:https://karrio.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Registration Numbers are not submitted to DHL

DarkSwoop opened this issue · comments

Describe the bug
The registration numbers entered in Customs Information are not transferred to DHL. This is currently the showstopper for us with karrio.

To Reproduce
Steps to reproduce the behavior:

  1. Create a shipment
  2. Enter registration numbers in customs info
  3. Purchase label
  4. Check the API logs

Expected behavior
Registration numbers are transferred to DHL.

Additional context

karrio API Request

{
  "carrier_ids": [
    "dhl_express"
  ],
  "customs": {
    "certify": true,
    "commercial_invoice": true,
    "commodities": [
      {
        "description": "the thing",
        "hs_code": "1234567",
        "metadata": {},
        "parent_id": "cdt_0f105c8b7ecb4daf8c3e66974b336a14",
        "quantity": 1,
        "sku": "v_2QrAa586dny9ieppDyoPwZxp",
        "title": "the thing",
        "value_amount": 479.34,
        "value_currency": "EUR",
        "weight": 0.37,
        "weight_unit": "KG"
      }
    ],
    "content_type": "merchandise",
    "duty": {
      "currency": "EUR",
      "declared_value": 479.34,
      "paid_by": "sender"
    },
    "incoterm": "DDP",
    "invoice": "sr_o5qrWledN0Qakc90VvB9ALQK",
    "invoice_date": "2024-02-20",
    "options": {
      "aes": "012",
      "certificate_number": "123",
      "eel_pfc": "789",
      "eori_number": "1234567890",
      "license_number": "456",
      "nip_number": "345",
      "vat_registration_number": "DE123456789"
    },
    "signer": "Its me"
  },
  "label_type": "PDF",
  "metadata": {
    "order_ids": "sr_o5qrWledN0Qakc90VvB9ALQK"
  },
  "options": {
    "currency": "EUR",
    "declared_value": 479.34,
    "preferred_service": "dhl_express_worldwide_nondoc"
  },
  "parcels": [
    {
      "dimension_unit": "CM",
      "height": 5,
      "is_document": false,
      "items": [
        {
          "description": "the thing",
          "hs_code": "1234567",
          "metadata": {},
          "parent_id": "cdt_0f105c8b7ecb4daf8c3e66974b336a14",
          "quantity": 1,
          "sku": "v_2QrAa586dny9ieppDyoPwZxp",
          "title": "the thing",
          "value_amount": 479.34,
          "value_currency": "EUR",
          "weight": 0.37,
          "weight_unit": "KG"
        }
      ],
      "length": 30,
      "packaging_type": "small_box",
      "weight": 0.37,
      "weight_unit": "KG",
      "width": 22
    }
  ],
  "payment": {
    "paid_by": "sender"
  },
  "recipient": {
    "address_line1": "Hayriye Tüccari Cd 36",
    "city": "Istanbul",
    "country_code": "TR",
    "email": "its@me.com",
    "person_name": "Its me",
    "postal_code": "34130",
    "residential": true,
    "validate_location": false
  },
  "service": "dhl_express_worldwide_nondoc",
  "shipper": {
    "address_line1": "the street",
    "city": "city",
    "country_code": "CZ",
    "person_name": "its them",
    "postal_code": "12345",
    "residential": false,
    "validate_location": false
  }
}

karrio API Response

{
  "id": "shp_8c6b51839c2245c8a43303d176549f44",
  "object_type": "shipment",
  "tracking_url": "/v1/trackers/dhl_express/6869721073",
  "shipper": {
    "id": "adr_5104e3a4250b4ecd8aebf8c8b424f0ce",
    "postal_code": "12345",
    "city": "ABC",
    "person_name": "Its them",
    "country_code": "CZ",
    "residential": false,
    "address_line1": "their street",
    "validate_location": false,
    "object_type": "address"
  },
  "recipient": {
    "id": "adr_7546b091cee749e086a6c54c8d6a828b",
    "postal_code": "34130",
    "city": "Istanbul",
    "person_name": "Its Me",
    "country_code": "TR",
    "email": "its@me.com",
    "residential": true,
    "address_line1": "Hayriye Tüccari Cd 36",
    "validate_location": false,
    "object_type": "address"
  },
  "parcels": [
    {
      "id": "pcl_cf521977295c46158f829c61871249a3",
      "weight": 0.37,
      "width": 22,
      "height": 5,
      "length": 30,
      "packaging_type": "small_box",
      "is_document": false,
      "weight_unit": "KG",
      "dimension_unit": "CM",
      "items": [
        {
          "id": "cdt_791cc865ae0a40d68d8d8d71f3baadd2",
          "weight": 0.37,
          "weight_unit": "KG",
          "title": "the thing",
          "description": "the thing",
          "quantity": 1,
          "sku": "v_2QrAa586dny9ieppDyoPwZxp",
          "hs_code": "1234567",
          "value_amount": 479.34,
          "value_currency": "EUR",
          "parent_id": "cdt_0f105c8b7ecb4daf8c3e66974b336a14",
          "metadata": {},
          "object_type": "commodity"
        }
      ],
      "reference_number": "6869721073",
      "options": {},
      "object_type": "parcel"
    }
  ],
  "services": [
    "dhl_express_worldwide_nondoc"
  ],
  "options": {
    "declared_value": 479.34,
    "currency": "EUR",
    "preferred_service": "dhl_express_worldwide_nondoc",
    "shipment_date": "2024-02-20"
  },
  "payment": {
    "paid_by": "sender"
  },
  "customs": {
    "id": "cst_449ce61f11c14e2a9e3b1a982c67def6",
    "commodities": [
      {
        "id": "cdt_8daebe23f3bc4eb19e3c5371e6dc79b1",
        "weight": 0.37,
        "weight_unit": "KG",
        "title": "the thing",
        "description": "the thing",
        "quantity": 1,
        "sku": "v_2QrAa586dny9ieppDyoPwZxp",
        "hs_code": "62034319",
        "value_amount": 479.34,
        "value_currency": "EUR",
        "parent_id": "cdt_0f105c8b7ecb4daf8c3e66974b336a14",
        "metadata": {},
        "object_type": "commodity"
      }
    ],
    "duty": {
      "paid_by": "sender",
      "currency": "EUR",
      "declared_value": 479.34
    },
    "content_type": "merchandise",
    "incoterm": "DDP",
    "invoice": "sr_o5qrWledN0Qakc90VvB9ALQK",
    "invoice_date": "2024-02-20",
    "commercial_invoice": true,
    "certify": true,
    "signer": "Its me",
    "options": {
      "eori_number": "1234567890",
      "certificate_number": "123",
      "license_number": "456",
      "vat_registration_number": "DE123456789",
      "eel_pfc": "789",
      "aes": "012",
      "nip_number": "345"
    },
    "object_type": "customs_info"
  },
  "rates": [
    {
      "id": "rat_b29d181429e74ae8b3d7865db4a4ae53",
      "object_type": "rate",
      "carrier_name": "dhl_express",
      "carrier_id": "dhl_express",
      "currency": "CZK",
      "service": "dhl_express_worldwide_nondoc",
      "total_charge": 1007.7,
      "transit_days": 1,
      "extra_charges": [
        {
          "name": "Base charge",
          "amount": 780.73,
          "currency": "CZK"
        },
        {
          "name": "EMERGENCY SITUATION",
          "amount": 5,
          "currency": "CZK"
        },
        {
          "name": "FUEL SURCHARGE",
          "amount": 221.97,
          "currency": "CZK"
        }
      ],
      "meta": {
        "carrier": "dhl_express",
        "carrier_connection_id": "car_225f39606e97447c88ea7fd03d4724f9",
        "ext": "dhl_express",
        "rate_provider": "dhl_express",
        "service_name": "DHL EXPRESS WORLDWIDE NONDOC"
      },
      "test_mode": true
    },
    {
      "id": "rat_90fc519e96464369875f26fd94bb53ec",
      "object_type": "rate",
      "carrier_name": "dhl_express",
      "carrier_id": "dhl_express",
      "currency": "CZK",
      "service": "dhl_express_easy_nondoc",
      "total_charge": 2390,
      "transit_days": 1,
      "extra_charges": [
        {
          "name": "Base charge",
          "amount": 2390,
          "currency": "CZK"
        }
      ],
      "meta": {
        "carrier": "dhl_express",
        "carrier_connection_id": "car_225f39606e97447c88ea7fd03d4724f9",
        "ext": "dhl_express",
        "rate_provider": "dhl_express",
        "service_name": "DHL EXPRESS EASY NONDOC"
      },
      "test_mode": true
    }
  ],
  "label_type": "PDF",
  "carrier_ids": [
    "dhl_express"
  ],
  "tracker_id": "trk_251d584588134b2faf639b9d12be93e0",
  "created_at": "2024-02-20 07:58:37.677654+00:00",
  "metadata": {
    "order_ids": "sr_o5qrWledN0Qakc90VvB9ALQK"
  },
  "status": "purchased",
  "carrier_name": "dhl_express",
  "carrier_id": "dhl_express",
  "tracking_number": "6869721073",
  "shipment_identifier": "6869721073",
  "selected_rate": {
    "id": "rat_b29d181429e74ae8b3d7865db4a4ae53",
    "object_type": "rate",
    "carrier_name": "dhl_express",
    "carrier_id": "dhl_express",
    "currency": "CZK",
    "service": "dhl_express_worldwide_nondoc",
    "total_charge": 1007.7,
    "transit_days": 1,
    "extra_charges": [
      {
        "name": "Base charge",
        "amount": 780.73,
        "currency": "CZK"
      },
      {
        "name": "EMERGENCY SITUATION",
        "amount": 5,
        "currency": "CZK"
      },
      {
        "name": "FUEL SURCHARGE",
        "amount": 221.97,
        "currency": "CZK"
      }
    ],
    "meta": {
      "carrier": "dhl_express",
      "carrier_connection_id": "car_225f39606e97447c88ea7fd03d4724f9",
      "ext": "dhl_express",
      "rate_provider": "dhl_express",
      "service_name": "DHL EXPRESS WORLDWIDE NONDOC"
    },
    "test_mode": true
  },
  "meta": {
    "carrier_tracking_link": "https://www.dhl.com/ca-en/home/tracking/tracking-parcel.html?submit=1&tracking-id=6869721073",
    "ext": "dhl_express",
    "carrier": "dhl_express",
    "service_name": "DHL EXPRESS WORLDWIDE NONDOC",
    "rate_provider": "dhl_express",
    "orders": [
      "ord_e2647803dd3a4838b45950d4d6dab6a7"
    ]
  },
  "service": "dhl_express_worldwide_nondoc",
  "selected_rate_id": "rat_b29d181429e74ae8b3d7865db4a4ae53",
  "test_mode": true,
  "label_url": "/v1/shipments/shp_8c6b51839c2245c8a43303d176549f44/label.pdf",
  "invoice_url": "/v1/shipments/shp_8c6b51839c2245c8a43303d176549f44/invoice.pdf"
}

DHL API request

<req:ShipmentRequest
  xsi:schemaLocation="http://www.dhl.com ship-val-global-req.xsd" xmlns:req="http://www.dhl.com"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="10.0">
  <Request>
    <ServiceHeader>
      <MessageTime>2024-02-20T07:58:37</MessageTime>
      <MessageReference>1234567890123456789012345678901</MessageReference>
      <SiteID>12345</SiteID>
      <Password>password</Password>
    </ServiceHeader>
    <MetaData>
      <SoftwareName>3PV</SoftwareName>
      <SoftwareVersion>10.0</SoftwareVersion>
    </MetaData>
  </Request>
  <RegionCode>EU</RegionCode>
  <LanguageCode>en</LanguageCode>
  <Billing>
    <ShipperAccountNumber>123456789</ShipperAccountNumber>
    <ShippingPaymentType>S</ShippingPaymentType>
  </Billing>
  <Consignee>
    <CompanyName>N/A</CompanyName>
    <AddressLine1>36 Hayriye Tüccari Cd</AddressLine1>
    <City>Istanbul</City>
    <PostalCode>34130</PostalCode>
    <CountryCode>TR</CountryCode>
    <CountryName>Turkey</CountryName>
    <Contact>
      <PersonName>Its me</PersonName>
      <PhoneNumber>0000</PhoneNumber>
      <Email>its@me.com</Email>
    </Contact>
    <StreetName>Hayriye Tüccari Cd</StreetName>
    <StreetNumber>36</StreetNumber>
  </Consignee>
  <Commodity>
    <CommodityCode>1234567</CommodityCode>
    <CommodityName>the thing</CommodityName>
  </Commodity>
  <Dutiable>
    <DeclaredValue>479.34</DeclaredValue>
    <DeclaredCurrency>EUR</DeclaredCurrency>
    <ExportLicense>456</ExportLicense>
    <TermsOfTrade>DDP</TermsOfTrade>
  </Dutiable>
  <UseDHLInvoice>Y</UseDHLInvoice>
  <ExportDeclaration>
    <SignatureName>Its me</SignatureName>
    <ExportReason>merchandise</ExportReason>
    <ExportReasonCode>C</ExportReasonCode>
    <InvoiceNumber>sr_o5qrWledN0Qakc90VvB9ALQK</InvoiceNumber>
    <InvoiceDate>2024-02-20</InvoiceDate>
    <ExportLineItem>
      <LineNumber>1</LineNumber>
      <Quantity>1</Quantity>
      <QuantityUnit>PCS</QuantityUnit>
      <Description>the thing</Description>
      <Value>479.34</Value>
      <CommodityCode>1234567</CommodityCode>
      <Weight>
        <Weight>0.37</Weight>
        <WeightUnit>K</WeightUnit>
      </Weight>
      <GrossWeight>
        <Weight>0.37</Weight>
        <WeightUnit>K</WeightUnit>
      </GrossWeight>
      <ManufactureCountryCode>CZ</ManufactureCountryCode>
      <ManufactureCountryName>Czech Republic</ManufactureCountryName>
      <ImportCommodityCode>1234567</ImportCommodityCode>
    </ExportLineItem>
    <PlaceOfIncoterm>N/A</PlaceOfIncoterm>
    <ShipmentPurpose>COMMERCIAL</ShipmentPurpose>
  </ExportDeclaration>
  <ShipmentDetails>
    <Pieces>
      <Piece>
        <PieceID>1</PieceID>
        <PackageType>JJ</PackageType>
        <Weight>0.37</Weight>
        <Width>22</Width>
        <Height>5</Height>
        <Depth>30</Depth>
        <PieceReference>
          <ReferenceID>pcl_cf521977295c46158f829c6187</ReferenceID>
        </PieceReference>
      </Piece>
    </Pieces>
    <WeightUnit>K</WeightUnit>
    <GlobalProductCode>P</GlobalProductCode>
    <LocalProductCode>P</LocalProductCode>
    <Date>2024-02-20</Date>
    <Contents>N/A</Contents>
    <DimensionUnit>C</DimensionUnit>
    <PackageType>JJ</PackageType>
    <IsDutiable>Y</IsDutiable>
    <CurrencyCode>EUR</CurrencyCode>
  </ShipmentDetails>
  <Shipper>
    <ShipperID>1234567899</ShipperID>
    <CompanyName>N/A</CompanyName>
    <RegisteredAccount>1234567899</RegisteredAccount>
    <AddressLine1>1293/8 DOLNOSTUDÉNSKÁ</AddressLine1>
    <City>SUMPERK</City>
    <PostalCode>78701</PostalCode>
    <CountryCode>CZ</CountryCode>
    <CountryName>Czech Republic</CountryName>
    <Contact>
      <PersonName>its them</PersonName>
      <PhoneNumber>0000</PhoneNumber>
    </Contact>
    <StreetName>street</StreetName>
    <StreetNumber>1</StreetNumber>
  </Shipper>
  <Notification>
    <EmailAddress>its@me.com</EmailAddress>
  </Notification>
  <LabelImageFormat>PDF</LabelImageFormat>
  <Label>
    <LabelTemplate>6X4_PDF</LabelTemplate>
  </Label>
</req:ShipmentRequest>
commented

Hi @DarkSwoop,

I found most of the customs declaration identifiers
https://developer.dhl.com/api-reference/dhl-express-xml#operations-Shipment-post_XMLShippingServlet_shipment_validation
I couldn't find where eel_pfc (EEL PFC) 🤔

I am going to push the fix with 2024.2.rc8 shortly.

debfab7

DHL seems not to support the EEL/PFC registration numbers. As far as we understand, this is also a requirement when shipping from the USA. We do not ship from the USA, so the current fix will definitely suffice for us. Thank you.