Skip to main content

Stripe Webhooks Review

Stripe’s webhooks meet all seven criteria we use to judge a webhook implementation. Events are signed with HMAC-SHA256 in a Stripe-Signature header, live-mode deliveries retry for up to three days with exponential backoff, and the Dashboard shows every delivery attempt and response.

If you’re looking for setup steps rather than a critique, see how to set up Stripe webhooks, which covers creating an endpoint, verifying signatures in Node and Python, and testing with the Stripe CLI.

Stripe is a financial services platform and payment infrastructure for the internet. We took a look to see how they’ve designed their offering and how they’ve documented it. When we look at webhook solutions, we’re generally looking for 7 things:

The sections below cover how Stripe handles each one.

Signature verification​

Signature verification is a security feature of webhooks. It lets users verify that a webhook was actually sent from the expected source. Our reference point for it is the Standard Webhooks specification, which defines the standard headers and signing scheme; Stripe’s scheme predates the specification and uses its own header format.

Stripe allows signature verification to ensure the events are not sent by a third party. The events Stripe sends to webhook endpoints can be verified by signatures either using official libraries or manually. Stripe signs every webhook event and includes the signature in the Stripe-Signature header (docs). Each endpoint gets its own signing secret. Verification through the official library is done using the event payload, the Stripe-Signature header, and the endpoint’s secret. Manual verification requires a Stripe-Signature header with timestamp t and a scheme v followed by an integer. Stripe generates signatures using a hash-based message authentication code (HMAC) with SHA-256. The timestamp is part of the signed payload, and Stripe’s libraries reject events more than 5 minutes old by default.

Stripe's signature verification documentation showing the Stripe-Signature header format

Retries​

Stripe has separate retry schedules based on whether you’re in live mode or a sandbox (clever!). In live mode it attempts delivery for up to three days, and in a sandbox it retries three times over a few hours. If an endpoint is disabled or deleted when a retry comes due, Stripe drops the remaining retries for that event.

Exponential backoff​

Exponential backoff is an algorithm that increases the delay between retries exponentially. This ensures that your system won’t get bottlenecked from having to re-queue failed webhooks while also giving users time to fix broken endpoints before they burn through all their retry attempts.

Stripe’s docs state it outright: in live mode, Stripe attempts to deliver an event for up to three days with an exponential back off. The time of the next retry is shown in the destination’s Event deliveries tab. The docs don’t publish the individual intervals.

Looking to send webhooks at scale?

Schedule a Call

Manual retries​

In the event that a user’s endpoint is failing, its nice to give the developer tasked with debugging the endpoint, the option to initiate a retry manually instead of having to wait for the next scheduled retry (this could be several hours of waiting if they’re close to the end of the retry schedule).

Stripe lets you manually resend an event from the Dashboard by clicking Resend on it, for up to 15 days after the event was created. The Stripe CLI’s stripe events resend command works for up to 30 days. Resending an event manually doesn’t cancel Stripe’s automatic retries for it.

Visibility into logs​

In Workbench, each webhook endpoint has an Event deliveries tab. Selecting an event shows the HTTP status code of each delivery attempt and the time of any pending retry. Delivery attempts are viewable for events less than 15 days old.

Event types​

Event types are identifiers denoting the type of message being sent and are the primary way for webhook consumers to configure what events they are interested in receiving.

When something happens in the user’s account or the state of an API resource changes, Stripe creates an Event object to describe it. For instance, if a payment attempt fails, an invoice.payment_failed event is created. Multiple events are created for certain API requests like a new subscription for a customer will lead to a customer.subscription.created event, and a charge.succeeded event. The Event objects are directly sent to an endpoint by a webhooks system. A complete list of types of events is provided here: Event Types.

Multiple endpoint support​

Many webhook solutions only allow one endpoint URL to be specified where all messages will be received. By enabling your users to create multiple endpoints, they’ll be able to choose which endpoints receive which messages. Multiple endpoint support and event types go hand in hand.

You can register up to 16 event destinations with Stripe, and each one selects the event types it wants to receive. A destination can listen to events from your own account or from your connected accounts.

What Stripe gets right, and what to watch​

Stripe’s docs are thorough, and the implementation covers every feature that contributes to a good developer experience: signed payloads, a documented retry policy, manual replay, and a delivery log you can read per event. The one number to plan around is the limit of 16 event destinations per account.

If you’re looking to implement webhooks at Stripe’s level, Svix provides the same webhook infrastructure as a service: signature verification, a retry schedule with exponential backoff, and per-endpoint delivery history behind an API.