WooCommerce: Can’t use wc_get_products for custom REST API endpoints

you missed something, when you get a product using wc_get_product it returns to you an abstract object, so if you need to get product do this

$product =  wc_get_product($product_id);
return $product->get_data();

also you can use all the other functionalities too, such as:

$product->get_status();
$product->get_gallery_image_ids();
...

Leave a Comment