---
title: "Stripe Webhook Setup: Register, Verify and Handle Events"
description: "Stripe webhooks are HTTPS notifications Stripe sends when events occur."
url: https://www.activepieces.com/blog/stripe-webhook-setup-register-verify-and-handle-events
updated: 2026-12-04
---

> Every page on www.activepieces.com is available as markdown: add `.md` to the URL, or send `Accept: text/markdown`. Site index: https://www.activepieces.com/llms.txt

# Stripe Webhook Setup: Register, Verify and Handle Events

By Leah Goldberg · December 4, 2026 · 14 min read · Filed under [Automation tutorials](https://www.activepieces.com/blog/category/automation-tutorials)

**Summary**

Stripe webhook setup requires registering an HTTPS endpoint, verifying each event's HMAC-SHA256 signature against the raw body, and deduplicating based on event.id.

- Slack's three-second timeout: slower responses trigger Stripe retries over three days.
- Event retries duplicate deliveries; deduplication on event.id prevents double charges or fulfilment.
- Stripe signs bytes not data: altering the body before verification defeats HMAC-SHA256 checks.

A Stripe webhook is an HTTPS POST that Stripe sends to a URL you control whenever something happens in your account, such as `checkout.session.completed`, and that URL can be a hand-written endpoint or a workflow trigger in a tool like [Activepieces](https://www.activepieces.com).

![A small envelope-sized card of structured text labelled by shape only, arriving by an arrow from a Stripe account box to a…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/c08e520b-bf89-4611-83d6-82af0c696d9b/stripe-webhook-setup-register-verify-and-handle-c64cab18.webp)

Your receiver must verify it, acknowledge it and handle repeats. Figures here were checked against docs.stripe.com in December 2026.

Stripe webhook setup is the process of registering an HTTPS endpoint with Stripe, then building the receiver to verify each event's signature, return a success response quickly, and skip events it has already processed.

## Stripe webhook basics: events, endpoints and access

### What Stripe sends and how events are named

The name does half the routing for you. Events are named `resource.action`, so the prefix tells you which object changed and the suffix tells you what happened. That makes filtering cheap: you subscribe by name and ignore the rest.

**17 of Stripe's event types belong to Invoice**, by [Hookdeck](https://hookdeck.com/webhooks/stripe/events)'s count, against 13 each for Charge and Customer, 8 each for Payment intent and Subscription, and 4 for Checkout.

![Which resource families Stripe's event types fall into](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/a4085d88-c425-43af-adc4-37fd1aaa0428/stripe-webhook-setup-register-verify-and-handle-fa09ba74.svg "Source: Hookdeck")

Start with these four events, which most receivers wire up first. The table gives the usual next step for each.

| Event | What happened in Stripe | What a receiver typically does next |
|---|---|---|
| `checkout.session.completed` | A customer finished a Checkout Session | Provision access or create the order |
| `invoice.payment_failed` | A subscription invoice charge was declined | Start a dunning email or flag the account |
| `payment_intent.succeeded` | A payment was collected | Mark the payment paid and send a receipt |
| `charge.refunded` | A charge was refunded, in full or in part | Reverse access or update the ledger |

Note that `payment_intent.succeeded` and a completed checkout can both fire for one purchase. Pick one as your source of truth, **or you'll fulfil twice**.

In the Dashboard, open Developers, then Webhooks, then add an endpoint: paste the HTTPS URL and choose the events. Through the API, `POST /v1/webhook_endpoints` takes a `url` and an `enabled_events` array. Selecting named events rather than all of them keeps your logs readable.

![A Dashboard Webhooks page with an add-endpoint form: a URL field filled in and a list of event checkboxes, a few ticked…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/9496a5fe-30fd-444b-8d79-7526c379c551/stripe-webhook-setup-register-verify-and-handle-991f993a.webp)

### Keys, test mode and the Stripe CLI

When a secret from the wrong mode gets copied over, the signature failures look like a bug in your code. Test mode and live mode keep separate endpoints and separate signing secrets, each starting `whsec_`.

For local work, `stripe listen --forward-to localhost:4242/webhook` relays events and prints a temporary secret.

You don't hire for this, you describe it: tell the built-in chat on [Activepieces](https://www.activepieces.com) which Stripe event you want handled and it publishes a live flow in your account, the same kind of flow a person would have built in the editor.

MoneyGram, Moneypenny, Alan and FundingSocieties run Activepieces, and a flow the chat builds sits under the same RBAC and audit logs as theirs.

Every run leaves a trace anyone on the team can read, so you can see what arrived without being a developer, while the URL and secret handling stay the same.

You will not find a line for endpoints on Stripe's pricing page, which lists fees for payments and products, so the cost to plan for is your receiver's hosting or workflow runs. Registering an endpoint needs only Dashboard access to the account.

## Receive a test event locally

That Dashboard access is enough: run `stripe listen --forward-to localhost:4242/webhook`, then `stripe trigger payment_intent.succeeded` in a second terminal, and your handler prints a real Stripe Event.

In the Dashboard's webhook settings, add an endpoint with your public HTTPS URL and select `payment_intent.succeeded`. Skip this for local work. The CLI forwards events to localhost, so you need no public URL yet.

### Copy the signing secret

Log in first with `stripe login`, then start the listener:

```
stripe listen --forward-to localhost:4242/webhook
```

It prints a signing secret beginning `whsec_`. That secret belongs to the CLI session and it's different from the one on a Dashboard endpoint.

Store it as an environment variable now.

### Fire a test event with stripe trigger

```
stripe trigger payment_intent.succeeded
```

Run it and the CLI creates the objects behind the event in your test account, so the delivery carries data shaped like a real one. Watch the listener terminal: it shows each forwarded event and the status code your endpoint returned.

Here's a minimal receiver (Flask) that prints what arrives:

```python
from flask import Flask, request
app = Flask(__name__)

@app.post("/webhook")
def webhook():
 event = request.get_json()
 print(event["id"], event["type"])
 return "", 200
```

This acknowledges every request without checking who sent it, so it's for local testing only. Verification is the next stage.

### Stripe webhook event payload fields

In a no-code builder you hit the same wall.

The "Data to Insert" panel shows a two-step flow, a Stripe "New Customer" step feeding a Gmail "Send Email" step, and under it a "Test step" notice that the step needs testing to generate sample data, with a purple "Go to step" button.

![Test your automation step first](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/7dd04c55-5a98-4f86-a7d9-fe4f5e983d9b/what-is-a-webhook-payload-structure-and-examples-657e0003.webp)

Nothing in a downstream step can reference a field until a real event has gone through, which is why you fire a test event first.

Open one up and the Event is an envelope, trimmed here:

```json
{
 "id": "evt_...",
 "object": "event",
 "type": "payment_intent.succeeded",
 "data": {
 "object": { "id": "pi_...", "object": "payment_intent", "status": "succeeded" }
 }
}
```

Read `type` to route, and read the resource under `data.object`. Store `id`, because deduplication will key on it.

## Stage 2: Verify the Stripe-Signature header

Verify the header by recomputing an HMAC-SHA256 over the timestamp, a dot and the raw body with your endpoint's `whsec_` secret, then comparing the result to the `v1` value.

The header looks like `Stripe-Signature: t=1700000000,v1=5257a8...`, with `t` the signing timestamp and `v1` the signature.

To see the whole check at a glance, look at the illustration below:
- The header split into `t=` and `v1=`
- The timestamp, a dot and the raw body joined and fed with the secret into HMAC-SHA256
- The result compared to `v1`
- A 300-second timestamp check

![A flow diagram of a Stripe-Signature header split into t= and v1= pieces, the timestamp, a dot and the raw body joined and…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/3519ab19-cef8-42a9-9b9a-2ea6150c2d15/stripe-webhook-setup-register-verify-and-handle-29e6f530.webp)

Take from it that Stripe signs bytes, not data, so anything that alters the bytes, or lets an old request through, defeats the check.

If your framework parses the JSON first and you serialise it again, key order, whitespace or escaping can shift, the HMAC changes, and every genuine event fails with a signature error.

> Stripe signs bytes, not data, so anything that alters the bytes, or lets an old request through, defeats the check.

Hash the request body exactly as it arrived. Configure the route to hand you the raw buffer or string, and parse only after verification passes.

### Stripe library versus manual signature verification

Use Stripe's official library where one exists for your language, such as `stripe.webhooks.constructEvent` in Node or `stripe.Webhook.construct_event` in Python. It splits the header, computes the HMAC, compares in constant time and enforces the timestamp tolerance for you.

Without a library, a manual check is fine, but you must do all four jobs yourself. Skipping the tolerance means a captured request can be replayed indefinitely, and a plain string comparison leaks timing information.

Header parsing should also accept more than one `v1` value, since a secret rotation can produce several.

When verification fails, I would check the mundane causes first:

- A body parser or proxy middleware runs before your handler and consumes or rewrites the raw body.
- The secret belongs to a different endpoint. Each registered endpoint has its own `whsec_` value, so a test endpoint's secret won't verify live traffic.
- You are forwarding events with the Stripe CLI but using the dashboard secret. Each CLI listening session prints its own secret, and it's the one to use locally.
- The server clock has drifted far enough that the 300-second tolerance rejects valid events, so a drifting host looks like a flood of forgeries.

## Stripe webhook retries, timeouts and production limits

**Return 200 before you do real work and assume every event can arrive more than once, because Stripe treats anything other than a prompt 2xx as a failed delivery and retries it.**

### Return 2xx first, process after

**Three seconds is Slack's window**, by [Shannon LLC's comparison](https://dev.to/shannonllc/webhook-timeouts-provider-limits-and-the-acknowledge-first-pattern-412o), against 5 for Shopify, 10 for GitHub, 15 for Twilio and 30 for PayPal.

![How long webhook providers wait for a reply](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/63f52b76-afbc-448e-9b5d-2bd0bc508556/stripe-webhook-setup-register-verify-and-handle-9fe44255.svg "Source: Dev.to (Shannon LLC)")

Slack's 3 seconds leaves no room for a database write plus an email call, so you must defer the email to a background process.

Copy the strictest number, not the most generous. Verify the signature, write the raw body to a queue, return 200, and let a worker do the rest.

In live mode Stripe keeps retrying a failing endpoint with backoff for up to three days, and **may disable an endpoint that keeps failing**. A slow handler can therefore silence your integration entirely.

Match what you see to what's causing it in the table.

| Failure mode | Symptom | Cause | Fix |
|---|---|---|---|
| Slow handler | Timeouts in the dashboard, then retries | Work done before responding | Queue first, respond, process after |
| Non-2xx response | Repeated retries, later a disabled endpoint | Exception, redirect or auth error in your route | Return 200 once verified; log failures separately |
| Duplicate delivery | Double emails or double fulfilment | Retry after a late or lost response | Dedupe on `event.id` |
| Out-of-order event | Status goes backwards | Events arrive in no guaranteed order | Fetch current state from the API |
| Secret mismatch | Every signature check fails | Wrong endpoint secret, or body altered before verification | Use that endpoint's secret and the raw body |

### Make handlers idempotent using event.id

Put a unique constraint on `event.id` and insert the row before any side effect. If the insert fails, you've seen the event, so return 200 and stop. This is what makes a retry harmless.

Treat the event as a prompt, not the truth. Take the object's ID from the payload and fetch it from the Stripe API, so a late `updated` event can't overwrite newer data.

If your endpoint was down, resend failed events from the dashboard or list them through the Events API, which covers the past 30 days. So an outage you notice after a month leaves events you can't replay, and you must reconcile against the objects themselves.

## Stage 3: Receive Stripe events in Activepieces

You do not need a server of your own to receive Stripe events in Activepieces: use its Stripe trigger, one of 751 integrations counted in its open source monorepo, or a Catch Webhook URL pasted into Stripe's dashboard.

Neither replays events you missed, so the reconciliation above still applies.

Create a flow, choose the Stripe integration as the trigger, and connect your account. The integration registers the webhook endpoint in Stripe for you, so you pick the event (here `invoice.payment_failed`) instead of copying URLs between tabs.

Use a restricted key where Stripe allows it, since the connection holds a credential.

### Or paste a Catch Webhook URL into Stripe

Start the flow with Catch Webhook instead, copy its URL, and add it as an endpoint in Stripe's webhook settings, selecting the same event. The generic trigger accepts any POST sent to that URL.

![Activepieces flow builder showing an audit event handler with Flow created and Flow published triggers routing through a…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/d1cd51bb-8dd2-4258-b028-eb4beb7375c7/webhook-retry-strategies-why-api-vendors-differ-6d7157bd.webp)

I can't point to a built-in check of the `Stripe-Signature` header there, so treat the URL as a secret and assume unsigned requests would be accepted.

### Build the failed-payment alert workflow

Three steps make up the workflow: catch the event, read the stored connection, and message the person who owns the account in Slack. The screenshot below shows that shape with the Slack step selected.

![Connections in Builder](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/4bc6de2d-83e7-48de-aa21-0effe60786d2/how-to-automate-the-hr-to-it-handoff-for-new-hir-6d3dd337.webp)

The Connection field points at "2. Read Connection", and "Test Step" runs it against sample data before anything is live.

After the Slack step, add one more step that writes a row to a table with the customer, invoice ID and amount. That row's your own record to reconcile against if an alert never arrives.

You pay by credits. [Activepieces](https://www.activepieces.com/pricing) lists 1,000 credits at $0 a month, so a small account's failed-payment alerts can run free. At 10,000 credits the price's $20 a month, which covers a modest customer base.

![What Activepieces costs per month at each credit tier](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/877c22f6-4e4f-4508-b99d-1609a503d855/stripe-webhook-setup-register-verify-and-handle-8fcabfa0.svg "Source: Activepieces")

At 50,000 credits it's $200, ten times the price for five times the credits, so a high-volume account should price this before committing.

### When your own endpoint is the better choice

Write your own endpoint when you need to verify the signature against the raw request body, return a 2xx before slow work, or deduplicate on the event ID.

A no-code flow gives you less control over each of those, and they're the three checks this article puts ahead of business logic.

Keep Activepieces for the alert and the row, which cost 1 credit a run however many steps they have, and let your endpoint handle money movement.

## Frequently asked questions

Stripe's defaults differ from what people assume, and the differences only show up when a delivery fails. That is where most leftover questions come from.

If you're asking what webhooks cost, **Stripe adds no separate fee for sending them**. Your cost is the infrastructure that receives them, so a slow or retry-heavy endpoint costs you compute, not Stripe fees. Check your own hosting bill before assuming "free" covers it.

Yes, several endpoints can receive the same event. Each registered endpoint gets every event type it subscribes to, and each has its own signing secret. Stripe caps endpoints per account, so don't register one per workflow.

Register one endpoint, verify and deduplicate there, then fan out internally. Reusing one secret across endpoints is the classic way to get "signature mismatch" tickets.

When a webhook works in test mode but fails live, it is a mode problem. Test and live mode are separate worlds.

An endpoint **registered in test mode never receives live events**, and each mode issues its own signing secret. The usual causes, in order of frequency:

1. The live endpoint was never registered.
2. The live deployment still holds the test signing secret.
3. A secret from the Stripe CLI's local forwarding is in use. It differs from the Dashboard secret for the same endpoint.
4. The live endpoint is subscribed to fewer event types than the test one.
5. A proxy or framework parses and re-serializes the body before verification, which breaks the signature on the raw bytes.

Check the secret first. It takes a minute and explains most cases.

### Should I poll the Stripe API instead of using webhooks?

Don't make polling your primary trigger. It adds delay, burns rate limit, and misses the moment something changed. Use webhooks to learn that something happened, and use the API to fetch current state when handling the event.

For events your endpoint was down for, a scheduled reconciliation job that lists recent objects is a sensible safety net. If you need a synchronous answer inside a request you control, such as confirming a payment before showing a page, call the API directly.

### How do I replay a webhook event that failed?

Stripe retries failed deliveries automatically for a limited period, so first check whether a retry is already pending.

After that, you can resend a specific event from its page in the Dashboard, or with the Stripe CLI's events resend command, which targets an event ID and an endpoint.

Past events can only be fetched from the API for a limited window, so don't treat Stripe as your archive. Store the event ID and raw payload on receipt.

Before you replay anything, make sure your deduplication works, because replays are safe only if it does. Return a 2xx status as soon as the event is verified and recorded, even for a duplicate. Return a non-2xx only when you want Stripe to retry.

## Related reading

- [Webhook Idempotency: How to Handle Duplicate Events (2026)](https://www.activepieces.com/blog/webhook-idempotency-how-to-handle-duplicate-events-2026)
- [Stripe HubSpot Integration: Setup Guide (2026)](https://www.activepieces.com/blog/stripe-hubspot-integration-setup-guide-2026)
- [How to handle errors in production AI agents](https://www.activepieces.com/blog/how-to-handle-errors-in-production-ai-agents)

## References

- [Dev.to (Shannon LLC)](https://dev.to/shannonllc/webhook-timeouts-provider-limits-and-the-acknowledge-first-pattern-412o)
- [Activepieces](https://www.activepieces.com/pricing)
- [Hookdeck](https://hookdeck.com/webhooks/stripe/events)
