Developer tools
Webhooks
Go live

Take webhooks live

Complete your tested webhooks integration by enabling it on production.

After building, testing, and deploying your webhook to production, set up the endpoint so Stripe knows where to send live mode events. It’s also helpful to go through the development checklist to ensure a smooth transition when taking your integration live.

Add your webhook endpoint to your account

Webhook endpoints are configured in the Dashboard’s Webhooks settings page or programmatically using webhook endpoints.

Add endpoints in the Dashboard

Stripe supports two endpoint types, Account and Connect. Create an endpoint for Account unless you’ve created a Connect application.

In the Dashboard’s Webhooks settings section, click Add endpoint to reveal a form to add a new endpoint for receiving events. You can enter any URL as the destination for events. You can choose to be notified of all event types, or only specific ones. You can find a full list of all event types in the API docs.

Add endpoints with the API

You can also programmatically create webhook endpoints. As with the form in the Dashboard, you can enter any URL as the destination for events and which event types to subscribe to. To receive events from connected accounts, use the connect parameter.

The following example creates an endpoint that notifies you when charges succeed or fail.

curl https://api.stripe.com/v1/webhook_endpoints \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d url="https://example.com/my/webhook/endpoint" \ -d "enabled_events[]"="charge.failed" \ -d "enabled_events[]"="charge.succeeded"
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' endpoint = Stripe::WebhookEndpoint.create({ url: 'https://example.com/my/webhook/endpoint', enabled_events: [ 'charge.failed', 'charge.succeeded', ], })
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' endpoint = stripe.WebhookEndpoint.create( url='https://example.com/my/webhook/endpoint', enabled_events=[ 'charge.failed', 'charge.succeeded', ], )
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); $endpoint = \Stripe\WebhookEndpoint::create([ 'url' => 'https://example.com/my/webhook/endpoint', 'enabled_events' => [ 'charge.failed', 'charge.succeeded', ], ]);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; WebhookEndpointCreateParams params = WebhookEndpointCreateParams.builder() .setUrl("https://example.com/my/webhook/endpoint") .addAllEnabledEvent(Arrays.asList( WebhookEndpointCreateParams.EnabledEvent.CHARGE__FAILED, WebhookEndpointCreateParams.EnabledEvent.CHARGE__SUCCEEDED)) .build(); WebhookEndpoint endpoint = WebhookEndpoint.create(params);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const endpoint = await stripe.webhookEndpoints.create({ url: 'https://example.com/my/webhook/endpoint', enabled_events: [ 'charge.failed', 'charge.succeeded', ], });
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.WebhookEndpointParams{ URL: stripe.String("https://example.com/my/webhook/endpoint"), EnabledEvents: stripe.StringSlice([]string{ "charge.failed", "charge.succeeded", }), } endpoint, _ := webhookendpoint.New(params)
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new WebhookEndpointCreateOptions { Url = "https://example.com/my/webhook/endpoint", EnabledEvents = new List<String> { "charge.failed", "charge.succeeded", }, }; var service = new WebhookEndpointService(); var endpoint = service.Create(options);

Manage webhook endpoints

Existing webhook endpoints can be updated or deleted in the Dashboard’s Webhooks settings section. You also have the option of disabling a webhook endpoint temporarily. Stripe does not retry any notifications that are generated while the endpoint is disabled. Alternatively, you can manage webhook endpoints programmatically.

More information

Was this page helpful?
Questions? Contact us.
Developer tutorials on YouTube.
You can unsubscribe at any time. Read our privacy policy.