karrioapi / karrio

Programmable Shipping API (self-hosted)

Home Page:https://karrio.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Follow Up for DHL PLT

DarkSwoop opened this issue · comments

Describe the bug
Thank you for the quick fix in #453. Now the error occurs during the createShipment call. There, karrio also tries to order paperless_trade as a SpecialService, even though the checkbox is not checked. Maybe a check on the value of the paperless_trade checkbox should also be made.

modules/connectors/dhl_express/karrio/providers/dhl_express/units.py:394

To Reproduce

  1. Create a shipment from CZ to TR
  2. Check the paperless_trade checkbox
  3. Uncheck the paperless_trade checkbox
  4. Select and purchase a label."

Screenshots

error-message
commented

Hi @DarkSwoop ,
Can you by any chance share the JSON API request logs on Karrio's end with me

Screenshot 2023-12-13 at 7 40 43 AM

You can remove any sensitive information

{
  "carrier_ids": [
    "dhl_express"
  ],
  "customs": {
    "certify": true,
    "commercial_invoice": true,
    "commodities": [
      {
        "description": "description",
        "hs_code": "123456",
        "metadata": {},
        "parent_id": "cdt_803f19dc2b94453d8a5d97694c7cb874",
        "quantity": 1,
        "sku": "sku",
        "title": "title",
        "value_amount": 1234567,
        "value_currency": "EUR",
        "weight": 0.516,
        "weight_unit": "KG"
      }
    ],
    "content_type": "merchandise",
    "duty": {
      "currency": "EUR",
      "declared_value": 1234567,
      "paid_by": "sender"
    },
    "incoterm": "DDP",
    "invoice": "sr_dkbrKjoLQ0bVnI30Na1D684x",
    "invoice_date": "2023-12-13",
    "options": {}
  },
  "label_type": "PDF",
  "metadata": {
    "order_ids": "sr_dkbrKjoLQ0bVnI30Na1D684x",
  },
  "options": {
    "currency": "EUR",
    "declared_value": 1234567,
    "paperless_trade": false,
    "shipment_date": "2023-12-13"
  },
  "parcels": [
    {
      "dimension_unit": "CM",
      "height": 5,
      "is_document": false,
      "items": [
        {
          "description": "description",
          "hs_code": "123456",
          "metadata": {},
          "parent_id": "cdt_803f19dc2b94453d8a5d97694c7cb874",
          "quantity": 1,
          "sku": "sku",
          "title": "title",
          "value_amount": 1234567,
          "value_currency": "EUR",
          "weight": 0.516,
          "weight_unit": "KG"
        }
      ],
      "length": 30,
      "packaging_type": "small_box",
      "weight": 0.516,
      "weight_unit": "KG",
      "width": 22
    }
  ],
  "payment": {
    "paid_by": "sender"
  },
  "recipient": {
    "address_line1": "Hayriye Tüccari Cd 36",
    "city": "Istanbul",
    "country_code": "TR",
    "email": "email@example.com",
    "person_name": "Some Person",
    "postal_code": "34130",
    "residential": true,
    "validate_location": false
  },
  "service": "dhl_express_worldwide_nondoc",
  "shipper": {
    "address_line1": "address_1",
    "city": "city",
    "country_code": "CZ",
    "person_name": "person name",
    "postal_code": "12345",
    "residential": false,
    "validate_location": false
  }
}
commented

I think I finally found the real root of the issue.
And it is something that would also have affected all boolean flag options for dhl_express.

Thanks for the thorough test.
I am pushing a 2023.9.6 shortly