copy this and paste it in your function.php file. wp-json/wc/v3/orders?your_query_param=your-search-value
add_filter('woocommerce_rest_shop_order_object_query', 'wc_enable_custom_filters', 10, 2);
function wc_enable_custom_filters($args, $request) {
// Filter by church ID
$your_query_param = $request->get_param('your_query_param');
if ($your_query_param) {
$args['meta_query'][] = array(
'key' => 'your_query_param', // Change this to your actual meta key
'value' => $your_query_param,
'compare' => '='
);
}
return $args;
}