Note: Shipment tracking details are added to the “completed order” email once the order status is marked as completed.
On the edit/view order screen, you will see a new write panel for shipment information:
Adding Order Shipment Tracking
To add shipment information for the customer to view:
Choose a provider. This should be the shipping company you use. If your provider is not listed, choose the Custom Provider option.
Add the tracking number that the provider assigned. If you chose the custom option, you need to enter the full link to the company’s tracking page (if applicable).
Choose a shipping date (optional), which is when the package was shipped.
(optional) Test the preview link to see if it works as you expect.
Save Tracking. This is also a good time to change the order status to Complete. Marking the order as Complete will send the Completed Order email to the customer, including the shipment tracking code.
(optional) Add additional tracking numbers by clicking Add Tracking Number.
Completed Order email with tracking details and link
After an order has been edited to include the Shipment Tracking details, those details are added to all email notifications sent to the customer for that order. This includes order status changes as well as notifications sent using Order Actions.
We are unable to provide support for customizations under ourSupport Policy. If you need to customize a snippet or extend its functionality, we recommend working with a Woo Agency Partner or a WooCommerce developer on Codeable.
The Shipping Tracking plugin stores the tracking information in the order meta with the meta key _wc_shipment_tracking_items. It’s an array with the following structure:
tracking_provider — String of predefined provider
custom_tracking_provider — String of custom provider
custom_tracking_link — String of custom tracking URL
tracking_number — String of tracking number
date_shipped — Timestamp of shipment date
Developers can use the helper function wc_st_add_tracking_number to add tracking info to an order. In this helper function, the field $custom_url is optional.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The plugin provides a hook for changing the default provider from ‘custom’ called woocommerce_shipment_tracking_default_provider. This can be used by adding a custom function to your theme functions.php file and passing back the name of the provider, which should be the default:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can hide the shipping providers you will not use with this snippet. Note: this code will remove ALL shipping providers. Remove the ones you want to appear before using. For example, if you want to use FedEx, then delete line 24.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Works with WooCommerce API v1, v2, and v3. In the documentation, only v3 is shown.
Shipment Tracking REST API
The shipment tracking REST API allows you to create, view, and delete individual shipment tracking. The endpoint is /wp-json/wc-shipment-tracking/v3/.
Shipment Tracking Properties
Attribute
Type
Description
tracking_id
string
Unique identifier for shipment tracking
read-only
tracking_number
string
Tracking number
required
tracking_provider
string
Tracking provider name
tracking_link
url
Tracking link
date_shipped
date
Date when package was shipped
custom_tracking_provider
string
Custom tracking provider name
use this if you want to use a custom tracking provider
custom_tracking_link
url
Custom tracking link
use this if you want to use a custom tracking link
Create a shipment tracking
Note:
When using a predefined tracking_provider, the tracking_link field is ignored and the default link for that provider will be used.
If you need to specify a custom tracking link (for example, to use a different URL for pick-up points or special cases), you must use the custom_tracking_provider and custom_tracking_link fields instead.
Sending a tracking_link with a predefined provider will not override the default link.
POST /wp-json/wc-shipment-tracking/v3/orders/645/shipment-trackings
If predefined provider name is used, then no need to pass tracking_link.
Something missing from this documentation? Do you still have questions and need assistance?
Have a question about a specific extension or theme you’d like to purchase? Use our Contact us page to get answers.
Have you already purchased this product and need some assistance? Get in touch with a Happiness Engineer via the WooCommerce.com Support page and select this product name in the “Product” dropdown.