The Shipment Tracking extension provides customers with an easy way to track shipments by adding a link to emails and order pages.
Adding tracking information to orders
↑ Back to topOn the edit/view order screen, you will see a new write panel for shipment information:

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.

Customization
↑ Back to topScope of support:
We are unable to provide support for customizations under our Support 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.
Custom meta reference
↑ Back to topThe 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.
| if ( function_exists( 'wc_st_add_tracking_number' ) ) { | |
| wc_st_add_tracking_number( $order_id, $tracking_number, $provider, $date_shipped, $custom_url ); | |
| } |
Change the default shipment provider
↑ Back to topThe 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:
| add_filter( 'woocommerce_shipment_tracking_default_provider', 'custom_woocommerce_shipment_tracking_default_provider' ); | |
| function custom_woocommerce_shipment_tracking_default_provider( $provider ) { | |
| $provider = 'USPS'; | |
| return $provider; | |
| } |
Add custom providers dynamically
↑ Back to topYou can add custom providers dynamically by using this snippet in functions.php in your theme folder:
| /** | |
| * wc_shipment_tracking_add_custom_provider | |
| * | |
| * Adds custom provider to shipment tracking or add existing providers to another country. | |
| * | |
| * Change the country name, the provider name, and the URL (it must include the %1$s) | |
| * Add one provider per line | |
| */ | |
| add_filter( 'wc_shipment_tracking_get_providers' , 'wc_shipment_tracking_add_custom_provider' ); | |
| function wc_shipment_tracking_add_custom_provider( $providers ) { | |
| $providers['France']['French New Mail'] = 'https://example.com?id=%1$s'; // add a custom provider | |
| $providers['United Kingdom']['UPS'] = 'https://www.ups.com/track?loc=en_GB&tracknum=%1$s&requester=WT'; // add UPS to the United Kingdom | |
| return $providers; | |
| } |
Hide unused shipping providers
↑ Back to topYou 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.
| add_filter( 'wc_shipment_tracking_get_providers', 'custom_shipment_tracking' ); | |
| function custom_shipment_tracking( $providers ) { | |
| unset($providers['Australia']); | |
| unset($providers['Austria']); | |
| unset($providers['Brazil']); | |
| unset($providers['Belgium']); | |
| unset($providers['Canada']); | |
| unset($providers['Czech Republic']); | |
| unset($providers['Finland']); | |
| unset($providers['France']); | |
| unset($providers['Germany']); | |
| unset($providers['Ireland']); | |
| unset($providers['Italy']); | |
| unset($providers['India']); | |
| unset($providers['Netherlands']); | |
| unset($providers['New Zealand']); | |
| unset($providers['Poland']); | |
| unset($providers['Romania']); | |
| unset($providers['South African']); | |
| unset($providers['Sweden']); | |
| unset($providers['United Kingdom']); | |
| unset($providers['United States']); // Removes all US options | |
| unset($providers['United States']['Fedex']); | |
| unset($providers['United States']['FedEx Sameday']); | |
| unset($providers['United States']['UPS']); | |
| unset($providers['United States']['USPS']); | |
| unset($providers['United States']['OnTrac']); | |
| unset($providers['United States']['DHL US']); | |
| return $providers; | |
| } |
REST API Support
↑ Back to topWorks with WooCommerce API v1, v2, and v3. In the documentation, only v3 is shown.
The shipment tracking REST API allows you to create, view, and delete individual shipment tracking. The endpoint is /wp-json/wc-shipment-tracking/v3/.
| 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 |
Note:
When using a predefinedtracking_provider, thetracking_linkfield 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 thecustom_tracking_providerandcustom_tracking_linkfields instead.
Sending atracking_linkwith 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.
curl -X POST https://example.com/wp-json/wc-shipment-tracking/v3/orders/645/shipment-trackings \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"tracking_provider": "TNT Express (consignment)",
"tracking_number": "12345678",
}'
JSON response example:
{
"tracking_id": "7f4978c390ee633c6294ae0f258656f9",
"tracking_provider": "TNT Express (consignment)",
"tracking_link": "http://www.tnt.com/webtracker/tracking.do?requestType=GEN&searchType=CON&respLang=en&\nrespCountry=GENERIC&sourceID=1&sourceCountry=ww&cons=12345678&navigation=1&g\nenericSiteIdent=",
"tracking_number": "12345678",
"date_shipped": "2016-08-11",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc-shipment-tracking/v3/orders/4497/shipment-trackings/7f4978c390ee633c6294ae0f258656f9"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc-shipment-tracking/v3/orders/4497/shipment-trackings"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc-shipment-tracking/v3/orders/4497"
}
]
}
}
Using custom provider:
curl -X POST https://example.com/wp-json/wc-shipment-tracking/v3/orders/645/shipment-trackings \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"custom_tracking_provider": "Custom",
"custom_tracking_link": "https://example.com?q=%1$s",
"tracking_number": "12345678"
}'
GET /wp-json/wc-shipment-tracking/v3/orders/<order_id>/shipment-trackings/<tracking-id>
curl -X GET https://example.com/wp-json/wc-shipment-tracking/v3/orders/645/shipment-trackings/7f4978c390ee633c6294ae0f258656f9 \
-u consumer_key:consumer_secret \
JSON response example:
{
"tracking_id": "7f4978c390ee633c6294ae0f258656f9",
"tracking_provider": "TNT Express (consignment)",
"tracking_link": "http://www.tnt.com/webtracker/tracking.do?requestType=GEN&searchType=CON&respLang=en&\nrespCountry=GENERIC&sourceID=1&sourceCountry=ww&cons=12345678&navigation=1&g\nenericSiteIdent=",
"tracking_number": "12345678",
"date_shipped": "2016-08-11",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc-shipment-tracking/v3/orders/4497/shipment-trackings/7f4978c390ee633c6294ae0f258656f9"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc-shipment-tracking/v3/orders/4497/shipment-trackings"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc-shipment-tracking/v3/orders/4497"
}
]
}
}
GET /wp-json/wc-shipment-tracking/v3/orders/<order_id>/shipment-trackings/
curl -X GET https://example.com/wp-json/wc-shipment-tracking/v3/orders/645/shipment-trackings \
-u consumer_key:consumer_secret \
JSON response example:
[
{
"tracking_id": "c8ce8278b1e6ddc93b1b465992bac886",
"tracking_provider": "TNT Express (consignment)",
"tracking_link": "http://www.tnt.com/webtracker/tracking.do?requestType=GEN&searchType=CON&respLang=en&\nrespCountry=GENERIC&sourceID=1&sourceCountry=ww&cons=12345678&navigation=1&g\nenericSiteIdent=",
"tracking_number": "12345678",
"date_shipped": "2016-08-10",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc-shipment-tracking/v3/orders/4497/shipment-trackings/c8ce8278b1e6ddc93b1b465992bac886"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc-shipment-tracking/v3/orders/4497/shipment-trackings"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc-shipment-tracking/v3/orders/4497"
}
]
}
}
]
DELETE /wp-json/wc-shipment-tracking/v3/orders/<order_id>/shipment-trackings/<tracking-id>
curl -X DELETE https://example.com/wp-json/wc-shipment-tracking/v3/orders/645/shipment-trackings/c8ce8278b1e6ddc93b1b465992bac886 \
-u consumer_key:consumer_secret \
JSON response example:
"tracking_id": "c8ce8278b1e6ddc93b1b465992bac886",
"tracking_provider": "TNT Express (consignment)",
"tracking_link": "http://www.tnt.com/webtracker/tracking.do?requestType=GEN&searchType=CON&respLang=en&\nrespCountry=GENERIC&sourceID=1&sourceCountry=ww&cons=12345678&navigation=1&g\nenericSiteIdent=",
"tracking_number": "12345678",
"date_shipped": "2016-08-10",
"_links": {
"self": [
{
"href": "https://example.com/wp-json/wc-shipment-tracking/v3/orders/4497/shipment-trackings/c8ce8278b1e6ddc93b1b465992bac886"
}
],
"collection": [
{
"href": "https://example.com/wp-json/wc-shipment-tracking/v3/orders/4497/shipment-trackings"
}
],
"up": [
{
"href": "https://example.com/wp-json/wc-shipment-tracking/v3/orders/4497"
}
]
}
}
GET /wp-json/wc-shipment-tracking/v3/orders/<order_id>/shipment-trackings/providers
curl -X GET https://example.com/wp-json/wc-shipment-tracking/v3/orders/645/shipment-trackings/providers \
-u consumer_key:consumer_secret \
JSON response example:
{
"Australia": {
"Australia Post": "http://auspost.com.au/track/track.html?id=%1$s",
"Fastway Couriers": "http://www.fastway.com.au/courier-services/track-your-parcel?l=%1$s"
},
"Austria": {
"post.at": "http://www.post.at/sendungsverfolgung.php?pnum1=%1$s",
"dhl.at": "http://www.dhl.at/content/at/de/express/sendungsverfolgung.html?brand=DHL&AWB=%1$s",
"DPD.at": "https://tracking.dpd.de/parcelstatus?locale=de_AT&query=%1$s"
},
"Brazil": {
"Correios": "http://websro.correios.com.br/sro_bin/txect01$.QueryList?P_LINGUA=001&P_TIPO=001&P_COD_UNI=%1$s"
},
"Canada": {
"Canada Post": "http://www.canadapost.ca/cpotools/apps/track/personal/findByTrackNumber?trackingNumber=%1$s"
},
"Czech Republic": {
"PPL.cz": "http://www.ppl.cz/main2.aspx?cls=Package&idSearch=%1$s",
"Česká pošta": "https://www.postaonline.cz/trackandtrace/-/zasilka/cislo?parcelNumbers=%1$s",
"DHL.cz": "http://www.dhl.cz/cs/express/sledovani_zasilek.html?AWB=%1$s",
"DPD.cz": "https://tracking.dpd.de/parcelstatus?locale=cs_CZ&query=%1$s"
},
"Finland": {
"Itella": "http://www.posti.fi/itemtracking/posti/search_by_shipment_id?lang=en&ShipmentId=%1$s"
},
"France": {
"Colissimo": "http://www.colissimo.fr/portail_colissimo/suivre.do?language=fr_FR&colispart=%1$s"
},
"Germany": {
"DHL Intraship (DE)": "http://nolp.dhl.de/nextt-online-public/set_identcodes.do?lang=de&idc=%1$s&rfn=&extendedSearch=true",
"Hermes": "https://tracking.hermesworld.com/?TrackID=%1$s",
"Deutsche Post DHL": "http://nolp.dhl.de/nextt-online-public/set_identcodes.do?lang=de&idc=%1$s",
"UPS Germany": "http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=de_DE&InquiryNumber1=%1$s",
"DPD.de": "https://tracking.dpd.de/parcelstatus?query=%1$s&locale=en_DE"
},
"Ireland": {
"DPD.ie": "http://www2.dpd.ie/Services/QuickTrack/tabid/222/ConsignmentID/%1$s/Default.aspx",
"An Post": "https://track.anpost.ie/TrackingResults.aspx?rtt=1&items=%1$s"
},
"Italy": {
"BRT (Bartolini)": "http://as777.brt.it/vas/sped_det_show.hsm?referer=sped_numspe_par.htm&Nspediz=%1$s",
"DHL Express": "http://www.dhl.it/it/express/ricerca.html?AWB=%1$s&brand=DHL"
},
"India": {
"DTDC": "http://www.dtdc.in/dtdcTrack/Tracking/consignInfo.asp?strCnno=%1$s"
},
"Netherlands": {
"PostNL": "https://mijnpakket.postnl.nl/Claim?Barcode=%1$s&Postalcode=%2$s&Foreign=False&ShowAnonymousLayover=False&CustomerServiceClaim=False",
"DPD.NL": "http://track.dpdnl.nl/?parcelnumber=%1$s"
},
"New Zealand": {
"Courier Post": "http://trackandtrace.courierpost.co.nz/Search/%1$s",
"NZ Post": "http://www.nzpost.co.nz/tools/tracking?trackid=%1$s",
"Fastways": "http://www.fastway.co.nz/courier-services/track-your-parcel?l=%1$s",
"PBT Couriers": "http://www.pbt.com/nick/results.cfm?ticketNo=%1$s"
},
"South African": {
"SAPO": "http://sms.postoffice.co.za/TrackingParcels/Parcel.aspx?id=%1$s"
},
"Sweden": {
"Posten AB": "http://www.posten.se/sv/Kundservice/Sidor/Sok-brev-paket.aspx?search=%1$s",
"DHL.se": "http://www.dhl.se/content/se/sv/express/godssoekning.shtml?brand=DHL&AWB=%1$s",
"Bring.se": "http://tracking.bring.se/tracking.html?q=%1$s",
"UPS.se": "http://wwwapps.ups.com/WebTracking/track?track=yes&loc=sv_SE&trackNums=%1$s",
"DB Schenker": "http://privpakportal.schenker.nu/TrackAndTrace/packagesearch.aspx?packageId=%1$s"
},
"United Kingdom": {
"DHL": "http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=%1$s",
"DPD.co.uk": "http://www.dpd.co.uk/tracking/trackingSearch.do?search.searchType=0&search.parcelNumber=%1$s",
"InterLink": "http://www.interlinkexpress.com/apps/tracking/?reference=%1$s&postcode=%2$s#results",
"ParcelForce": "http://www.parcelforce.com/portal/pw/track?trackNumber=%1$s",
"Royal Mail": "https://www.royalmail.com/track-your-item/?trackNumber=%1$s",
"TNT Express (consignment)": "http://www.tnt.com/webtracker/tracking.do?requestType=GEN&searchType=CON&respLang=en&\nrespCountry=GENERIC&sourceID=1&sourceCountry=ww&cons=%1$s&navigation=1&g\nenericSiteIdent=",
"TNT Express (reference)": "http://www.tnt.com/webtracker/tracking.do?requestType=GEN&searchType=REF&respLang=en&r\nespCountry=GENERIC&sourceID=1&sourceCountry=ww&cons=%1$s&navigation=1&gen\nericSiteIdent=",
"UK Mail": "https://old.ukmail.com/ConsignmentStatus/ConsignmentSearchResults.aspx?SearchType=Reference&SearchString=%1$s"
},
"United States": {
"Fedex": "http://www.fedex.com/Tracking?action=track&tracknumbers=%1$s",
"FedEx Sameday": "https://www.fedexsameday.com/fdx_dotracking_ua.aspx?tracknum=%1$s",
"OnTrac": "http://www.ontrac.com/trackingdetail.asp?tracking=%1$s",
"UPS": "http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=%1$s",
"USPS": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=%1$s"
}
}
Questions and support
↑ Back to topSomething missing from this documentation? Still have questions and need assistance?
- If you have a question about a specific extension or theme you’d like to purchase, contact us to get answers.
- If you already purchased this product and need some assistance, get in touch with a Happiness Engineer via our support page and select this product’s name from the Product dropdown.