WooCommerce webhooks and REST API: connecting your store to other systems reliably

A WooCommerce webhook pushes an event (order created, updated) to another system; the REST API lets that system read or change store data when it needs to. Reliable integrations use both: webhooks for speed, the API for checks and nightly reconciliation.

6 min read

In this article
  1. Webhook vs REST API in WooCommerce
  2. Webhooks: what you need to know
  3. Six rules for receiving webhooks reliably
  4. REST API: what you need to know
  5. Security basics
  6. Typical integrations
  7. What drives the cost
  8. What to do tomorrow
  9. FAQ

A WooCommerce webhook is a message your store sends to another system the moment something happens — an order is created or updated, a product changes. The WooCommerce REST API is the door another system uses to read or change store data whenever it needs to. Reliable integrations use both: the webhook to react within seconds, and the API to fetch fresh data before acting and to reconcile anything that slipped through once a night. A webhook-only integration is fast, but sooner or later it loses an order.

For the general concepts, see system integration with APIs and webhooks explained. This piece is WooCommerce-specific.

Webhook vs REST API in WooCommerce

Webhook REST API
Who starts it the store, when an event fires the other system, whenever it asks
Latency seconds as often as you poll
Reliability can be missed (receiver down, webhook disabled) data is always there, but you have to ask
Typical use new order → CRM, accounting, fulfilment verifying an order, stock and price updates, nightly reconciliation
Where to configure WooCommerce → Settings → Advanced → Webhooks WooCommerce → Settings → Advanced → REST API

Webhooks: what you need to know

Topics. Orders, products, customers and coupons — created, updated, deleted, restored (order.created, order.updated and so on) — plus an "Action" topic for any WordPress action hook, such as woocommerce_add_to_cart. Extensions can register additional topics.

Signatures. Each delivery is signed with the secret you set: the X-WC-Webhook-Signature header carries a base64-encoded HMAC-SHA256 of the request body. The receiver should recompute it and reject mismatches — otherwise anyone who discovers the URL can "create" orders in your CRM.

Automatic disabling. WooCommerce disables a webhook after more than five consecutive failed deliveries, where anything other than a 2xx, 301 or 302 response counts as a failure. This is the most common cause of integrations that silently stop: the receiving server was down for a few minutes, the webhook flipped to Disabled and nobody noticed. The threshold can be changed with the woocommerce_max_webhook_delivery_failures filter, but monitoring the status is the better fix.

Logs. WooCommerce → Status → Logs, source webhooks-delivery, records each delivery and the receiver's response.

Duplicates. order.updated fires on every save, sometimes several times a minute. Receivers must be idempotent: the same order in the same state must produce the same result, not two invoices.

Six rules for receiving webhooks reliably

  1. Acknowledge fast. Verify the signature, put the payload on a queue and return 200 immediately; do the heavy work (invoices, CRM) in the background.
  2. Verify every signature.
  3. Don't trust the payload blindly. Fetch the order through the API before acting — its status may have changed since the webhook was sent.
  4. React to transitions, not events. Create the invoice when the status first becomes processing, not on every order.updated.
  5. Record what you have processed (order ID plus action) so a repeated delivery changes nothing.
  6. Reconcile nightly via the API. Pull orders modified in the last 24 hours (modified_after) and confirm each one reached the other system.

REST API: what you need to know

  • Version and routes. The current version is v3: /wp-json/wc/v3/orders, /products, /customers. Pretty permalinks are required — the API does not work with the default permalink setting.
  • Keys and permissions. Keys are created for a specific WordPress user with Read, Write or Read/Write access and inherit that user's capabilities. Create a dedicated integration user (Shop Manager, not Administrator) and grant the minimum: a CRM that only reads orders needs Read.
  • Authentication. Over HTTPS, HTTP Basic Auth with the consumer key and secret. Over plain HTTP, OAuth 1.0a — but production integrations should be HTTPS only.
  • Pagination. 10 items per page by default, up to 100 with per_page; totals arrive in the X-WP-Total and X-WP-TotalPages headers.
  • Batch endpoints. /batch routes create, update or delete up to 100 objects per request — dramatically faster for stock and price updates than one call per product.
  • The Store API (/wp-json/wc/store/v1) powers the cart and checkout in the browser; it is not meant for back-office integrations.

Security basics

  • Never hand a third party an administrator's key "to make it work".
  • One key per integration; revoke it when the integration is retired.
  • Keep keys in the integration's settings or server environment variables, never in code or email threads.
  • Where possible, restrict API access by IP or with Cloudflare rules.

Typical integrations

  • Order → CRM: create or update the contact and attach the order to their history.
  • Order → accounting: an invoice or sales document in Xero, QuickBooks, Sage or similar — see invoice automation for small businesses.
  • Supplier → store: prices and stock via /products/batch — see product XML feed integration.
  • Order → warehouse or 3PL: a picking task, with the tracking number written back to the order.

n8n has a WooCommerce Trigger node (it registers the webhook for you) and a WooCommerce node for API actions; Make and Zapier offer equivalent modules. When they are enough and when you need code: n8n vs Make vs custom code.

What drives the cost

How many systems are connected and whether they have APIs, which events and status transitions matter, order volume, and whether you want nightly reconciliation and error monitoring. Tell us which system you want connected to WooCommerce and what your team currently re-keys by hand, and we will reply within 24 hours with a scope, estimate and timeline: contact us. More on automation and WordPress and WooCommerce.

What to do tomorrow

Open WooCommerce → Settings → Advanced → Webhooks and check the statuses. Anything marked Disabled means a system has been missing data for a while. Then review the REST API keys: for each one you should know what it is for, which user it belongs to and what access it has.

FAQ

Why was my WooCommerce webhook disabled?

Almost always because the receiving server failed to return 2xx, 301 or 302 more than five times in a row. Fix the receiver, re-enable the webhook and run an API reconciliation for the gap.

What is the difference between order.created and order.updated?

order.created is sent once when the order is created, often before payment. order.updated is sent on every save. For anything that depends on payment, act on the status transition.

Can WooCommerce send webhooks only for paid orders?

The built-in topics don't filter by status. Filter on the receiving side, or use a small plugin with a custom Action topic that fires only on the transition to processing.

What permissions should a REST API key have?

The minimum that works: Read for read-only integrations, Read/Write only if the integration updates order statuses or stock. Because keys inherit the user's capabilities, the user should not be an administrator either.

Does the REST API slow the store down?

High-frequency, one-record-at-a-time calls can. Use batch endpoints, the modified_after filter and sensible polling intervals; webhooks reduce the need to poll at all.

More posts

All posts