Hello,
There can be a chance you have hpo’s enabled woo commerce site due to the previous query is showing an empty array.
So you need to check on your end hpos is enabled or not on your site and if hpos is enable then kindly use the below query to fetch subscriptions with respect to any user
$args = array(
‘numberposts’ => -1,
‘type’ => ‘wps_subscriptions’,
‘meta_query’ => array(
‘relation’ => ‘AND’,
array(
‘key’ => ‘wps_subscription_status’,
‘value’ => ‘active’,
),
array(
‘key’ => ‘wps_customer_id’,
‘value’ => 20,
),
),
);
$wps_subscriptions = wc_get_orders( $args );