تقریبا به این صورت میشه
فقط بایدتون باشه restapi ووکامرس رو باید فعال کرده باشین
$consumer_key = 'your consumer key';
$consumer_secret = 'your consumer secre';
$url = "https://localhost/wordpress/wp-json/wc/v3/products? consumer_key=$consumer_key&consumer_secret=$consumer_secret&page=1&per_page=10&orderby=ID&order=desc";
$headers = array("Content-Type: application/json");
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_SSL_VER