The error you mentioned means that WooCommerce REST API request is not authenticated properly.
1- To solve this check if you have enabled REST API by going to WooCommerce > Settings > Advanced > Legacy API.
2- If this is enable verify the keys. Go to WooCommerce > Settings > Advanced > REST API. Regenerate keys if needed.
3- Check API URL.