“The store says it went through. Why can’t Sara see it?”
Monday at Sandline. Sara is looking for Northbay Hotels' order: 40 boxes of NG-200.
Everyone agrees it exists. They disagree about where.
The webhook vs API question starts here. Should the store tell us, or should we ask? Let's follow the order, then find what “sent” really proves.
Webhook vs API: who starts the exchange?
A webhook is a notice sent to an address when an event happens. You subscribe to the event you want. In Shopify's setup, that means choosing a topic and a destination.
Think of a parcel at Sandline's desk. It says an order was created.
Someone opens it and starts work. Arrival doesn't mean the work inside is done.
Polling means asking for changes again and again. One read is a call. Repeat it on a schedule, and you have polling.
An API is an interface through which software makes requests. AWS explains the request-and-reply model. Polling can use that interface.
Webhooks can use it too. Shopify sends HTTP POST requests, as its delivery guide explains. So the choice is usually who starts: the source or your checker.
Webhook vs polling: which fits?
First ask how much delay the work can stand.
| Approach | Good fit | The catch |
|---|---|---|
| One API request | Fetch a known order for an exception | One call doesn't keep records in sync. |
| Polling | Suitable reads exist, or delay is acceptable | Repeated calls and waiting; recovery needs stored progress. |
| Webhook | Start work when a store event occurs | Handle repeats and review failures. |
| Webhook plus reconciliation | Missing orders would leave hidden work | Own both paths; don't repeat completed work during recovery. |
“Push is fast, pull is reliable” sounds tidy. But a notice can be late. A checker can fail too.
Our rule: push to start work promptly. Pull to check for gaps. Put a person in charge of both.
What would a missing order cost?
- If you need one known record → make an API request. No subscription needed.
- If delay is fine and suitable reads exist → consider polling. Match timing to the work and provider's limits.
- If new orders should start work promptly → use a webhook. Make repeats safe.
- If silence would hide work → add reconciliation. Compare records and assign gaps to an owner.
How does the Shopify order enter Beezr?
Karim chooses From a webhook in a Beezr workflow. He copies its URL and registers it in Shopify. That registration sets up the order-notice route.
Beezr stores the call in a durable queue, then returns 202 Accepted and a process ID, pid. The call survives a restart. Delivery is at least once, so steps must be safe to repeat.
HTTP's 202 definition means accepted for processing. Sara's order isn't finished yet.
Shopify counts responses in the 200 range as receipt. It wants a reply within a few seconds. Failed deliveries get retries over several hours, per its HTTPS guide.
Queue first, reply fast, work later fits that shape. Still, send a real test order. Check that Shopify counts Beezr's 202 as delivered.
Sandline's intake, step by step
- Karim, Systems Register the address — set the Shopify subscription to the copied workflow URL.
- Accept the call — Beezr stores it durably and returns 202 with a pid.
- Read the data — a JSON parser reads the order fields.
- Check the order ID — Load data finds existing orders; a Decision ends repeats.
- Process new orders — run record and line steps, then route for approval.
Once approved, the order can go to accounting through a separate call. Follow it in the API guide. Don't treat each stage as the same thing: store notice, queue receipt, sales order, then invoice.
What if the webhook arrives late, twice or never?
Shopify says a notice may not arrive. Those in the same topic may arrive out of order too. Its advice: run separate checks for gaps, called reconciliation jobs.
Sandline · example
One order, three awkward Mondays
Late. Order 1042 arrives after Sara starts checking the store. Her recovery path and the late notice must use the same order ID. Check it before creating more work.
Twice. The first call creates a Sales Order record. On the repeat, Load data finds order 1042. The Decision ends that run.
Never. No usable notice arrives. Silence can't alert Sara. A separate check must find order 1042 in Shopify and missing from Sandline's list.
What if the same notice arrives again? It should leave the intended result the same. That's called idempotent: a repeat of order 1042's notice shouldn't add an order.
That doesn't mean you can ignore all later changes. What if the order is cancelled, or the number of boxes changes? Decide how to apply those too.
Watch out
Test two arrivals at once. Check-then-create isn't proof of atomic duplicate prevention. Two runs might both check before either creates the record. Have the owner establish how to prevent that.
Also test partial work. An order header might exist while line processing failed. Finding its ID doesn't prove every line is there.
How do you find orders nobody heard about?
Reconciliation means comparing both sides and checking the gaps. Shopify recommends periodic reads. Many queries support an updated_at filter to fetch changes since the last run.
Karim would rather find a gap at 7 a.m. than hear from a customer. Here's the separate check we recommend:
- Read the source range. Fetch all pages. Record the period covered.
- Match stable order IDs. Don't match on customer spelling or display labels alone.
- Sort the gaps. Missing orders need intake; unfinished lines need repair. Changed orders need an update decision.
- Recover safely. Keep the same business ID. Inspect partial results before replaying work.
- Finish the whole check. Only then move its checkpoint. Assign unresolved gaps to an owner.
Beezr's Shopify connector can list orders and get an order. Design and own the schedule, comparison and checkpoint around those reads.
A checker can hide work too. If it marks a whole range done after reading half, it misses orders. Ask to see a failed check restart.
In our example, the check finds store order 1042 missing. Sara reviews its 40 boxes of NG-200. Recovery uses the agreed intake path, then checks the record and lines.
How Beezr does it
Watch what happens after acceptance. Run history shows steps, timings and errors. A workflow can send a result callback on failure, success or always. Check the run for processing errors; compare records for missing work.
Who may send the webhook?
The address is a delivery door. Anyone who finds it can knock. Shopify signs each delivery and asks receivers to verify its signature.
Other senders may put a shared key in a header. In Beezr, requiring a key is a per-workflow choice. Sandline's Shopify workflow receives the payload the store posts.
For senders that can add headers, require a key in api-key. Each system can have its own key, paused on its own. Karim should list senders, decide how to trust each, and keep URLs out of shared documents and chats.
Myth / Reality
“Success means the order is done.” The response proves what its contract says. In Beezr, 202 plus pid means queued. Check the run and order too.
Our take
Our take. Test silence first. Two orders may get noticed. One absent order can hide until a customer asks for the gloves.
Key takeaways
- If you're technical: test repeats, concurrent calls and partial work. Track delivery ID, order ID and run result separately.
- If you're not: ask to see how a missing notice gets found.
- Treat 202 plus pid as acceptance. Check the outcome next.
- Give the gap check an owner and tested recovery steps.
Shopify orders into Beezr
Build intake, then own sender checks and reconciliation.
- Create the webhook workflow. Register its URL for the Shopify order event.
- Parse the JSON into needed fields.
- Load matching orders by source ID. End repeats with a Decision.
- Process new orders with record and line steps, then approval.
- Review outcomes in run history and, where useful, a result callback.
Questions readers ask
What happens if a webhook arrives twice?
Make repeats safe. These two IDs have different jobs.
| ID | What it identifies |
|---|---|
X-Shopify-Webhook-Id |
The delivery. Shopify recommends idempotent handling and this header to detect repeats in its verification guide. |
| Sandline's order ID | The business record. |
Webhook vs WebSocket: are they the same?
No. A WebSocket opens a two-way browser/server session. Messages flow both ways without polling, as MDN explains.
Our webhook is a separate HTTP notice. Neither proves the sales order is done.
Webhook vs callback: what's the difference?
A callback is something called later. Beezr can send one with the run's result after its first reply.
| Term | Distinction in OpenAPI |
|---|---|
| Callback | Relates to a parent operation. |
| Webhook | A request initiated other than by an API call. |
Sandline Supplies is a fictional example company.
Sources
- About webhooks · Shopify · undated
- HTTPS webhook delivery · Shopify · undated
- Verify webhook deliveries · Shopify · undated
- What is an API? · AWS · undated
- RFC 9110: HTTP Semantics · IETF / RFC Editor · 2022-06
- WebSocket API · Mozilla / MDN · undated
- OpenAPI Specification v3.1.1 · OpenAPI Initiative · 2024-10-24