Requirements
↑ Back to top- WordPress: 5.8 or later
- WooCommerce: 6.0 or later
- PHP: 7.2 or later
Installation
↑ Back to top- Upload the Plugin Files:
- Upload the
order-shipment-tracking
folder to the/wp-content/plugins/
directory.
- Upload the
- Activate the Plugin:
- Navigate to the ‘Plugins’ screen in your WordPress admin dashboard.
- Locate Order Shipment Tracking and click ‘Activate’.
- Configure Plugin Settings:
- Go to WooCommerce > Settings > Shipment Tracking to configure the plugin according to your preferences.
Usage
↑ Back to topGeneral Settings
↑ Back to topAccess the General settings under WooCommerce > Settings > Shipment Tracking > General. Here, you can configure the following options:

- Order Status Email: Include shipment tracking information in completed order notification emails.
- Front-end Display: Show tracking information in the customer’s My Account page on the front-end.
- Show Tracking in Orders Table: Display tracking information in the orders table on the My Account page.
- Auto-Complete Orders: Automatically mark orders as complete when tracking numbers are added.
- Send Email Notifications: Send update emails to customers when tracking is added to the order.
Custom Providers
↑ Back to topThe Custom Providers feature allows you to add, manage, and customize shipping carriers that are not included in the default list. This is particularly useful if you work with niche or regional carriers that are not covered by the pre-installed options.
How to Add a Custom Provider
- Access General Settings: Navigate to WooCommerce > Settings > Shipment Tracking > General.
- Locate the Custom Providers Section:
- Scroll down to the Order Shipment Trackingviders section.
- Here, you will find a table listing all available shipping providers categorized by country and a separate section for custom providers.

- Add a New Provider:
- In the Custom Providers section, click the “Add Provider” button.
- A new row will appear where you can enter the details of your custom provider:
- Provider Name: Enter the name of the shipping carrier (e.g., “FastShip”).
- Tracking Website Address: Enter the tracking URL provided by the carrier. Use
%s
as a placeholder for the tracking number (e.g.,https://fastship.com/track/%s
).

- Save Your Changes:
- After adding the necessary details, scroll to the bottom of the page and click the “Save Changes” button to store your new custom provider.
- Verification:
- Your newly added provider will now appear under the Custom Providers section and will be available for selection when adding tracking information to orders.
Managing Custom Providers
- Edit a Provider: To edit an existing custom provider, simply modify the Provider Name or Tracking Website Address in the respective input fields and save the changes.
- Remove a Provider: To remove a custom provider, click the “Remove” button corresponding to the provider you wish to delete. Confirm the action if prompted.
Default Providers Included
The plugin comes with a comprehensive list of default shipping providers categorized by country. Below is an overview of the default providers included by default:
Worldwide:
- DHL:
https://www.dhl.com/pt-en/home/tracking.html?tracking-id=%s&submit=1
- FedEx:
https://www.fedex.com/fedextrack/?trknbr=%s
- UPS:
https://www.ups.com/track?loc=en_US&tracknum=%s&requester=ST/
- GLS:
https://gls-group.eu/GROUP/en/parcel-tracking?match=%s
- Aramex Store to Door:
https://www.aramex.com/track/results?ShipmentNumber=%s
United States:
- USPS:
https://tools.usps.com/go/TrackConfirmAction?tLabels=%s
- OnTrac:
https://www.ontrac.com/tracking/?number=%s
- Amazon Logistics US:
https://track.amazon.com/tracking/%s
United Kingdom:
- Royal Mail:
https://www.royalmail.com/track-your-item#/tracking/%s
- ParcelForce:
https://www.parcelforce.com/track-trace?track_number=%s
- Yodel:
https://www.yodel.co.uk/track/%s
- Evri (Previously Hermes):
https://www.evri.com/track/%s
- Amazon Logistics UK:
https://track.amazon.co.uk/tracking/%s
Australia:
- Australia Post:
https://auspost.com.au/mypost/track/details/%s
Canada:
- Canada Post:
https://www.canadapost-postescanada.ca/track-reperage/en#/search?searchFor=%s
- Purolator:
https://www.purolator.com/en/shipping/tracker?pins=%s
France:
- La Poste:
https://www.laposte.fr/outils/suivre-vos-envois?code=%s
- Mondial Relay:
https://www.mondialrelay.fr/suivi-de-colis?numeroExpedition=%s
- Colissimo:
https://www.laposte.fr/outils/suivre-vos-envois?code=%s
- Chronopost:
https://www.chronopost.fr/tracking-no-cms/suivi-page?listeNumerosLT=%s
- Amazon Logistics FR:
https://track.amazon.fr/tracking/%s
Germany:
- DPD:
https://tracking.dpd.de/parcelstatus?query=%s
- Amazon Logistics DE:
https://track.amazon.de/tracking/%s
Italy:
- Amazon Logistics IT:
https://track.amazon.it/tracking/%s
Poland:
- Poczta Polska:
https://www.poczta-polska.pl/sledzenie-przesylek/?%s
- InPost:
https://inpost.pl/sledzenie-przesylek?number=%s
Spain:
- Correos:
https://www.correos.es/es/es/herramientas/localizador/envios/detalle?tracking-number=%s
- Amazon Logistics ES:
https://track.amazon.es/tracking/%s
South Africa:
- Fastway South Africa:
https://www.fastway.co.za/our-services/track-your-parcel?l=%s
- SAPO:
https://trackingnew.postoffice.co.za/?ParcelId=%s
Norway:
- PostNord:
http://www.postnord.no/nb/vare-verktoy/pakkesporing?searchquery=%s
- Posten.no:
https://sporing.posten.no/sporing/%s
Note: The %s
in the tracking URLs serves as a placeholder for the actual tracking number. Ensure that this placeholder remains intact when adding custom providers to allow the plugin to generate accurate tracking links.
Advanced Settings
↑ Back to topNavigate to WooCommerce > Settings > Shipment Tracking > Advanced to manage advanced configurations:

- Enable Logging: Log tracking events and errors for debugging.
- Enable REST API: Enable REST API support for shipment tracking. The Order Shipment Tracking REST API endpoints require WooCommerce REST API endpoints to be configured at WooCommerce > Settings > Advanced > REST API.
Import / Export
↑ Back to topUnder WooCommerce > Settings > Shipment Tracking > Import / Export, you can manage your shipping providers:

- Export Providers: Export your custom providers to a CSV file. Click the “Export to CSV” button to download your providers
- Import Providers: Import custom providers from a CSV file. The file should have two columns: “Provider Name” and “Tracking URL”. Click the “Import from CSV” button and select your CSV file to upload.
Adding Tracking Numbers to Orders
↑ Back to top- Access Order Details:
- Go to WooCommerce > Orders and select the order you want to add tracking information to.
- Open Shipment Tracking Meta Box:
- In the order details page, locate the Shipment Tracking meta box.

- Add Tracking Information:
- Click the “Add Tracking” button to reveal the tracking form.
- Enter the Tracking Number.
- Select a Shipping Carrier from the dropdown. If your carrier isn’t listed, please create a custom carrier in the Order Shipment Tracking settings.
- Optionally, specify the Date Shipped.
- If Auto-Complete Orders is disabled, you can mark the order as partially shipped.
- Click “Save Tracking” to add the tracking information.
- View Tracking Information:
- The tracking details will appear within the meta box and, if enabled, in the customer’s My Account page and order emails.
Using the REST API
↑ Back to topOrder Shipment Tracking extends the WooCommerce REST API to allow for managing shipment tracking information programmatically.
Authentication
↑ Back to topAuthentication is handled using WooCommerce REST API keys. To generate API keys:
- Navigate to REST API Settings:
- Go to WooCommerce → Settings → Advanced → REST API.
- Add a New Key:
- Click “Add key”.
- Configure Permissions:
- Description: Provide a description for the key.
- User: Select the user who will have access.
- Permissions: Set to “Read/Write”.
- Generate API Keys:
- Click “Generate API Key”.
- Note: Copy the Consumer Key and Consumer Secret as they will not be shown again.
Endpoints
↑ Back to topGet Tracking Information
Retrieve tracking information for a specific order.
- Endpoint:
GET /wp-json/wc/v3/orders/{order_id}/shipment-tracking
- Example Request:
curl -X GET \
'https://your-store.com/wp-json/wc/v3/orders/123/shipment-tracking' \
-u 'ck_your_consumer_key:cs_your_consumer_secret'
- Example Response:
[
{
"tracking_number": "1Z999AA1234567890",
"carrier_id": "ups",
"carrier_name": "UPS",
"tracking_link": "https://www.ups.com/track?tracknum=1Z999AA1234567890",
"date_shipped": "2024-11-12",
"date_added": "2024-11-12 11:07:35"
}
]
Add Tracking Information
Add tracking information to a specific order.
- Endpoint:
POST /wp-json/wc/v3/orders/{order_id}/shipment-tracking
- Parameters:
tracking_number
(string, required): The tracking number.carrier_id
(string, required): The carrier identifier (e.g., ‘ups’, ‘fedex’, ‘usps’).- Example Request:
curl -X POST \
'https://your-store.com/wp-json/wc/v3/orders/123/shipment-tracking' \
-u 'ck_your_consumer_key:cs_your_consumer_secret' \
-H 'Content-Type: application/json' \
-d '{
"tracking_number": "1Z999AA1234567890",
"carrier_id": "ups"
}'
- Example Response:
{
"success": true,
"message": "Tracking information added successfully",
"data": {
"tracking_number": "1Z999AA1234567890",
"carrier_id": "ups",
"carrier_name": "UPS",
"tracking_link": "https://www.ups.com/track?tracknum=1Z999AA1234567890",
"date_shipped": "2024-11-12",
"date_added": "2024-11-12 11:07:35"
}
}
Error Handling
↑ Back to topThe API returns standard HTTP status codes:
- 200: Success
- 400: Bad request (invalid parameters)
- 401: Unauthorized (invalid API keys)
- 404: Not found (invalid order ID)
- 500: Server error
- Error Response Example:
{
"code": "woocommerce_rest_cannot_view",
"message": "Sorry, you cannot view this resource.",
"data": {
"status": 401
}
}
Advanced
↑ Back to topThis section provides in-depth details on filters and hooks that advanced users and developers can leverage to customize Order Shipment Tracking for WooCommerce further.
Using the ost_auto_complete_allowed_statuses Filter
↑ Back to topExample Usage
The ost_auto_complete_allowed_statuses filter allows developers to customize which order statuses are eligible for auto-completion when tracking information is added to an order. By default, Order Shipment Tracking automatically completes orders with the processing and on-hold statuses. However, you can modify this behavior by adding or removing statuses using this filter.
To use this filter, add the following code snippet to your theme’s functions.php
file or a custom plugin:
add_filter( 'ost_auto_complete_allowed_statuses', 'custom_ost_auto_complete_statuses', 10, 2 );
/**
* Customize the allowed statuses for auto-completion.
*
* @param array $statuses Default array of order statuses eligible for auto-completion.
* @param WC_Order $order The WooCommerce order object.
* @return array Modified array of allowed order statuses.
*/
function custom_ost_auto_complete_statuses( $statuses, $order ) {
// Add 'pending' to allowed statuses for auto-completion.
$statuses[] = 'pending';
// Remove 'on-hold' if you don’t want it to auto-complete.
$statuses = array_diff( $statuses, array( 'on-hold' ) );
return $statuses;
}
In this example:
- We add the
pending
status to the list of allowed statuses. - We remove the
on-hold
status to prevent it from auto-completing.
Parameters
$statuses
(array) – An array of default statuses eligible for auto-completion, typically processing and on-hold.$order
(WC_Order) – The order object to which the filter is being applied.
Using the ost_auto_complete_target_status Filter
↑ Back to topThe ost_auto_complete_target_status
filter allows developers to customize the target status to which an order should be updated when it qualifies for auto-completion. By default, Order Shipment Tracking sets eligible orders to the completed status, but you can modify this behavior to use a different status as needed.
Example Usage
To use this filter, add the following code snippet to your theme’s functions.php
file or a custom plugin:
add_filter( 'ost_auto_complete_target_status', 'custom_ost_auto_complete_target_status', 10, 2 );
/**
* Customize the target status for auto-completion.
*
* @param string $target_status The default target status for auto-completion (usually 'completed').
* @param WC_Order $order The WooCommerce order object.
* @return string The modified target status.
*/
function custom_ost_auto_complete_target_status( $target_status, $order ) {
// Change the target status to 'shipped'.
return 'shipped';
}
In this example
We change the target status for auto-completed orders from completed to shipped.
Parameters
$target_status
(string) – The default target status for auto-completion, typically completed.$order
(WC_Order) – The order object to which the filter is being applied.
Using the ost_tracking_notification_subject Filter
↑ Back to topThe ost_tracking_notification_subject
filter allows developers to modify the subject line of the shipment tracking email sent to customers. By default, the subject is set to “Tracking information for order #123” (with the order number dynamically inserted), but this can be customized as needed.
Example Usage
Add the following code snippet to your theme’s functions.php
file or a custom plugin:
add_filter( 'ost_tracking_notification_subject', 'custom_ost_tracking_notification_subject', 10, 2 );
/**
* Customize the email subject for tracking notifications.
*
* @param string $subject The default email subject.
* @param WC_Order $order The WooCommerce order object.
* @return string The modified email subject.
*/
function custom_ost_tracking_notification_subject( $subject, $order ) {
// Customize the subject line, adding the store name.
return sprintf( 'Your order #%s tracking details from %s', $order->get_order_number(), get_bloginfo( 'name' ) );
}
Parameters
$subject
(string) – The default email subject, typically formatted as “Tracking information for order #123”.$order
(WC_Order) – The order object associated with the email.
Using the ost_tracking_notification_heading Filter
↑ Back to topThe ost_tracking_notification_heading
filter allows developers to modify the heading displayed at the top of the shipment tracking email. Alternatively, the heading can also be customised in the email settings at WooCommerce > Settings > Emails > Shipment Tracking.
By default, the heading is “Your order tracking information,” but it can be customized to better match the store’s branding or communication style.
Example Usage
Add the following code snippet to your theme’s functions.php
file or a custom plugin:
add_filter( 'ost_tracking_notification_heading', 'custom_ost_tracking_notification_heading', 10, 2 );
/**
* Customize the email heading for tracking notifications.
*
* @param string $heading The default email heading.
* @param WC_Order $order The WooCommerce order object.
* @return string The modified email heading.
*/
function custom_ost_tracking_notification_heading( $heading, $order ) {
// Change the email heading to include a personalized message.
return __( 'Track Your Shipment Details', 'order-shipment-tracking' );
}
Parameters
$heading
(string) – The default email heading, which is “Your order tracking information”.$order
(WC_Order) – The order object associated with the email.
Using the order_order_shipment_trackingviders Filter
↑ Back to topThe order_order_shipment_trackingviders
filter allows developers to modify the array of default shipment tracking providers. This can be useful if you wish to add, modify, or remove providers to better suit your store’s shipping methods.
Example Usage
Add the following code snippet to your theme’s functions.php
file or a custom plugin:
add_filter( 'order_order_shipment_trackingviders', 'custom_order_shipment_trackingviders' );
/**
* Customize the default shipment tracking providers.
*
* @param array $providers The array of default shipping providers.
* @return array Modified array of shipping providers.
*/
function custom_order_shipment_trackingviders( $providers ) {
// Add a new custom provider.
$providers['worldwide']['my_custom_provider'] = array(
'name' => __( 'My Custom Provider', 'order-shipment-tracking' ),
'tracking_url' => 'https://www.customprovider.com/track?code=%s',
);
// Modify an existing provider's URL.
if ( isset( $providers['united-states']['usps'] ) ) {
$providers['united-states']['usps']['tracking_url'] = 'https://new.usps.com/track?tracknum=%s';
}
// Remove a provider (e.g., FedEx).
unset( $providers['worldwide']['fedex'] );
return $providers;
}
Parameters
$providers
(array) – The default array of shipping providers. Each provider includes the following properties:'name'
(string) – The display name of the provider.'tracking_url'
(string) – The tracking URL with %s as a placeholder for the tracking number.
Important Notes
URL Placeholders: Ensure the tracking URL contains %s
as a placeholder for the tracking number, so the plugin can correctly format links.
Using the ost_tracking_email_sent_to_admin Filter
↑ Back to topThe ost_tracking_email_sent_to_admin
filter allows you to customize whether the shipment tracking emails generated by Order Shipment Tracking are sent to the admin. By default, this filter returns false, indicating that these emails are not intended for admin users. You can use this filter to modify this behavior if necessary.
Example Usage
Add the following code snippet to your theme’s functions.php
file or a custom plugin:
add_filter( 'ost_tracking_email_sent_to_admin', 'custom_ost_tracking_email_sent_to_admin' );
/**
* Customize the flag for sending shipment tracking emails to admin.
*
* @param bool $sent_to_admin Indicates if the email is sent to admin (default: false).
* @return bool Modified value for whether the email is sent to admin.
*/
function custom_ost_tracking_email_sent_to_admin( $sent_to_admin ) {
// Set to true to send the tracking email to the admin as well.
return true;
}
Parameters
$sent_to_admin
(bool) – A boolean flag indicating whether the email should be sent to the admin. The default is false.