Loading...
Loading...
Learn how to use WooCommerce webhooks to track orders, products, and customers. Build real-time integrations with your WordPress e-commerce store.
WooCommerce webhooks notify external services when events happen in your store. When an order is placed, a product is updated, or a customer registers, WooCommerce sends an HTTP POST request with the relevant data to your specified URL.
This enables real-time integrations with CRMs, fulfillment services, analytics platforms, and custom applications without polling the WooCommerce API.
order.created - New order placedorder.updated - Order modified (status, items, etc.)order.deleted - Order moved to trashorder.restored - Order restored from trashproduct.created - New product addedproduct.updated - Product modifiedproduct.deleted - Product moved to trashproduct.restored - Product restored from trashcustomer.created - New customer registeredcustomer.updated - Customer profile modifiedcustomer.deleted - Customer account deletedcoupon.created - New coupon createdcoupon.updated - Coupon modifiedcoupon.deleted - Coupon deletedGo to Webhook.it and copy your unique webhook URL to capture WooCommerce events.
In WordPress admin, go to WooCommerce → Settings → Advanced → Webhooks. Click Add webhook.
Create a test order or product in your store. WooCommerce will immediately send the webhook to Webhook.it where you can inspect the full payload.
Here's what an order.created webhook looks like:
{
"id": 1234,
"status": "processing",
"currency": "USD",
"total": "99.00",
"customer_id": 5,
"billing": {
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"phone": "+1234567890",
"address_1": "123 Main St",
"city": "New York",
"state": "NY",
"postcode": "10001",
"country": "US"
},
"line_items": [
{
"id": 1,
"name": "Premium T-Shirt",
"product_id": 456,
"quantity": 2,
"subtotal": "78.00",
"total": "78.00"
}
],
"date_created": "2025-01-15T10:30:00"
}WooCommerce includes these headers with every webhook:
X-WC-Webhook-ID - Webhook ID in WooCommerceX-WC-Webhook-Topic - Event topic (e.g., order.created)X-WC-Webhook-Resource - Resource type (order, product, etc.)X-WC-Webhook-Event - Event type (created, updated, etc.)X-WC-Webhook-Signature - HMAC-SHA256 signature for verificationX-WC-Webhook-Delivery-ID - Unique delivery identifierAlways verify the X-WC-Webhook-Signature header in production to ensure requests come from WooCommerce:
// Node.js verification example
const crypto = require('crypto');
function verifyWooCommerceSignature(payload, signature, secret) {
const hash = crypto
.createHmac('sha256', secret)
.update(payload, 'utf8')
.digest('base64');
return hash === signature;
}WooCommerce supports webhooks for orders (created, updated, deleted, restored), products (created, updated, deleted), customers (created, updated, deleted), and coupons. Each topic sends relevant data when the event occurs.
In WordPress admin, go to WooCommerce > Settings > Advanced > Webhooks. Click 'Add webhook', enter a name, select the status (Active), choose the topic (e.g., Order created), and paste your delivery URL.
Use Webhook.it to get a public URL. Configure it as your webhook delivery URL in WooCommerce. Create a test order or product, and watch the webhook data appear in Webhook.it instantly.
WooCommerce sends an X-WC-Webhook-Signature header containing a base64-encoded HMAC-SHA256 hash. Verify by computing the same hash of the request body using your webhook secret and comparing.
Common issues: 1) Webhook status is not 'Active', 2) SSL certificate issues on your endpoint, 3) Webhook was disabled after failures, 4) The topic doesn't match the action (e.g., 'Order created' won't fire on updates).