I know I can add a fee to the cart using the below code, but it just adds a generic fee to the cart. Woocommerce recognizes shipping specific fees and I am wondering if there is a way to make the fees addes via the below method something that woocommerce sees as a "shipping" specific fee. Some sort of metadata that gets added to shipping specific fees. our API is not recognizing these fees as shipping charges and therefore does not log them and that is what I am trying to resolve.
add_action( 'woocommerce_cart_calculate_fees','woocommerce_custom_surcharge' );
function woocommerce_custom_surcharge() {
global $woocommerce;
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
$percentage = 0.01;
$surcharge = ( $woocommerce->cart->cart_contents_total + $woocommerce->cart->shipping_total ) * $percentage;
$woocommerce->cart->add_fee( 'Surcharge', $surcharge, true, '' );
}