Skip to content
VONEXIO employee at a desk in front of two screens
  1. Home
  2. Blog
  3. Webhooks instead of polling: our API principles

Webhooks instead of polling: our API principles

Events instead of queries, retries, idempotency, logs: what makes a reliable warehouse integration and what you should demand from your provider.

Your shop wants to know whether an order has shipped. The warehouse knows the moment the carton is scanned. The question is how that information gets from one system to the other.

There are two ways. With polling, your system asks at intervals: has anything changed? With a webhook, the warehouse reports on its own as soon as something happens. That sounds like a detail for developers. In practice, it decides whether your customer gets the tracking number when the parcel leaves the dock, or only at the next polling run.

This article explains the principles behind a reliable integration and what you should demand from your fulfillment provider. Without jargon wherever possible.

Polling: asking until something happens

Polling is easy to build. Your system might query the status of all open orders every fifteen minutes. Most answers are: nothing new. That has three drawbacks:

  • Delay: A change only arrives with the next query. The longer the interval, the later your customer hears about it.
  • Load: Thousands of empty requests burden both systems. Many shops and marketplaces limit the number of requests. If you use them up while idle, you will not have them when it matters.
  • Gaps: If a status changes several times between two queries, your system only sees the latest state. Intermediate steps are lost.

Webhooks: the warehouse reports

With a webhook, your system registers an address. When something happens in the warehouse, the warehouse sends a short message to that address: which event, which order or item, what time. Typical events in fulfillment:

  • Goods receipt booked
  • Order accepted
  • Order picked and packed
  • Order shipped, with tracking number
  • Return received and inspected
  • Stock changed

Each of these events corresponds to a scan in the warehouse. The message is the digital footprint of a real action.

When a message does not arrive

Networks fail, servers restart, shops go into maintenance. A good integration plans for this:

  • Acknowledgement: Your system acknowledges every message it receives. If the acknowledgement is missing, the message counts as not delivered.
  • Retry: Undelivered messages are sent again at increasing intervals. That way an integration survives even a longer maintenance window.
  • Reconciliation as a safety net: At longer intervals, a query compares the state of both systems and finds anything still missing.

So webhooks and occasional queries are not mutually exclusive. They complement each other: the message brings speed, the reconciliation brings safety.

Idempotency: handling every message twice

Retries have a downside: some messages arrive twice. Your system has to cope with that. The technical term is idempotency. A message processed twice has the same effect as one processed once.

In practice, every message carries a unique ID. Your system remembers which IDs it has already processed and skips duplicates. Without this rule, a customer gets two shipping emails, or stock is deducted twice.

The order of events

Messages do not always arrive in the order in which they were created. If "shipped" arrives before "packed", your system must not set the order back to "packed". Every message therefore needs a timestamp, and an older status never overwrites a newer one.

Logs: trace instead of guess

When a customer asks why their tracking number is missing, you need an answer in minutes, not days. That only works with logs on both sides. You should be able to answer:

  • When was which message sent?
  • How did your system respond?
  • How many retries were there?
  • Which messages finally failed, and who was notified?

Messages that finally fail must not disappear silently. Someone has to find out before your customer does.

What you should demand from your provider

  1. Which events does the warehouse report, and what data does each message contain?
  2. How often and at what intervals is a message retried?
  3. Does every message carry a unique ID and a timestamp?
  4. How are messages secured, for example via an encrypted connection and a signature your system can use to verify the sender?
  5. Is there a test environment where you can trigger events before real orders run?
  6. Who can see the logs, and how will you hear about disruptions?
  7. What happens if your system is unreachable for a few hours?

If you use a ready-made integration with Shopify, Shopware, JTL or Billbee, the connector takes care of much of this. Ask anyway. Even a ready-made connector needs retries and logs.

Our position

We measure our integrations against these principles, and you are welcome to measure every provider against them, including us. We connect Shopify, Shopware, WooCommerce, Magento, JTL, Billbee, Amazon, eBay and other systems. What this looks like for an ERP is explained under JTL fulfillment. The fastest way to clarify your own setup is the Supply Chain Check.

All blog posts

Your customers will notice the difference. In the parcel.

Tell us about your product range, channels and volumes. You'll get an honest assessment, even if it's that we're not the right fit. To your customers, we stay invisible.