Stripe webhook events overview
Webhooks allow you to automate custom backend actions in response to the transitions that happen in a payment flow.
Why use webhooks
Let’s say you’ve registered to receive the checkout.session.completed
event and a customer clicks the “Pay” button in your app or website. A webhook between Stripe and your app tells your app whether the customer’s payment is successful or not. After your webhook endpoint receives the checkout.session.completed
event, your webhook function can then run backend actions to fulfill an order–such as calling your shipping provider’s APIs to schedule a shipment. Using an API for this workflow is like calling the API every millisecond to ask, was the payment successful?
Events overview
Events are our way of letting you know when something interesting happens in your account. When an event occurs, we create a new Event object. If you registered a webhook endpoint to receive that event, we send it to your endpoint as part of a POST request.
{ "object": { "id": "in_1KnN0G589O8KAxCGfVSpD0Pj", "object": "invoice", "account_country": "US",
How events are logged
This table describes the different ways Stripe logs an Event for your account.
Source | Trigger | Events |
---|---|---|
API | When user actions in your app or website result in an API call. | Logs one or more events on the Events page. |
Dashboard | When you call an API by modifying your Stripe resources in the Stripe Dashboard. | Logs one or more events on the Events page. |
API | When you manually trigger an event with the Stripe CLI. | Logs one or more events on the Events page. |
API | When you call an API directly with the Stripe CLI. | Logs one or more events on the Events page. |
See also
- Learn how to stream events as they happen in your account.
- Learn how to get started with webhooks by building a webhook endpoint.