php - How to retrieve orders details from woocommerce using REST API? -


i want orders details woocommerce using rest api. if, tried anything, returns error following: {"code":"woocommerce_rest_cannot_view","message":"sorry, cannot view resource.","data":{"status":401}}

i have tried following,

require __dir__ . '/vendor/autoload.php';  use automattic\woocommerce\client; use automattic\woocommerce\httpclient\httpclientexception;  $woocommerce = new client( 'https://www.domain.com',  'ck_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',  'cs_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',     [         'version' => 'v3',     ] );  print_r($woocommerce->get('orders')); 

so, please provide suggestion or idea acheive solution. in advance.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -