Why use Webhooks?
While the gateway proxies most requests live, webhooks are essential for:- Inventory Alerts: Proactively notifying the AI when a hot item goes out of stock.
- Order Confirmation: Updating the
sessionIdwhen a user completes a checkout on your web storefront. - Catalog Refresh: Triggering a re-index of your search data when products are added or removed.
Configuration
If you are using the Better Data Cloud, you can configure webhooks via the dashboard. If you are self-hosting, you can use our built-in webhook handlers.Setup (Self-hosted)
Supported Events
| Event | Platform | Description |
|---|---|---|
inventory.updated | Shopify, Square | Change in stock levels. |
order.created | Shopify, Square | A new order was placed. |
product.updated | Shopify, Square | Change in price, description, or images. |
checkout.completed | Better Data Cloud | A conversational checkout was successful. |
Security
Every webhook request must be signed. The gateway automatically verifies:- Signatures: HMACS from Shopify, Square, or Better Data.
- Timestamps: Prevents replay attacks.
- Payload: Ensures the data matches the expected schema.
Troubleshooting
- 403 Forbidden: Your
WEBHOOK_SECRETlikely doesn’t match the one provided by your commerce platform. - Timeouts: Webhooks should return a
200 OKwithin 2 seconds. Move heavy processing to a background queue.