Advanced Shipment Tracking is built to be extended. This section covers the public functions and filters the free plugin exposes, so you can add tracking from your own code, read it back out, and adjust how tracking arrives through the REST API.
If you’re integrating an external system rather than writing PHP inside WordPress, start with the shipment tracking REST API instead.
In this section
- Adding tracking info to orders — write tracking to an order with
ast_insert_tracking_number(), plus the full field reference. - Get tracking info from orders — read tracking back with
ast_get_tracking_items(), for SMS, custom emails or exports. - Modify REST API arguments when adding tracking — the
ast_api_create_item_argfilter.
Before you start
- Put your code in a site-specific plugin or your child theme’s
functions.php, not in the AST plugin itself — a plugin update would overwrite it. - Guard every call with
function_exists()orclass_exists(), so your site doesn’t fatal if AST is deactivated. - Carrier names must match a carrier enabled in the store. The carriers reference lists every name and slug.
- All of this works the same with WooCommerce High-Performance Order Storage (HPOS) enabled.