Skip to main content
Solved

Automating DHL Tracking Integration & Metrics in Klaviyo


Forum|alt.badge.img

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.

View original
Did this topic or the replies in the thread help you find an answer to your question?

5 replies

Forum|alt.badge.img+5
  • Problem Solver III
  • 58 replies
  • 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
Forum|alt.badge.img+30
  • 2025 Champion
  • 207 replies
  • 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


MANSIR2094
Problem Solver IV
Forum|alt.badge.img+12
  • Problem Solver IV
  • 164 replies
  • Answer
  • 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.


Forum|alt.badge.img
  • Author
  • Contributor I
  • 2 replies
  • February 5, 2025
MANSIR2094 wrote:

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! 



 


Forum|alt.badge.img
  • Author
  • Contributor I
  • 2 replies
  • February 5, 2025
DavidV wrote:

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?