How do I set up a webhook?

You are using self-hosted WordPress, which sometimes referred to as WordPress.org.

Calling remote hook is still a possibility there, but unless your e-commerce solution supports it, you may need to add a custom code.

  1. Option – find a plugin

There are some plugins which will post data to external URL when certain event happens, say, form is submitted. Those may be specific to your forms or may be somewhat generic (supporting different forms). Likely there is something for WooCommerce and other systems. Unfortunately can’t be more specific without knowing what you are using

  1. For purchases – your payment processor may have webhooks.

I use webhooks with Stripe, for example. Purchase is made through WP but as soon as it’s charged to credit card using Stripe, I get a callback from Stripe with all info. So, no need for posting it again from WordPress.

  1. Add custom code to do webhook for you

Pretty much every action in WordPress triggers some “action”, which can be caught by your plugin. Basically all you need to do is register and action and once it happens post to your external server.

More about actions: https://codex.wordpress.org/Plugin_API#Hooks:_Actions_and_Filters

Leave a Comment