Skip to content
Create account or Sign in
The Stripe Docs logo
/
Ask AI
Create accountSign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer resources
APIs & SDKsHelp
Overview
Get started with Connect
Design your integration
Integration fundamentals
    Make API calls for connected accounts
    Integration recommendations
    Migrate to a supported configuration
    Configure the behavior of connected accounts
    Use the Accounts v2 API in your existing integration
    Listen for updates
    Testing
Example integrations
Account management
Onboard accounts
Configure account Dashboards
Capabilities and information requirements
Work with connected account types
Payment processing
Accept payments
Pay out to accounts
Platform administration
Manage your Connect platform
Tax forms for your Connect platform
United States
English (United States)
  1. Home/
  2. Platforms and marketplaces/
  3. Integration fundamentals

Connect webhooks

Learn how to use webhooks with Connect to be notified of Stripe activity.

Stripe uses webhooks to notify your application when an event happens in your account. All Connect integrations should establish a webhook endpoint to listen for Connect events.

Connect webhooks

Webhooks for Connect users listen for events in different scopes, depending on the source of the event:

  • Your account: Most events triggered by resources that exist in your account. That includes most requests made using your API keys and without authenticating as another Stripe account, such as:
    • v2.core.account.* events for v2 Accounts in your account
    • Events for Customers in your account
    • Events for direct charges on your account
    • Events for indirect charges on your account for your connected accounts
  • Connected accounts: Events triggered by resources that exist in connected accounts and some resources that exist in your account, such as:
    • v2.core.account.* events for v2 Accounts representing customers and recipients of your connected accounts
    • v1 account.updated events for both v1 and v2 Accounts representing customers and recipients of your connected accounts
    • Direct charges for customers of your connected accounts

Event scopes for v2 Accounts representing connected accounts

v2 Account objects trigger both v1 and v2 Events, which can have different scopes. For events triggered by connected accounts, v2 Events use the Your account scope, while v1 Events use the Connected accounts scope, even when triggered by the same v2 Account.

When you create a webhook in Workbench, assign the scope by setting Events from to Your account or Connected accounts. When you create a webhook using the API, assign the scope by setting the connect parameter to false (for Your account) or true (for Connected accounts).

For Connect webhooks, your development webhook URLs receive only test webhooks, but your production webhook URLs receive both live and test webhooks. This is because you can perform both live and test transactions under a production application. We recommend that you check the livemode value when receiving an event webhook to determine whether users need to take action.

You must define separate webhook endpoints for your sandbox accounts to receive events for those accounts.

Each event for a connected account contains a top-level account property that identifies the connected account. Because the connected account owns the object that triggered the event, you must make API requests for that object as the connected account.

{ "id":
"{{EVENT_ID}}"
, "livemode": true, "object": "event", "type": "customer.created", "account":
"{{CONNECTED_ACCOUNT_ID}}"
, "pending_webhooks": 2, "created": 1349654313, "data": {...} }

The following table describes some of the most common and important events related to connected accounts:

Eventdata.object typeDescription
account.application.deauthorizedapplicationOccurs when a connected account disconnects from your platform. You can use it to trigger cleanup on your server. Available for connected accounts with access to the Stripe Dashboard, which includes Standard accounts.
account.external_account.updatedAn external account, such as card or bank_accountOccurs when a bank account or debit card attached to a connected account is updated, which can impact payouts. Available for connected accounts that your platform controls, which includes Custom and Express accounts, and Standard accounts with platform controls enabled.
account.updatedaccountAllows you to monitor changes to connected account requirements and status changes. Available for all connected accounts.
balance.availablebalanceOccurs when your Stripe balance has been updated. For example, when funds you’ve added from your bank account are available for transfer to your connected account.
payment_intent.succeededpayment_intentOccurs when a payment intent results in a successful charge. Available for all payments, including destination and direct charges.
payout.failedpayoutOccurs when a payout fails. When a payout fails, the external account involved is disabled, and no automatic or manual payouts can be processed until the external account is updated.
person.updatedpersonOccurs when a Person associated with the Account is updated. If you use the Persons API to handle requirements, listen for this event to monitor changes to requirements and status changes for individuals. Available for connected accounts that your platform controls, which includes Custom and Express accounts, and Standard accounts with platform controls enabled.
server.rb
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
# Using Sinatra. require 'sinatra' require 'stripe' set :port, 4242 # Don't put any keys in code. See https://docs.stripe.com/keys-best-practices. # Find your keys at https://dashboard.stripe.com/apikeys. client = Stripe::StripeClient.new(
'sk_test_BQokikJOvBiI2HlWgH4olfQ2'
) # If you're testing your webhook locally with the Stripe CLI, you # can find the endpoint's secret by running `stripe listen` # Otherwise, find your endpoint's secret in your webhook settings in # the Developer Dashboard endpoint_secret = 'whsec_...' post '/webhook' do payload = request.body.read sig_header = request.env['HTTP_STRIPE_SIGNATURE'] event = nil # Verify webhook signature and extract the event. # See https://stripe.com/docs/webhooks#verify-events for more information. begin event = Stripe::Webhook.construct_event( payload, sig_header, endpoint_secret ) rescue JSON::ParserError => e # Invalid payload. status 400 return rescue Stripe::SignatureVerificationError => e # Invalid Signature. status 400 return end if event['type'] == 'account.application.deauthorized' application = event['data']['object'] connected_account_id = event['account'] handle_deauthorization(connected_account_id, application) end status 200 end def handle_deauthorization(connected_account_id, application) # Clean up account state. puts 'Connected account ID: ' + connected_account_id puts application.to_s end

Test webhooks locally

To test event webhooks locally with the Stripe CLI:

  1. If you haven’t already, install the Stripe CLI on your machine.

  2. Log in to your Stripe account and set up the CLI by running stripe login on the command line.

  3. Allow your local host to receive a simulated event by running stripe listen, depending on the scope of the event:

    • Connected accounts: stripe listen --forward-connect-to localhost:{{PORT}}/{{CONNECT_WEBHOOK_ENDPOINT}}
    • Your account: stripe listen --forward-to localhost:{{PORT}}/{{WEBHOOK_ENDPOINT}}
  4. In another terminal window, trigger a simulated event by running stripe trigger, depending on the scope of the event:

    • Connected accounts: stripe trigger --stripe-account {{CONNECTED_ACCOUNT_ID}} {{EVENT_NAME}}
    • Your account: stripe trigger {{EVENT_NAME}}

See also

  • Webhook documentation
  • Event object reference
Was this page helpful?
YesNo
  • Need help? Contact Support.
  • Chat with Stripe developers on Discord.
  • Check out our changelog.
  • Questions? Contact Sales.
  • LLM? Read llms.txt.
  • Powered by Markdoc