Stripe webhooks for a whole team: one endpoint, every developer gets every event

· 6 min read

Three developers work on the same Stripe integration. They share one test-mode account, and each of them needs checkout.session.completed to reach the handler on their own laptop. This guide sets that up with one webhook endpoint in Stripe that never changes, and a copy of every event for every developer — including the events that arrived while a laptop was asleep.

Stripe facts below are taken from Stripe's documentation as of 2026-10-14; the links are next to each claim.

Why the usual setups break

An endpoint per developer. You can register up to 16 webhook endpoints per Stripe account. Every developer adds their own tunnel URL, and every time a tunnel URL changes somebody edits the dashboard. Endpoints of people who stopped working on the integration keep failing deliveries until someone removes them.

stripe listen on every laptop. The Stripe CLI forwards "all webhooks tied to the Stripe account" for the API key, and the wiki states there is "no way to limit events to only those that a specific user created". It is the right tool for one developer, but it only forwards while it runs: an event created while your terminal was closed does not reach you later.

Laptops sleep. When the tunnel is down, Stripe's delivery fails and goes into retries. Events created in a sandbox are retried three times within a few hours (live mode: up to three days). Come back the next morning and the event is gone for you.

Replays fail the signature check. The Stripe-Signature header signs a timestamp, and Stripe's libraries reject signatures older than five minutes by default. Copying yesterday's payload and headers into curl makes your handler's constructEvent call fail, which is the correct behaviour of the handler and useless when you are debugging it.

The setup: one inbox, one endpoint

A Tunnex inbox is a stable public URL owned by a team, such as https://acme-stripe.tunnex.org. It stores every request, checks the Stripe signature, answers Stripe at once and delivers a copy to every developer who is listening. The commands below use the hosted server at tunnex.org; on your own server add --server wss://connect.example.com to tunnex login once.

1. Install, sign in and create a team (one person does this):

pip install tunnex
tunnex login                      # device login in the browser
tunnex teams create acme
tunnex inboxes create acme-stripe --team acme --provider stripe

The last command prints the inbox URL. It is https://<name>.tunnex.org, and it does not change.

2. Add the endpoint in Stripe. In the Stripe Dashboard (test mode or a sandbox), add a webhook endpoint with the URL https://acme-stripe.tunnex.org/webhooks/stripe and select the events your integration handles. The path is up to you: Tunnex keeps the path and query, so this event reaches your app as /webhooks/stripe. Stripe then shows the endpoint's signing secret, which starts with whsec_.

3. Give the inbox the signing secret, so it can verify events at the edge and re-sign them later:

tunnex inboxes update acme-stripe --secret whsec_...

The secret is stored encrypted and never shown again. (If you create the inbox after the endpoint, pass it to tunnex inboxes create instead, or set TUNNEX_INBOX_SECRET so it does not end up in your shell history.)

4. Invite the team:

tunnex teams invite acme --role member     # prints a one-time link, valid for 7 days

5. Every developer listens, after pip install tunnex, tunnex login and tunnex teams join <link>:

tunnex listen acme-stripe --forward 3000

Events now arrive at http://localhost:3000/webhooks/stripe with Stripe's original headers and body. Your handler verifies them with the endpoint's whsec_ secret — the same value for the whole team, the same as in staging — so there is no per-developer secret to copy into .env files.

Trigger something in test mode (a checkout, or stripe trigger payment_intent.succeeded with the Stripe CLI) and look at what arrived:

tunnex inboxes events acme-stripe          # recent events, signature result, deliveries

What each developer gets

  • Every event. Each listener gets its own copy: fan-out, not load-balancing. Ten developers, ten deliveries. On tunnex.org an inbox takes up to 50 listeners.
  • What they missed. The server keeps a cursor per listener. Close the laptop, open it the next day, and the events since your last one arrive in order — within the inbox's retention (7 days by default, up to 30 on tunnex.org) and up to 1,000 events per reconnect.
  • Only what they care about. Filters match JSON fields, headers, the path or the query; a listener gets the events that match all of its filters:

bash tunnex listen acme-stripe --forward 3000 --filter json.type=checkout.session.completed tunnex listen acme-stripe --forward 3000 --filter json.type^=invoice. --from 6h

--from picks the starting point: cursor (the default), now to skip the backlog, a window such as 6h or 2d, or an event id. - At-least-once delivery. The cursor moves only after your app answered. If your app is restarting (connection refused), Tunnex retries with backoff while you stay connected. Use the Stripe event id (or the x-tunnex-event-id header) to make the handler idempotent.

Each listener has a name — your host name by default. Use --name to run a second, independent listener, for example for another checkout of the project on the same machine; it gets its own cursor.

Replay an event days later

Find the event and send it again to your listeners:

tunnex inboxes events acme-stripe
tunnex inboxes event acme-stripe 418       # headers, body and every delivery attempt
tunnex inboxes replay acme-stripe 418

Because the stored Stripe-Signature is older than the tolerance, Tunnex re-signs the event with the inbox secret and a fresh timestamp before delivering it (it does this for any Stripe event older than two and a half minutes, on replay and on catch-up). Your handler's normal verification passes, with no test-only branch in the code. The delivery carries x-tunnex-delivery: replay and is marked as re-signed in the log.

Members replay to their own listeners; team admins can replay to anyone's listener with --subscription. Replays do not move cursors.

Invalid signatures

An event whose signature does not match gets 401 from the inbox and is stored but not delivered, so a forged request never reaches a laptop, and Stripe treats the delivery as failed. You can still see it, with the reason, in tunnex inboxes events. If you need such events delivered anyway — for example while you are changing the secret — switch the inbox to --accept-invalid; every delivery carries x-tunnex-verified: true, false or unknown.

Staging and CI

A staging service or a CI job listens the same way, with a token that can do nothing else:

tunnex tokens create staging --scope listen --expires-in 90    # shown once: store it as TUNNEX_TOKEN
# tunnex.yaml, run by `tunnex start` (the default command of the client image)
listeners:
  stripe:
    inbox: acme-stripe
    forward: http://app:3000
    filters: ["json.livemode=false"]
    name: staging

The fixed name keeps one cursor across restarts, so events received during a deploy are delivered when the container is back. Compose, Kubernetes, GitLab CI and GitHub Actions templates are in the examples; the file format is in the configuration reference.

Where the payloads live

An inbox stores webhook bodies until their retention expires, and Stripe events contain customer and payment data. Keep retention short, keep the team small, and if the data must not leave your infrastructure, run the server yourself: one process and PostgreSQL, described in the self-hosting guide. The hosted server's limits are 10 inboxes per team, 600 events per minute per inbox and 1 MiB per event; a self-hosted server sets its own.

When you do not need this

If you are the only developer on the integration, stripe listen --forward-to localhost:3000/webhooks/stripe is simpler: nothing else to sign up for or run, and the CLI's signing secret stays the same between restarts. The inbox starts paying off with the second developer, a staging service that must not miss events, or the first time you want to replay last Tuesday's invoice.payment_failed.

Edit this page on GitLab