Integrations
Sources
Stripe

Stripe source

Receive Stripe webhook events in Knock to trigger workflows and automate actions based on payment and subscription lifecycle events.

The Stripe source enables you to receive Stripe webhook events directly in Knock. Stripe sends webhook callbacks when events occur in your account, such as a successful payment, a subscription change, or a customer update. Knock verifies each payload using your Stripe webhook signing secret, identifies the event type, and executes the actions you configure.

This integration is useful for building notifications around payment lifecycle events: alerting customers about successful charges, notifying your team about failed payments, or triggering onboarding workflows when new customers are created.

Knock supports ingesting any of Stripe's supported events, so you can map them to actions as your needs evolve.

Prerequisites

#

Getting started

#
1

Create the source in Knock

Navigate to Platform > Sources in the Knock dashboard. Make sure you're in the correct environment. Select the Stripe template as the source type.

The Sources page in the Knock dashboard
2

Select default action mappings

Once you've selected Stripe as a source, you can select your desired action mappings. The defaults map common Stripe events like customer.created to identify users and invoice.created and invoice.paid to trigger workflows. These are helpful defaults to get you started, but Knock can ingest any event Stripe sends and you can adjust your mappings at any time. Click the Connect Stripe button to continue.

The Stripe source creation modal showing default action mappings for incoming events
3

Copy the webhook URL

After creating the source, copy the event ingestion URL from the setup wizard. You will paste this into the Stripe dashboard in the next steps.

The Stripe source setup wizard showing the event ingestion URL to copy
4

Open the Developers Workbench in Stripe

In the Stripe dashboard, click the Developers button in the bottom left corner of the sidebar to open the Workbench.

The Stripe dashboard with the Developers Workbench expanded in the bottom left sidebar
5

In the Workbench, click the Webhooks tab. Click Add destination to start creating a new webhook endpoint.

The Stripe Workbench Webhooks page with the Add destination button
6

Select events to send to Knock

In the "Create an event destination" wizard, select Your account as the event source. Search for and select the events you want to send to Knock (for example, customer.created). Click Continue to proceed.

The Stripe event destination wizard showing event selection with customer.created checked
7

Choose webhook endpoint as the destination type

Select Webhook endpoint as the destination type and click Continue.

The Stripe event destination wizard showing Webhook endpoint selected as the destination type
8

Configure the destination with the Knock URL

Give the destination a name (for example, "Knock"), paste the Knock event ingestion URL you copied earlier into the Endpoint URL field, and click Create destination.

The Stripe event destination wizard showing the destination name and Knock endpoint URL
9

Copy the signing secret into Knock

After creating the destination, Stripe displays the destination detail page with a Signing secret (starts with whsec_). Copy this value and paste it into the Signing secret field in your Knock source environment configuration.

The Stripe Workbench webhook destination detail page showing the signing secret

Once configured, Stripe sends webhook events to Knock in real time. You can verify that events are arriving by checking the event logs on the source environment page.

Testing with the Stripe CLI

#

The Stripe Workbench includes a built-in Shell that you can use to send test events to your webhook endpoint. Use the stripe trigger command followed by the event name to generate a test event:

This creates the necessary fixture data in your Stripe sandbox and sends the corresponding webhook event to all configured destinations, including Knock.

The Stripe Workbench built-in Shell showing stripe trigger commands sending test events

Pre-configured events

#

Stripe sends a wide range of event types. Below are common events you might map to actions in Knock. You can enable or disable individual event types from the source environment configuration.

Event typeDescription
invoice.paidAn invoice payment succeeded
invoice.createdAn invoice was created
customer.createdA new customer was created

See the Stripe event types documentation for the full list of available events.

Customization

#

You can modify the default action mappings or add new ones for any event type Knock receives from Stripe. For details on how field mapping works with dot-notation paths, see the custom source page.

If you need to map Stripe events to actions beyond triggering workflows, see the full list of available actions in the sources overview.

Event idempotency

#

Knock automatically configures idempotency for the Stripe source so duplicate events are not processed twice. By default, Knock uses body.id from the Stripe webhook payload as the idempotency key.

You can change the idempotency key field or disable idempotency checks from the Settings tab in your source environment configuration. Events without an idempotency key attribute are processed normally.

For details on how Knock handles idempotent events, key validation rules, and the default 24-hour idempotency window, see the source event idempotency section of the sources overview.

New chat