laravel5-woocommerce-api-client icon indicating copy to clipboard operation
laravel5-woocommerce-api-client copied to clipboard

WooCommerce POST API validation response

Open sushilsth opened this issue 5 years ago • 0 comments

Hi,

How can I get the validation response with 422 http code if the validation is not correct while making post request.

Example: $data = [ 'email' => 'john.doecom', //incorrect email 'first_name' => 'John', 'last_name' => 'Doe', 'username' => 'john.doe', ]; Woocommerce::post('customers', $data); // it throws 500 http code and i can catch the json response

sushilsth avatar Aug 16 '20 10:08 sushilsth