Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Omar Abd Alrahman

    (@muloot)

    Hi Saleem,

    Please disregard my previous message regarding the Bearer Token. After some deep debugging sessions directly with the DHL API Developer Portal Support, we finally found the exact root cause of the 401 Unauthorized errors for the Pickup v3 API.

    It is neither a missing permission on my account nor a strict requirement for OAuth2. The issue lies in a very strict formatting rule of the new DHL v3 gateway, which differs from the v2 gateway.

    I proved this via terminal curl tests with the DHL support team. Here is what needs to be updated in the plugin for Pickup requests:

    The Core Issue: The API Key Header Name (Causes the 401 on GET/POST) While the Shipping v2 API is flexible, the Pickup v3 gateway strictly requires the API key header to be named exactly dhl-api-key (all lowercase) when using Basic Auth.

    • If the request sends X-API-Key or DHL-API-Key -> Result: 401 Unauthorized
    • If changed to exactly dhl-api-key -> Result: 200 OK

    I successfully fetched locations (GET /locations) and booked a pickup (POST /orders) in my production environment just by changing this single header name.

    My credentials were correct all along. Could you please check the plugin’s code for the Pickup v3 REST calls? Updating the header explicitly to dhl-api-key should instantly fix the 401 pickup errors for me and likely many other users migrating to the new API.

    (Bonus tip from DHL Support: If you ever plan to add a “Cancel Pickup” feature via the DELETE endpoint, be aware that the v3 gateway currently throws a 401 if the ID is in the path. It only accepts cancellations if passed as a query parameter like ?orderID=...)

    Let me know if you need any raw logs from my successful terminal tests!

    Best regards
    Omar Abd Alrahman

    Thread Starter Omar Abd Alrahman

    (@muloot)

    Hi Saleem,

    Thanks for your feedback. I have an update from the DHL API Developer Portal Support.

    It turns out that for my account/EKP, the Pickup v3 API specifically requires a Bearer Token via the ROPC flow, rather than the “ApiKey + Basic Auth” method.

    I manually tested the token generation in my terminal and it was successful:

    • Endpoint: https://api-eu.dhl.com/parcel/de/account/auth/ropc/v1/token
    • Result: 200 OK with a valid access_token.

    When I use this token, the API works. However, the plugin currently sends requests using the Basic Auth header (ApiKey + System User), which DHL’s v3 gateway is rejecting for my account with a 401 Unauthorized.

    Does the plugin support the Bearer Token (OAuth2/ROPC) authentication flow for Pickup? It seems DHL is enforcing this for newer accounts/apps. If the plugin only supports Basic Auth, could you look into updating the authentication logic to support Bearer Tokens?

    Best regards
    Omar Abd Alrahman

    Thread Starter Omar Abd Alrahman

    (@muloot)

    Hi Saleem,

    As requested, here is the exact log snippet of the failed pickup request from my site. It confirms the 401 Unauthorized error when the plugin tries to fetch locations for my postcode.

    2026-02-08T18:51:37+00:00 Notice Request: Array (
    [type] => GET
    [url] => https://api.dhl.com/parcel/de/transportation/pickup/v3/locations
    [params] => Array ( [postalCode] => 12345 )
    [body] =>
    )
    2026-02-08T18:51:37+00:00 Notice Response: Array (
    [status] => 401
    [body] => {"status":401,"title":"Unauthorized","detail":"Access to the resource is not allowed."}
    )
    • The address in the plugin matches the one in the DHL GKP portal exactly.
    • The System User is connected, but the shippingRights response from the API does not list any pickup/transportation entitlements.

    I have already reached out to the DHL support to have the Pickup (Transportation) API v3 whitelisted for my account.

    Best regards
    Omar

    Thread Starter Omar Abd Alrahman

    (@muloot)

    Hello @amjedibrahim9, sorry for opening this again..

    In my Geschäftskundenportal i have setup for my labels to be printed as “Common Label Thermodruck 103×150 mm” or 103×199 but i only see 103×199 and 103×202 as options in the plugin. The Printer Brother QL-1100c is not accepting either of them.

    How can i fix this?

    Thanks in advance.
    Omar

    Edit: Since i have a Thermo Printer i thought there will be something different with the label, i choose Laser Printer 103×150 mm and now its working.

    Thread Starter Omar Abd Alrahman

    (@muloot)

    Hello @amjedibrahim9, thanks for the fast reply. Worked flaweless.

    All the Best Omar

Viewing 5 replies - 1 through 5 (of 5 total)