A payment succeeds at 2:14 a.m. and your system finds out at 2:19, or at 2:14 and three seconds. The difference is the whole webhook-versus-polling decision, and teams usually make it by accident: a cron job that hits an API every minute works, until three years later it is burning half the API rate limit and still missing the event that matters. Webhooks push events to you the moment they happen. Polling asks the API, on a schedule, whether anything happened. Both deliver the same events. They differ in latency, cost, failure behaviour, and who owns the retry — and the right answer depends on the event volume, the freshness the business actually needs, and how much of your API budget you will spend asking a question whose answer is usually "nothing yet".
How each delivery model actually works
A webhook is an HTTP POST the provider sends to an endpoint you operate. Stripe delivers an event as a JSON payload to your webhook endpoint, signs it with the Stripe-Signature header and the whsec_ signing secret you hold, and expects a 2xx response returned quickly, before any complex logic runs. The provider owns the retry: Stripe attempts delivery for up to three days with exponential backoff in live mode, three times over a few hours in a sandbox. Your job is to verify the signature, return 2xx fast, and process the event asynchronously. Webhooks exist for the events that happen outside your request cycle — a bank confirming a payment, a customer disputing a charge, a recurring payment succeeding. Stripe's documentation frames them exactly that way: receiving webhook events helps you respond to asynchronous events.
Polling is the opposite direction. Your system issues a GET against the provider's API every 5 seconds, every 60 seconds, every 15 minutes — and asks for everything changed since the last check, usually with a timestamp cursor or a list endpoint filtered by date. Nothing arrives unless you ask. The schedule, the retry, and the failure mode are all yours: if your poller crashes at 3 a.m., no event is delivered until it restarts and replays the window. The GraphQL vs REST API design playbook works the query side — which endpoints exist and what they return — and this playbook works the delivery side: when the answer should come to you, and when you should go and fetch it.
The latency math is the whole argument
Polling latency is a function of one number, the interval. If you poll every T seconds, an event that occurs at a random moment waits on average T/2 and at worst T before your system sees it. Poll every 60 seconds and the average event is 30 seconds stale, the worst a full minute. Poll every 5 seconds and the average is 2.5 seconds. The only way to beat it is a shorter interval, and the interval is what costs money.
A webhook's latency is the provider's delivery time plus your endpoint's response time — seconds, not intervals. A failed webhook is retried for up to three days, so a transient outage costs minutes, not events. But if your endpoint is down longer than the retry window, the event is gone unless you reconcile against the API afterwards. Every serious webhook implementation therefore keeps a reconciliation poller — a slow sweep, every 15 or 30 minutes, that lists recent events and catches anything the webhook path dropped. The honest architecture is not webhook or polling. It is webhook for freshness, polling for completeness.
The cost math, worked at three volumes
One poller hitting an endpoint every 5 seconds makes 17,280 requests a day, 518,400 a month. Against Amazon SQS — first 1 million requests a month free, standard queues $0.40 per million after that — a single 5-second poller costs nothing. Ten pollers make 5,184,000 requests a month, of which 4,184,000 are billable: $1.67. The queue is not the expensive part. The expensive part is the API you poll: Stripe's global rate limit in live mode is 100 requests per second, 25 in a sandbox, and exceeding it returns 429 Too Many Requests. A 5-second poller uses 0.2 requests per second and is invisible. Fifty pollers at a 1-second interval use 50 per second — half the entire global budget for one integration, before your checkout flow makes a single call.
where T is the interval in seconds and N is the number of pollers. At T = 5 and N = 10, that is 5,184,000 requests a month — $1.67 on SQS standard pricing after the free tier, and 2 requests per second of Stripe rate-limit budget.
Webhook cost is events times price, and the events are all real. AWS EventBridge charges $1.00 per million custom events published: ten million events a month cost $10.00, a hundred million cost $100.00. There is no empty-request tax, because nothing is sent when nothing happened. But the webhook path carries fixed infrastructure your poller does not: a public HTTPS endpoint, a queue behind it so a slow consumer cannot block the 2xx, a dead-letter queue for failed events, and signature verification on every delivery. Run the ROI calculator on the two totals for your volume: at low volume the poller is cheaper because its requests are free or nearly so, and at high volume the webhook is cheaper because it never pays to ask an empty question.
| Dimension | Webhooks | Polling | Authority |
|---|---|---|---|
| Average event delay | Seconds | Half the poll interval (T/2) | Stripe webhooks docs; derived |
| Worst-case delay | Retry window, then lost | Full interval T | Stripe: 3-day live retry |
| Cost driver | Events delivered ($1.00/M EventBridge) | Requests made, mostly empty ($0.40/M SQS after 1M free) | AWS EventBridge / SQS pricing |
| Rate-limit exposure | None on the provider API | Pollers share the 100 req/s live limit; 429 on exceed | Stripe rate limits docs |
| Duplicate delivery | Yes — at-least-once; track event IDs | No — you control the cursor | Stripe webhook best practices |
| Failure mode | Endpoint down past retry window loses events | Poller down loses nothing, delays everything | Stripe docs; SQS long polling |
The reliability contract nobody reads
Webhooks deliver at-least-once, and that single phrase decides most of the implementation. Stripe says it plainly in its best practices: track event IDs to identify duplicate deliveries, because the same event can arrive twice, and never use delivery order to determine sequence. A handler that charges a customer, sends an email, or fulfils an order without an idempotency check will do it twice sooner or later. The correct handler is three rules: verify the signature with the official library, store the event ID before doing any work, and return 2xx before the complex logic runs. Stripe's guidance is explicit on the ordering — return a successful status code before any complex logic that might cause a timeout — because a slow handler that times out gets the event delivered again.
Polling's reliability contract is the opposite: exactly-once is yours to build, from a durable cursor, an idempotent consumer, and a replay window. The cursor must survive a restart, so it lives in a database, not in memory. The consumer must tolerate seeing the same record twice, because a crash between fetching and advancing the cursor replays the window. And the poll itself should use long polling where the provider supports it: Amazon SQS long polling holds the request for up to 20 seconds and returns when a message arrives, while short polling returns immediately even if the queue is empty — so a short poller at a 5-second interval burns 17,280 requests a day asking an empty queue, and a 20-second long poller burns a quarter of that for the same coverage.
When polling is the right call
Polling wins in four situations, and teams that default to webhooks in all four pay for it. First, when the provider has no webhook for the event you need — many APIs expose webhooks for payments and disputes but not for the reporting or configuration change you want. Second, when volume is low and freshness is loose: a nightly reconciliation, an hourly inventory sync, a daily report. Third, when your system cannot receive inbound traffic — behind a firewall, on a laptop, in a network that forbids inbound HTTPS — polling is the only option, because the connection always originates from you. Fourth, when ordering matters more than freshness: a poller paging through a list in creation order gives a deterministic sequence, while webhook deliveries arrive in whatever order the network delivered them.
Webhooks win when freshness is the product: a payment confirmation that unlocks a download, a dispute that must trigger a hold within seconds, a subscription renewal that provisions access. They also win when the event volume is high enough that polling would burn the rate limit — fifty 1-second pollers at half the Stripe global budget is the shape of that failure — and when the webhook includes a signature you can verify, because a signed push is harder to spoof than a poll against an API key in your codebase. The headless WordPress vs Next.js CMS decoupling playbook covers the sibling decision of how content moves between systems, and the same test applies: if the consumer needs the change in seconds, push it; if it needs the change in order, fetch it.
Founder & CEO Insight — Enow A. Jovial
Execution checklist
Build order: the poller first, the webhook second, the reconciliation sweep last.
Step 1 — Decide the freshness number in writing. Write down the maximum age an event may reach before your system acts on it, in seconds, and who loses money if it is older. If the answer is "nobody, within an hour," you are building a poller. If it names a customer waiting on a screen, you are building a webhook.
Step 2 — Build the poller as the system of record. A durable cursor in a database, a list call filtered by the cursor, an idempotent consumer, and a replay window of one hour. Run it on a slow interval — 15 minutes is a good default — and prove it catches an event the webhook path never saw.
Step 3 — Add the webhook endpoint for freshness. A public HTTPS endpoint that verifies the signature with the official library, stores the event ID, returns 2xx immediately, and hands the payload to a queue. It does no business logic at all.
Step 4 — Put a queue and a dead-letter queue behind the endpoint. The queue absorbs a slow consumer so the 2xx stays fast; the dead-letter queue catches events that fail processing three times, so they are visible instead of silently lost. Stripe's three-day retry is the provider's safety net, not yours.
Step 5 — Reconcile on a schedule. A daily job that lists the last 24 hours of events from the API and compares them against what your system processed. Any gap is a bug in the webhook path, and the reconciliation job finds it before a customer does.
Step 6 — Load-test the poller against the rate limit. Count every poller, every interval, and every other integration on the same API key, and confirm the total stays under half the provider's limit — 50 requests per second against Stripe's 100 in live mode. A poller that trips a 429 takes the checkout flow down with it.
- [x] Freshness number written down — the maximum event age, in seconds, with the money at stake named.
- [x] Poller built first — durable cursor, idempotent consumer, one-hour replay window, 15-minute interval.
- [x] Webhook endpoint verifies signatures — official library, whsec_ secret per endpoint, 2xx before any business logic.
- [x] Event IDs stored before processing — duplicate deliveries are no-ops, never double charges.
- [x] Queue plus dead-letter queue behind the endpoint — slow consumers never block the 2xx, failed events are visible.
- [x] Daily reconciliation job live — last 24 hours of API events compared against processed events, gaps alerted.
- [x] Rate-limit budget counted — all pollers plus all other integrations under half the provider's limit.
Who should not build webhooks
If your system cannot receive inbound HTTPS, do not build a webhook endpoint and then punch a hole in the firewall for it — poll, and keep the network closed. If nobody is on call to watch a dead-letter queue, do not build an asynchronous webhook pipeline whose failures are silent by design — poll on a schedule someone actually monitors. And if the event volume is under a thousand a day and freshness is measured in minutes, do not build either: one poller on a 60-second interval, with a durable cursor and a daily reconciliation, is the whole system, and the webhook would be architecture for its own sake. The Next.js App Router vs Remix comparison is the right place to start once the delivery decision is made — the framework you deploy the endpoint on decides how fast that 2xx can be returned under load.
