Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Overview
Versioning
Changelog
Upgrade your API version
Upgrade your SDK version
Developer tools
SDKs
API
Testing
Workbench
Event Destinations
    Integrate with events
    Amazon EventBridge
    Webhook endpoint
Workflows
Stripe CLI
Stripe Shell
Developers Dashboard
Agent toolkit
Stripe health alertsBuilding with LLMsStripe for Visual Studio CodeFile uploads
Security
Security
Extend Stripe
Stripe Apps
Stripe Connectors
Partners
Partner ecosystem
Partner certification
HomeDeveloper toolsEvent Destinations

Integrate with events

Send events from Stripe to webhook endpoints and cloud services.

Copy page

Set up an event destination to receive events from Stripe across multiple destination types, including webhook endpoints, and Amazon EventBridge.

Additionally, you can use thin events created by API v2 endpoints. The SDKs for API v2 includes helpers that allow your application to fetch the latest object state from Stripe.

Use cases

When building Stripe integrations, you might want your applications to receive events in real-time from your Stripe accounts, enabling your backend systems to respond and perform actions accordingly.

With an event destination, Stripe pushes real-time event data from your account, enabling you to run backend actions, such as:

  • Sending users a notification when a customer confirms a payment
  • Initiating an internal claims reconciliation process when a customer disputes a charge
  • Granting access to your user when they make successful recurring subscription payments

Supported destination types

Send events to an AWS account using Amazon EventBridge, or deliver them to an HTTPS endpoint through webhook endpoints.

Events overview

Stripe generates event data to keep you informed about the activity in your account.

When an event occurs, Stripe generates a new Event object. After your destination receives the Event, your app can run backend actions (for example, calling your shipping provider’s APIs to schedule a shipment after you receive a payment_intent.succeeded event). We provide two different types of Event objects:

  • Thin events: These events only include the ID of the affected objects. These are generated by API v2 endpoints. API v1 endpoints also generate thin events. See a full list of thin events.
  • Snapshot events: These events provide an eventually-consistent snapshot of the object that has changed and are only generated by API v1 endpoints. They might include a previous_attributes property that indicates the change when applicable. See a full list of snapshot events.

This table outlines high-level differences across thin events and snapshot events.

CharacteristicsSnapshot eventsThin events
Created byAPI v1 resource state changesAPI v2 resource state changes
PayloadLarge: Includes a snapshot of the API object related to the eventSmall: Only includes an ID of the API object related to the event
Access additional data to process event.Fetch the latest object definition from the API. The object definition in the event payload might be outdated by the time you process the event.Fetch the latest object from the API or retrieve the full event from v2/events. The full event payload may include extra details about the event. For example, the payload for a v1.billing.meter.error_report_triggered event includes information about the types and frequency of errors raised.
SDK typingUntypedTyped
VersioningVersioned by API versionUnversioned, allowing you to upgrade your integration without changing your webhook endpoint configuration

A single API request might result in the creation of multiple events. For example, creating a new subscription for a customer might result in customer.subscription.created and payment_intent.succeeded events. Select the events you want to subscribe to for each event destination.

Thin events

Thin events are lightweight events you can access through the API v2 namespace. Thin events have a more granular permissions model and their payloads contain no API-versioned data, only the IDs of the objects related to the event. This helps update integrations that receive events and are built with a well-typed Stripe SDK. Thin Events:

  • Include a data property that can include additional information about the event.
  • Are fully typed in the SDKs for API v2.

You can retrieve Event objects for each notification from the /v2/core/events endpoint. These API objects include the data property that can provide additional details about the thin event.

Prevent application errors

If your application needs a corresponding API object related to an event (for example, the Meter), you must call the Stripe API for the object’s latest state. Although this method requires an additional network call to Stripe, it helps prevent application errors caused by outdated object data (for example, race conditions). The SDKs for API v2 contain helper methods that allow you to retrieve records associated with an event.

Example thin event payload

The following is an example of an v1.billing.meter.error_report_triggered event. The related_object field includes the id of the object, but doesn’t include the object record itself.

{ "id": "evt_test_65R9Ijk8dKEYZcXeRWn16R9A7j1FSQ3w3TGDPLLGSM4CW0", "object": "v2.core.event", "type": "v1.billing.meter.error_report_triggered", "livemode": false, "created": "2024-09-17T06:20:52.246Z", "related_object": { "id": "mtr_test_61R9IeP0SgKbYROOx41PEAQhH0qO23oW", "type": "billing.meter", "url": "/v1/billing/meters/mtr_test_61R9IeP0SgKbYROOx41PEAQhH0qO23oW" } }

Example snapshot event payload

View the following example of an setup_intent.created snapshot event, which includes the object definition as it was when the event was raised:

{ "id": "evt_1NG8Du2eZvKYlo2CUI79vXWy", "object": "event", "api_version": "2019-02-19", "created": 1686089970,

Retrieve additional information associated with a thin event

There are two types of information you can retreive related to a thin event:

  • Related object resource definition: Each thin event details a specific occurrence related to a Stripe object. Use the fetchRelatedObject() method to retrieve the latest version of the object associated with the event. For example, if you receive a v1.billing.meter.error_report_triggered event, fetchRelatedObject() retrieves the current version of the meter object that triggered an error report.
  • Additional event payload fields: Thin events might contain additional contextual data that’s only retrievable with the API. Use the retrieve() call with the thin event ID to retrieve these additional payload fields. For example, fetching a v1.billing.meter.error_report_triggered event with the API return an additional data hash. This hash includes contextual fields about the errors triggered, such as the time the validation error occurred, a list of sample error messages, and the number of validation errors.

The following example demonstrates how to retrieve the related object definition and additional event payload fields associated with a thin event:

Java
com.stripe.model.ThinEvent thinEvent = client.parseThinEvent(payload, signatureHeader, endpointSecret); com.stripe.model.v2.Event event = client.v2().core().events().retrieve(thinEvent.getId()); if (event instanceof V1BillingMeterErrorReportTriggeredEvent) { V1BillingMeterErrorReportTriggeredEvent postedEvent = (V1BillingMeterErrorReportTriggeredEvent) event; // On each type of event, the Stripe library provides a "fetchRelatedObject" method // that performs a network request to Stripe to fetch the latest version // of the object directly associated with the event, in this case, an // "Meter" object. Meter op = postedEvent.fetchRelatedObject(); }

Event permissions

To view an event in the Dashboard, assign the Admin or Developer role to your user account. To retrieve an event using the API, use either a secret API key, which allows you to view all event types by default, or a restricted API key with Read access enabled for the specific event type’s resource. For example, you can grant Read access to payment_intent resources on your restricted API key to programmatically retrieve payment_intent.succeeded events.

Event retention

In the Events tab in Workbench, you can access events within the last 13 months:

  • For events less than 15 days old, you can view the full event payload, see the delivery attempts, and manually resend these events.
  • For events 16-30 days old, you can access the full event payload, but you can’t resend them or view delivery attempts.
  • For events older than 30 days, you can only see a summary view, which includes truncated fields of the original event data. Resending and viewing delivery attempts aren’t available for these events.

Use the Retrieve event and List events APIs to access events with their full payload from the past 30 days.

Event destination limits

You can register a maximum of 16 event destinations in each livemode or sandbox account. When registering a snapshot event destination with a version different from your merchant’s default version, you can register up to three uniquely versioned snapshot event destinations.

Manage an event destination

To create, delete, and update an event destination in the Dashboard, open the Webhooks tab in Workbench or use the event destinations API.

Disable an event destination

You can disable an event destination. After you disable it, Stripe stops sending any events to that destination. After you re-enabled a destination, Stripe resumes sending events to the destination.

Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc