Skip to content

WooCommerce webhook

New, failed and refunded orders from a WooCommerce store, with an optional minimum order total.

Setup

  1. In PingLoom open Webhooks, choose New webhook source, pick WooCommerce and create it. Copy the endpoint URL and the secret. The secret is shown once.
  2. In WordPress open WooCommerce, then Settings, Advanced, Webhooks, and choose Add webhook.
  3. Create one webhook with Topic Order created and one with Topic Order updated. Set Status to Active, paste the PingLoom URL into Delivery URL and the PingLoom secret into Secret. Leave API Version on the latest.
  4. Optional: on the PingLoom source page set Smallest new order to alert on (store currency, for example 100).
  5. Place a test order. The request appears under Recent requests on the PingLoom source page.

Verification

WooCommerce sends X-WC-Webhook-Signature, the base64 HMAC-SHA256 of the raw request body, keyed with the webhook secret. WooCommerce signs no timestamp, so PingLoom builds an event id from the order id, the event and the order's last-modified time to drop repeats. The WooCommerce documentation page does not spell out the algorithm; it is taken from the WooCommerce source code (class-wc-webhook.php).

Events

You choose which events become alerts when you create the source, and you can change it later on the source page.

EventPriorityOn by default
Order failedhighYes
Order refundednormalYes
New ordernormalYes

WooCommerce sends a one-off ping when you save a webhook. It is not JSON, so PingLoom answers it with an error and WooCommerce may log a failed delivery for that ping. Real order events are unaffected.

Alerts carry data.amount (smallest currency unit), data.currency, data.event_type, the order id and the item count. Customer names, emails, phone numbers and addresses are never copied. Avoid the characters & < > and quotes in the secret field, because WooCommerce decodes them.

Order updated events for statuses other than failed and refunded are ignored.