OneShot

All packsSaaS Billing + Tax CoreSolve

stripe webhook out of order events race condition

Stripe doesn't guarantee webhook delivery order

Stripe explicitly does not guarantee event ordering; applying subscription webhooks in arrival order instead of event.created order corrupts cached state (D5).

This is one of the things SaaS Billing + Tax Core already handles. Charge per-seat subscriptions: upgrades, downgrades, failed cards, invoices and sales tax.

Buy for $1493 of 3 clean-room builds passed · full refund if it fails on your machine

Is this you?

Stripe states plainly that it does not guarantee webhook delivery order. Code that applies each subscription.updated payload to the local cache in the order it happens to arrive can let a stale event (a past_due from three retries ago) overwrite a newer one (the customer already paid and is active) -- the account's displayed state becomes wrong until the next event happens to fix it, or never.

Why this one is easy to get wrong

In normal operation and in almost every manual test, webhooks do arrive in order, so ordering bugs don't show up until Stripe actually retries something or two events fire close together in production -- an agent has no local signal that ordering matters unless the architecture document says so up front.

What you get instead

D5 applies an incoming subscription object to the cache only if event.created is greater than or equal to the row's stored lastEventCreated timestamp -- otherwise the event is a no-op, returned as {stale: true}. A different subscription id (churn-and-return, D2) only replaces the row if the existing one is no longer live; if it is, the replacement is refused and logged as an orphan rather than silently overwriting a live subscription.

Source: ARCHITECTURE.md D5 — checkable in the pack you receive

How you actually use this

You don’t install a library or wire up an SDK. Your own coding agent builds the code in your project, and you keep it — no runtime dependency on us.

  1. Step 1

    Download and unzip

    You get a folder: the docs that tell an agent what to build, a starting skeleton, and the test suite that decides when it's done.

  2. Step 2

    Open it in Claude Code or Cursor

    Point your coding agent at the folder. Nothing to install, no account with us, no API key.

  3. Step 3

    Paste one prompt

    The pack contains the exact prompt. Paste it as your first message and leave it alone — it works through the build itself, choosing a cheaper or stronger model per task.

  4. Step 4

    Run ./verify.sh

    One command. It prints a pass or fail for every check. Green means the build is done — the same script we ran to produce the receipt on this page.

Typical build: about 18 minutes of your agent working, mostly unattended. Then you integrate the working module into your app the way you would any code you’d written yourself.

Why you can believe this

3 of 3 runs passed

We ran this pack from an empty folder 3 times and published exactly what happened — every check, the model, the token cost, the wall time. Not a testimonial, and not our opinion: the same verify.sh you run yourself. Read the full receipt →

Buy for $14914-day refund if verify.sh fails →

Related problems