Skip to main content
Contributor I
February 3, 2025
Solved

Automating DHL Tracking Integration & Metrics in Klaviyo

  • February 3, 2025
  • 5 replies
  • 336 views

Hello everyone,

We operate an online shop using the WooCommerce system. Our packages are shipped via DHL within Germany. We are now considering whether we can retrieve the tracking number from DHL via an API and generate various metrics ourselves, such as "Out for Delivery" or "Delivered".

These metrics should be integrated with DHL's tracking system, meaning they should be automatically retrieved from DHL through an available interface (https://developer.dhl.com/api-reference/dhl-parcel-de-shipment-tracking-post-parcel-germany?lang=en#get-started-section/).

Additionally, we currently do not have tracking numbers in Klaviyo. These would also need to be pulled from the DHL API based on the order number, which is already available in both DHL and Klaviyo. This mapping could be used to ensure accurate data synchronization.

Thanks! 

    Best answer by MANSIR2094

    Hello ​@ozbe05 , You can integrate DHL's tracking API with your WooCommerce system to retrieve tracking numbers and delivery status metrics (e.g., "Out for Delivery," "Delivered"). Use the DHL API to pull data based on order numbers from WooCommerce and sync it with Klaviyo. Set up a connection between the order numbers in both platforms to ensure accurate tracking data. You can automate the process by utilizing webhooks or custom code to fetch the relevant information from DHL and update Klaviyo in real time.

    5 replies

    Problem Solver III
    February 3, 2025

    The DHL AWB could be stored as custom data against the customer profile as ‘latest_airwaybill’ or similar by calling Klaviyo’s /profiles endpoint from within WooCommerce. That would then let you build a ‘click here to track your package’ URL within Klaviyo emails.

    Getting the shipment status would be harder. I don’t think that you could ‘natively’ access the DHL API from within Klaviyo, but you could do that on WooCommerce if possible, or via a subsidiary utility server that had access to WooCommerce data, and update a custom profile field with the status.

    You may also be able to make use of a Web Feed to achieve this: https://help.klaviyo.com/hc/en-us/articles/115005258768

    G

    DavidV
    Partner - Platinum
    2025 Champion
    February 4, 2025

    Hi ​@ozbe05,

    Thank you for your question in the community!

    From my side - we’ve never built into the DHL Rest API’s, only into the FTP APIs that they offer. It doesn’t look like they have webhooks available in the API. 

    If you are using Klaviyo CDP - this could potentially be achieved using the Code functionality (Documentation here and a very helpful training course here).

    Alternatively you could create a small middleware application - my favourite platform for this is Gadget as this comes with the entire scaffolding needed to create an app. There’s no native Woo integration for this platform yet but it wouldn’t be too hard to set up.

    You’d have to create a job to pull in orders (either from Woo or Klaviyo - if using Klaviyo this could be done by creating a webhook in a flow) and poll DHL say on an hourly basis using their GET request. You could handle the link between the customer and tracking numbers and push in new events into Klaviyo for “Out for Delivery” & “Delivered” and create transactional email flows based on this. 

    Hope this is helpful - let me know if you have any questions!

    Thanks
    David

    Zyber is New Zealand's leading Shopify Premier & Klaviyo Master Platinum Partner passionate about helping merchants succeed. www.zyber.co.nz & www.unlocked.co.nz
    MANSIR2094
    Expert Problem Solver IV
    Expert Problem Solver IV
    February 5, 2025

    Hello ​@ozbe05 , You can integrate DHL's tracking API with your WooCommerce system to retrieve tracking numbers and delivery status metrics (e.g., "Out for Delivery," "Delivered"). Use the DHL API to pull data based on order numbers from WooCommerce and sync it with Klaviyo. Set up a connection between the order numbers in both platforms to ensure accurate tracking data. You can automate the process by utilizing webhooks or custom code to fetch the relevant information from DHL and update Klaviyo in real time.

    Mansir Digital Portfolio
    ozbe05Author
    Contributor I
    February 5, 2025

    Hello ​@ozbe05 , You can integrate DHL's tracking API with your WooCommerce system to retrieve tracking numbers and delivery status metrics (e.g., "Out for Delivery," "Delivered"). Use the DHL API to pull data based on order numbers from WooCommerce and sync it with Klaviyo. Set up a connection between the order numbers in both platforms to ensure accurate tracking data. You can automate the process by utilizing webhooks or custom code to fetch the relevant information from DHL and update Klaviyo in real time.


    Can you help me with this? Do you have a finish workaround for this? Thanks! 



     

    ozbe05Author
    Contributor I
    February 5, 2025

    Hi ​@ozbe05,

    Thank you for your question in the community!

    From my side - we’ve never built into the DHL Rest API’s, only into the FTP APIs that they offer. It doesn’t look like they have webhooks available in the API. 

    If you are using Klaviyo CDP - this could potentially be achieved using the Code functionality (Documentation here and a very helpful training course here).

    Alternatively you could create a small middleware application - my favourite platform for this is Gadget as this comes with the entire scaffolding needed to create an app. There’s no native Woo integration for this platform yet but it wouldn’t be too hard to set up.

    You’d have to create a job to pull in orders (either from Woo or Klaviyo - if using Klaviyo this could be done by creating a webhook in a flow) and poll DHL say on an hourly basis using their GET request. You could handle the link between the customer and tracking numbers and push in new events into Klaviyo for “Out for Delivery” & “Delivered” and create transactional email flows based on this. 

    Hope this is helpful - let me know if you have any questions!

    Thanks
    David

    Can you help me to do this?