Error: Invalid parameter(s): status [rest_invalid_param]
-
We have been using this custom script created using woocommerce rest api ( php wrapper ). It was working properly.
But suddenly today, it stopped working.[11-Jun-2020 08:27:11 America/Denver] PHP Fatal error: Uncaught Automattic\WooCommerce\HttpClient\HttpClientException: Error: Invalid parameter(s): status [rest_invalid_param] in /home/xxx/public_html/task/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php:350 Stack trace: #0 /home/xxx/public_html/task/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php(386): Automattic\WooCommerce\HttpClient\HttpClient->lookForErrors(Object(stdClass)) #1 /home/xxx/public_html/task/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php(422): Automattic\WooCommerce\HttpClient\HttpClient->processResponse() #2 /home/xxx/public_html/task/vendor/automattic/woocommerce/src/WooCommerce/Client.php(82): Automattic\WooCommerce\HttpClient\HttpClient->request('orders', 'GET', Array, Array) #3 /home/xxx/public_html/task/index.php(175): Automattic\WooCommerce\Client->get('orders', Array) #4 {main} thrown in /home/xxx/public_html/task/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php on line 350
Our code is like this
$allowed_status = array('pending', 'processing', 'on-hold', 'partial-complete'); $param = [ 'per_page' => '100', 'after' => $start, 'before' => $end, 'status' => $allowed_status, ]; $ca_orders = $castore->get('orders', $param);
If i remove the
'status' => $allowed_status,
, it starts to work again but then it gets all the order.Did woocommerce changed anything very recently in their code. Any help will be appreciated.
Wordpress : 5.4.2
Woocommerce : 4.2.0
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Error: Invalid parameter(s): status [rest_invalid_param]’ is closed to new replies.