Title: How to programmatically update tracking data from external Webhook (Qapla)
Last modified: January 29, 2026

---

# How to programmatically update tracking data from external Webhook (Qapla)

 *  [francescozig](https://wordpress.org/support/users/francescozig/)
 * (@francescozig)
 * [4 months, 1 week ago](https://wordpress.org/support/topic/how-to-programmatically-update-tracking-data-from-external-webhook-qapla/)
 * Hi VillaTheme Team,
 * I am using the free version of **Orders Tracking for WooCommerce** (Versione 
   1.2.17) and I’m trying to integrate it with an external shipping platform (Qapla)
   via Webhook.
   The carrier we are using is GLS Italy, and the specific slug for
   your plugin is `gls-it`.
 * I need to programmatically insert the tracking number and carrier slug into your
   plugin’s ‘graphical box’ when an order is updated. Currently, I am using `update_post_meta`
   for the following keys, but the data does not appear in the order tracking box
   in the backend:
    - `_vi_wot_order_item_tracking_data`
    - `_vi_wot_order_track_number`
    - `_vi_wot_order_carrier_slug`
 * I have already tried to manually update the meta key `_vi_wot_order_item_tracking_data`
   using an array, but the tracking info doesn’t appear in the ‘Order Tracking’ 
   box on the WooCommerce Order page.
 * **My questions are:**
    1. What is the correct meta key or function to use in the **Free version** to ensure
       the tracking number is correctly saved and visible in your plugin’s UI?
    2. Is there a specific action or hook I should trigger to ‘refresh’ the tracking
       data and send the tracking email automatically once the meta data is updated
       via code?
       (In my next message, I will include the snippet that I use but that
       does not work as I want it to.)
 * Thank you for your support! Best regards.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhow-to-programmatically-update-tracking-data-from-external-webhook-qapla%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [francescozig](https://wordpress.org/support/users/francescozig/)
 * (@francescozig)
 * [4 months, 1 week ago](https://wordpress.org/support/topic/how-to-programmatically-update-tracking-data-from-external-webhook-qapla/#post-18802420)
 * add_action(‘init’, ‘ascolta_webhook_diretto_qapla’, 20); // Priorità bassa per
   caricare dopo i plugin
   function ascolta_webhook_diretto_qapla() { if (isset($
   _GET[‘ascolta_qapla’])) { $json = file_get_contents(‘php://input’); $data = json_decode(
   trim($json), true); if (!$data || !isset($data[‘orders’][0])) { status_header(
   400); die(‘Errore JSON’); } $order_data = $data[‘orders’][0]; $order_id = trim(
   $order_data[‘reference’]); $tracking_code = trim($order_data[‘trackingNumber’]);
   $courier_slug = ‘gls-it’;  if ($order_id && $tracking_code) { $order = wc_get_order(
   $order_id); if (!$order) { status_header(400); die(‘Ordine non trovato’); } //
   1. Prepariamo il dato per il box grafico (FORMATO ARRAY SERIALIZZATO) $tracking_array
   = array( array( ‘tracking_number’ => $tracking_code, ‘carrier_slug’ => $courier_slug,‘
   carrier_name’ => ‘GLS IT’, ‘tracking_url’ => ”, ‘status’ => ‘1’, ‘time’ => current_time(‘
   mysql’) ) ); // 2. Scrittura diretta nei Meta Fields (Nessun rischio di crash)
   update_post_meta($order_id, ‘_vi_wot_order_item_tracking_data’, $tracking_array);
   update_post_meta($order_id, ‘_vi_wot_order_status’, ‘1’);  // 3. Forziamo il 
   caricamento del numero nel campo semplice del plugin update_post_meta($order_id,‘
   _vi_wot_order_track_number’, $tracking_code); update_post_meta($order_id, ‘_vi_wot_order_carrier_slug’,
   $courier_slug); // 4. CAMBIO STATO E NOTA // Cambiare lo stato a ‘completed’ 
   DOPO aver scritto il tracking è ciò che scatena le email di WooCommerce $order-
   >update_status(‘completed’, “Tracking $tracking_code inserito correttamente.”);//
   5. Nota di conferma finale $order->add_order_note(“ZIG RECOVERY: Tracking $tracking_code
   salvato con successo.”); status_header(200); die(‘OK’); } status_header(400);
   die(‘Dati insufficienti’); }}
 *  Plugin Author [mytrinh](https://wordpress.org/support/users/mytrinh/)
 * (@mytrinh)
 * [4 months, 1 week ago](https://wordpress.org/support/topic/how-to-programmatically-update-tracking-data-from-external-webhook-qapla/#post-18803807)
 * Hi,
 * Thank you for reaching out to us.
 * We have [a few methods](https://docs.villatheme.com/woo-orders-tracking/#configuration_menu_8597)
   that you can use to be compatible with our orders tracking plugin. However, these
   features are not currently available in the basic version.
 * If you’d like to be compatible with this version, you will need to customize 
   it on your side. We’re afraid that we cannot provide support for this case.
 * Best regards.
 *  Thread Starter [francescozig](https://wordpress.org/support/users/francescozig/)
 * (@francescozig)
 * [4 months, 1 week ago](https://wordpress.org/support/topic/how-to-programmatically-update-tracking-data-from-external-webhook-qapla/#post-18803845)
 * [https://codecanyon.net/item/woocommerce-orders-tracking/26062993?ref=villatheme&irgwc=1&afsrc=1&clickid=3zAVXgSazxycWf5yXWQW7SfOUku0WSTXnSbuRE0&iradid=275988&irpid=1257925&iradtype=ONLINE_TRACKING_LINK&irmptype=mediapartner&mp_value1=&utm_campaign=af_impact_radius_1257925&utm_medium=affiliate&utm_source=impact_radius&clickthrough_id=1438683244&redirect_back=true](https://codecanyon.net/item/woocommerce-orders-tracking/26062993?ref=villatheme&irgwc=1&afsrc=1&clickid=3zAVXgSazxycWf5yXWQW7SfOUku0WSTXnSbuRE0&iradid=275988&irpid=1257925&iradtype=ONLINE_TRACKING_LINK&irmptype=mediapartner&mp_value1=&utm_campaign=af_impact_radius_1257925&utm_medium=affiliate&utm_source=impact_radius&clickthrough_id=1438683244&redirect_back=true)
   
   Is this purchase link valid for upgrading the plugin?
 *  Plugin Author [mytrinh](https://wordpress.org/support/users/mytrinh/)
 * (@mytrinh)
 * [4 months, 1 week ago](https://wordpress.org/support/topic/how-to-programmatically-update-tracking-data-from-external-webhook-qapla/#post-18803851)
 * Hi,
 * Yes, that is the correct link.
 * Please let us know if you need any further assistance.
 * Best regards.
 *  Thread Starter [francescozig](https://wordpress.org/support/users/francescozig/)
 * (@francescozig)
 * [4 months, 1 week ago](https://wordpress.org/support/topic/how-to-programmatically-update-tracking-data-from-external-webhook-qapla/#post-18806226)
 * Good morning,
   I just purchased the WooCommerce Orders Tracking – SMS – PayPal
   Tracking Autopilot plug-in.I am trying to use the snippet above, but the tracking
   code is written as a note but is not copied to the plugin selector, so the tracking
   is not inserted and the email does not start.Can u help with this version?
 *  [angelagrey](https://wordpress.org/support/users/angelagrey/)
 * (@angelagrey)
 * [4 months, 1 week ago](https://wordpress.org/support/topic/how-to-programmatically-update-tracking-data-from-external-webhook-qapla/#post-18806311)
 * hanks for your purchase, and I’m sorry for the trouble you’re running into.
 * Since this is a premium plugin, could you please open a ticket on our [premium support forum](https://villatheme.com/supports/forum/plugins/woocommerce-orders-tracking/)?
   That’s where we’re able to provide full support for Pro versions, including tracking
   and email-related issues.
 * Once you post there, the team will be happy to help you take a closer look.
 * Thank you for your understanding, and sorry for the inconvenience.
 *  Thread Starter [francescozig](https://wordpress.org/support/users/francescozig/)
 * (@francescozig)
 * [4 months, 1 week ago](https://wordpress.org/support/topic/how-to-programmatically-update-tracking-data-from-external-webhook-qapla/#post-18806331)
 * I had problem to create ticket on villatheme support
 * ![](https://wordpress.org/53a6120a-13ce-4c8e-93d1-6eb9ac5eb3a2)
 *  [angelagrey](https://wordpress.org/support/users/angelagrey/)
 * (@angelagrey)
 * [4 months ago](https://wordpress.org/support/topic/how-to-programmatically-update-tracking-data-from-external-webhook-qapla/#post-18811839)
 * I noticed a ticket on our Forum that has similar details: [https://villatheme.com/supports/topic/order-tracking-from-qapla/](https://villatheme.com/supports/topic/order-tracking-from-qapla/)
 * Is this your ticket? If yes, please keep us updated there. Thanks

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhow-to-programmatically-update-tracking-data-from-external-webhook-qapla%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/woo-orders-tracking/assets/icon-256x256.gif?rev=3080899)
 * [Orders Tracking for WooCommerce](https://wordpress.org/plugins/woo-orders-tracking/)
 * [Support Threads](https://wordpress.org/support/plugin/woo-orders-tracking/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-orders-tracking/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-orders-tracking/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-orders-tracking/reviews/)

 * 8 replies
 * 3 participants
 * Last reply from: [angelagrey](https://wordpress.org/support/users/angelagrey/)
 * Last activity: [4 months ago](https://wordpress.org/support/topic/how-to-programmatically-update-tracking-data-from-external-webhook-qapla/#post-18811839)
 * Status: not resolved