• Resolved cdalton713

    (@cdalton713)


    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there ??

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Webhook error only during creation – “Sorry, you cannot view this resource.”’ is closed to new replies.