• Resolved nickstaw

    (@nickstaw)


    Hi

    A 3rd party has setup a webhook to send order data to BrightPearl. However, occasionally the connection fails and multiple fails in a row turn the webhook off. I can track this using the webhook api log but I need to flag up any response (email/slack) other than a 200. Is there a WooCommerce hook I can use to grab the webhook response data? I have checked out the WC documentation but it doesn’t seem obvious.

    Thanks in advance

Viewing 1 replies (of 1 total)
  • Plugin Support Kaushik S. a11n

    (@kaushiksomaiya)

    Hi there!

    Thanks for contacting us. ??

    I understand you are looking to capture webhook response data with any http response code.

    You could try the callback hook below:

    
            function custom_woocommerce_webhook_delivery( $http_args, $response, $duration, $arg, $this_id ) { 
                // Use parameters to pass to email or Slack
            }; 
                     
            // add the action 
            add_action( 'woocommerce_webhook_delivery', 'custom_woocommerce_webhook_delivery', 10, 5 );

    `

    I hope this helps! ??

    Reference: https://hookr.io/actions/woocommerce_webhook_delivery/

Viewing 1 replies (of 1 total)
  • The topic ‘Process response from Webhook’ is closed to new replies.