| [ Web Proxy ] |
| Viewing: https://docs.stripe.com/event-destinations/eventgrid | [Back] [Original] |
Azure Event Grid is a scalable, fully managed event routing service provided by Microsoft Azure. By integrating with Event Grid using an event destination, you can route Stripe events directly to your Azure infrastructure without needing to manage integration code or infrastructure scaling logic. When Event Grid receives events, it can route them to various event handlersincluding webhooks, Azure functions, or Event Hubto process or trigger business automations.
Stripe generates events when activities occur in your account. These events are sent to Event Grid through an Azure partner topic in your Azure subscription (defined as an event destination on Stripe). Then, Azure event subscriptions route these events to your configured event handlers, which process the data according to your business logic.
Before you can use Event Grid, youll need to register the Event Grid resource provider in your subscription. If youve used Event Grid before in your subscription, skip to the next section to create a partner authorization.
To register the Event Grid resource provider In the Azure portal:
Create a partner authorization in the Azure portal so Stripe has consent to create a partner topic in the subscription and resource group you designate.
Use your live account or sandboxes to send events to Event Grid.
Create an event destination using Workbench in the Dashboard or programmatically with the API.
To create an event destination in the Dashboard:
If you create an event destination in an Organization, select Accounts to listen to events from accounts in your organization or select Connected and v2 accounts to listen to events from your connected and v2 accounts in your organization.
After you set up an event destination, Stripe creates a partner topic in the subscription and region you provided during configuration. You need to activate the partner topic to allow Stripe to send events to the partner topic. Activate the partner topic within 7 days of the event destinations creation. If you dont associate it within this time frame, Azure automatically deletes the partner topic. After a partner topic is deleted, your Stripe event destination is automatically disabled and you must create a new destination to receive events.
In Workbench, click Complete setup in Azure for your event destination to activate your partner topic.
After activating your Stripe partner topic, you must create at least one event subscription with an event handler to receive your Stripe events. An event subscription defines which events from Stripe partner topics are routed to specific event handlers. Without these components, events will be sent to Event Grid and persisted for 24 hours. However, they wont be delivered to any destination.
You can repeat these steps multiple times to define multiple event subscriptions and event handlers:
Your Stripe events are now successfully delivered to your partner topic and its corresponding event handlers.
To send test events, trigger an event type that your event destination is subscribed to by manually creating an object in the Stripe Dashboard. Learn how to trigger events with Stripe for VS Code.
You can use the following command in either Stripe Shell or Stripe CLI. This example triggers a payment_intent.succeeded event:
stripe trigger payment_intent.succeeded Running fixture for: payment_intent Trigger succeeded! Check dashboard for event details.
Thin events are notifications that include reference information about the API resource related to the event. When you send them to Azure Event Grid, you can use that information to fetch the full event or API resource object (also known as event hydration). In the Azure portal, you can set up this process by configuring event subscriptions using the supported event handlers of your choice. When you send thin events to webhook endpoints, you must fetch the complete event or resource data yourself using the API. This process provides you with fresh data by fetching the current state of the resource associated with every event.
This section helps you understand different behaviors to expect regarding how Stripe sends events to Azure Event Grid.
Stripe attempts to deliver events to your destination for up to three days with an exponential back off in live mode. View when the next retry will occur, if applicable, in your event destinations Event deliveries tab. We retry event deliveries created in a sandbox three times over the course of a few hours. If your destination has been disabled or deleted when we attempt a retry, we prevent future retries of that event. However, if you disable and then re-enable the event destination before were able to retry, you still see future retry attempts.
You cant manually resend events to Azure Event Grid.
Stripe doesnt guarantee the delivery of events in the order that theyre generated. For example, creating a subscription might generate the following events:
customer.subscription.createdinvoice.createdinvoice.paidcharge.created (if theres a charge)Make sure that your event destination isnt dependent on receiving events in a specific order. Be prepared to manage their delivery appropriately. You can also use the API to retrieve any missing objects. For example, you can retrieve the invoice, charge, and subscription objects with the information from invoice.paid if you receive this event first.
The API version in your account settings when the event occurs dictates the API version, and therefore the structure of an Event sent to your destination. For example, if your account is set to an older API version, such as 2015-02-16, and you change the API version for a specific request with versioning, the Event object generated and sent to your destination is still based on the 2015-02-16 API version. You cant change Event objects after creation. For example, if you update a charge, the original charge event remains unchanged. As a result, subsequent updates to your accounts API version dont retroactively alter existing Event objects. Retrieving an older Event by calling /v1/events using a newer API version also has no impact on the structure of the received event. You can set test event destinations to either your default API version or the latest API version. The Event sent to the destination is structured for the event destinations specified version.
Event Grid destinations have several statuses that describe their readiness to receive events:
Event Grid delivers events using the CloudEvents schema (v1.0), which is an open specification for standardizing event data interchange. When you receive Stripe events through Event Grid, the original Stripe event JSON object will be wrapped in the data property within the CloudEvents envelope.
Heres an example of a v1.billing.meter.error_report_triggered event delivered through Event Grid:
{ "specversion": "1.0", "type": "v1.billing.meter.error_report_triggered", "source": "/providers/stripe/ed_test_61StH5LQO42M712JD16Sr8c00mSQTEEmwCfiQq4wqQc4", "id": "9aeb0fdf-c01e-0131-0922-9eb54906e209", "time": "2025-07-11T14:30:00Z", "subject": null, "dataContentType": "application/cloudevents+json", "data": {
Stripe sends most event types asynchronously; however, for certain event types, Stripe waits for a response. The presence or absence of a response from the event destination directly influences Stripes actions regarding these specific event types.
Event Grid destinations provide limited support for event types that require a response:
issuing_authorization.request event type for Event Grid destinations. Instead, set up a webhook endpoint to subscribe to this event type. Use issuing_authorization.request to authorize purchase requests in real-time. This requires your destination to approve or decline requests by responding to the event. Event Grid handles the response to Stripe before sending it to your consumers. As a result, this destination type cant use this event type to authorize any payments.checkout_sessions.completed when using Event Grid. However, this doesnt handle redirect behavior when you embed Checkout directly in your website or redirect customers to a Stripe-hosted payment page. Delivering a checkout_sessions.completed event to Event Grid wont affect redirect behavior. To change Checkout redirect behavior, process this event type with a webhook endpoint.| Web Proxy Viewer | New URL | Original Page |