pixelpeter / laravel5-woocommerce-api-client

Laravel 5 wrapper for the Woocommerce REST API
MIT License
126 stars 48 forks source link

WooCommerce POST API validation response #61

Open sushilsth opened 4 years ago

sushilsth commented 4 years ago

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