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
Post a Comment