Is it possible to limit the fields returned in a WooCommerce POST “Update Multiple Products”? By default the API returns all the fields from each product updated. I’d like to reduce the size of the JSON returned.
The API documentation states “You may limit the fields returned in the response using the fields parameter”. However, the example is for GET /wc-api/v3/products
I need to limit the fields for POST /wc-api/v3/products/bulk
I’ve tried appending the fields parameter to the URL, but it doesn’t work (the parameter is ignored and all product fields are returned).
My URL looks like the following:
https://www.mywoocommercestore.com/wc-api/v3/products/bulk?fields=id,price,regular_price,sale_price,stock_quantity,error
If you have access to the site where WooCommerce is installed then you can make use of
woocommerce_api_products_bulk_response
filter and modify the output.Add the following code to theme’s functions.php file