Actually, I think I found the code for the Shipment Tracking integration in the ShipStation plugin. See below. What would need to happen to make this work for your plugin?
// Tracking information – WC Shipment Tracking extension.
if ( class_exists( ‘WC_Shipment_Tracking’ ) ) {
if ( function_exists( ‘wc_st_add_tracking_number’ ) ) {
wc_st_add_tracking_number( $order_id, $tracking_number, strtolower( $carrier ), $timestamp );
} else {
// You’re using Shipment Tracking < 1.4.0. Please update!
update_post_meta( $order_id, ‘_tracking_provider’, strtolower( $carrier ) );
update_post_meta( $order_id, ‘_tracking_number’, $tracking_number );
update_post_meta( $order_id, ‘_date_shipped’, $timestamp );
}
$is_customer_note = 0;
} else {
$is_customer_note = 1;
}
$order->add_order_note( $order_note, $is_customer_note );
// Update order status.
if ( $order_shipped ) {
$order->update_status( WC_ShipStation_Integration::$shipped_status );