Webhook error only during creation – “Sorry, you cannot view this resource.”
-
Hello,
I’m trying to use Woocommerce webhooks to track subscription changes. The webhooks work perfectly fine during all subscriptions changes, except for when I create one through a purchase. I get the following error:
"body": { "code": "woocommerce_rest_cannot_view", "message": "Sorry, you cannot view this resource.", "data": { "status": 403 } }
The logs, with WP_DEBUG on, don’t give any additional information or hints about the issue. I don’t see any settings to link the REST API to the webhooks, and even if that was necessary I don’t get why I get this error only when I make a purchase.
I also have this code in my functions.php file to ensure the webhooks fire immediately. I’m including this for completeness, but I also don’t see why this would be related to this permissions error.
function custom_woocommerce_disable_async_webhook() { return false; } add_filter('woocommerce_webhook_deliver_async', 'custom_woocommerce_disable_async_webhook');
When I delete/change the subscriptions from the admin panel the webhooks work correctly, could this have something to do with it? Any help would be great!
Thanks
- The topic ‘Webhook error only during creation – “Sorry, you cannot view this resource.”’ is closed to new replies.