A webhook is an event notification sent to a URL of your choice. Users can configure them to trigger events on one site to invoke behavior on another. Webhooks are useful for integrating with third-party services and other external API that support them.
Webhooks can trigger events each time you add, edit or delete orders, products, coupons or customers.
It’s also possible to use webhooks with SC Commerce actions, e.g., Create a webhook to be used every time a product is added to the shopping cart, using the action woocommerce_add_to_cart
.
Webhooks also make it easier for third-party apps to integrate with SC Commerce.
To create a new webhook:
Go to: SC Commerce > Settings > Advanced > Webhooks.
Select Create a new webhook or Add webhook. The Webhook Data box appears.
Enter the fields:
woocommerce_add_to_cart
for when customers add products to the shopping cart.woocommerce_webhook_topic_hooks
filter.Save Webhook.
Note: The first time your webhook is saved with the Activated status, it sends a ping to the Delivery URL.
Webhooks are listed the same way as posts or products.
SC Commerce saves logs of all events triggering a webhook. Webhook logs are found at: SC Commerce > Status > Logs.
Logs may be reviewed to see delivery and response from the server, making it simpler to integrate and debug.