I am trying to retrieve all categories using Woocommerce rest API. here is my URL
https://wapi.sriyagcommerce.com//wp-json/wc/v2/products/categories?consumer_key=ck&consumer_secret=cs&per_page=100
while using above url I am getting Error.
code "rest_invalid_param"
message "Invalid parameter(s): per_page"
data
status 400
params
per_page "per_page must be between 1 (inclusive) and 100 (inclusive)"
I want to increase per page limit. I already have done with products by using below code and want to do the same with categories
function maximum_api_filter($query_params) {
$query_params['per_page']["maximum"]=100000;
return $query_params;
}
add_filter('rest_product_collection_params', 'maximum_api_filter');