Skip to main content

Overview

The Stripe Webhook source receives events from your Stripe account at a dedicated HTTPS endpoint and routes each event to a Kafka topic based on its resource type (customers, payment intents, charges, invoices, subscriptions, products, prices, payouts, refunds, etc.). You point Stripe at the Streamkap-generated webhook URL, register the events you care about, and Streamkap takes care of parsing, key extraction, schema inference, and routing. For initial loads or ad-hoc backfills, the source can also snapshot data directly from the Stripe REST API using your Stripe secret key.
This connector is in Beta. Behaviors and defaults may change before general availability.

Prerequisites

  • A Stripe account with Administrator access (required to manage webhooks and API keys).
  • Your Stripe Secret key (sk_live_xxx for production or sk_test_xxx for test mode), available at dashboard.stripe.com/apikeys.
  • A Streamkap workspace with permission to create source connectors.
  • A clear list of the Stripe resources you want to capture (customers, payment intents, invoices, etc.).

How It Works

  1. Endpoint provisioning — When you create the source, Streamkap generates a unique HTTPS webhook URL and an API key.
  2. Stripe subscriptions — In Stripe Workbench, you register a webhook destination pointing at the Streamkap URL with the API key passed as a query parameter, and select the events to deliver.
  3. Event-type routing — Each incoming request carries an event in its JSON body with a type field (customer.created, payment_intent.succeeded, etc.). The Stripe payload router takes the first segment as the resource — customer.* events go to the customer topic, payment_intent.* events go to payment_intent, and so on. The connector extracts data.object as the Kafka record value.
  4. Key extraction — The router pulls the resource id (e.g. cus_abc123, pi_xyz789) from data.object and uses it as the Kafka message key, enabling upsert-style consumption downstream.
  5. Signature verification (recommended) — When you provide the Stripe signing secret (whsec_xxx), each payload is verified against the Stripe-Signature header using HMAC-SHA256. Invalid payloads are rejected and (if configured) routed to the DLQ.
  6. Optional fan-out — Stripe’s list objects (line items, refunds, subscription items) can be fanned out into their own topics.
  7. Optional snapshot — For initial loads or ad-hoc backfills, the source queries the Stripe REST API with cursor pagination and emits records alongside the live webhook stream.

Streamkap Setup

1. Create the Source

  1. Navigate to Sources and choose Stripe.
  2. Give the source a memorable Name (for example, stripe-prod).

2. Connection Settings (Auth tab)

3. Schema (Stripe Resources)

In the Schema tab, choose the resources you want to capture. The default is customer,payment_intent,charge,invoice. A resource is the first segment of the Stripe event type field — for example customer.created, customer.updated, and customer.subscription.created all map to the customer resource. Each resource becomes a Kafka topic of the same name. The dropdown is pre-loaded with the resources most commonly used in billing / SaaS CDC scenarios: Any fan-out topics you configure (see Fan-out) are added automatically.
Advanced — other Stripe resources. Stripe has many more event types than listed above (Issuing, Financial Connections, Identity, Treasury, Climate, Terminal, etc.). The Schema field accepts any resource name — just type the first-segment of the Stripe event type and Streamkap will route it.
Snapshot support is narrower than webhook routing. Only customer, charge, payment_intent, invoice, subscription, product, price, payout, refund, payment_method, balance_transaction, coupon, plan, and setup_intent can be snapshotted via the Stripe REST API. All other resources stream via webhooks only.

4. Settings

5. Save and Copy the Endpoint

Save the source. Copy the Webhook URL and API Key — you will need them in the next section to configure Stripe.

Stripe Setup

Stripe does not support custom headers on webhook deliveries. Pass the Streamkap API key in the destination URL as a query parameter:

1. Get Your API Keys

  1. Go to dashboard.stripe.com/apikeys.
  2. Copy your Secret key (sk_test_xxx for test mode, sk_live_xxx for production).
  3. Use the toggle at the top of the dashboard to switch between test and live mode.
  4. Paste the Secret key into the Streamkap source’s Stripe API Key field in the Auth tab — this lets Streamkap call the Stripe REST API when you run a snapshot.
Note: Stripe replaced the old “Developers → Webhooks” page with Workbench. New accounts use Workbench by default.
  1. Go to dashboard.stripe.com and open Developers → Workbench (or dashboard.stripe.com/webhooks).
  2. Click Add destination (or Create new destination).
  3. Enter your endpoint URL: https://<webhook-url>?api_key=<API_KEY> using the values copied from Streamkap.
  4. Important — choose the “Snapshot” payload format, NOT “Thin” payload. Streamkap requires the full resource object in data.object. Thin-payload events (events whose object is v2.core.event) are not supported and should be left unselected.
  5. Select the events you want to deliver. Recommended starting set:
  1. Click Create.
  2. Open the destination’s detail page and copy the Signing secret (whsec_xxx). Paste it into Streamkap’s Signing Secret field in the Auth tab.

2 (Alternative). Register the Webhook via the Stripe API

For scripted setup, use curl with your Secret key:
The response includes a secret field (whsec_xxx) — copy it into Streamkap’s Signing Secret field. Or subscribe to all snapshot-payload events:

Local Testing with the Stripe CLI

The CLI prints a whsec_xxx signing secret on startup — paste it into Streamkap’s Signing Secret field. Trigger test events with:

Event Routing Reference

The payload router inspects the event type field on each incoming request and routes by the first segment. Events whose action ends in .deleted set __deleted: true on the output record so downstream sinks can issue tombstones. __op is emitted as a Kafka header (c create, u update, d delete, r snapshot). Each record additionally carries __changeType (CREATE, UPDATE, DELETE, SUCCEEDED, FAILED, REFUNDED, PAID, FINALIZED, SNAPSHOT, …) in the value.

Fan-out

Stripe resources contain nested list objects ({object: "list", data: [...]}) for line items, refunds, and subscription items. Most warehouse destinations can’t store these cleanly as a single column. Fan-out emits one record per list element to a dedicated topic so each child becomes its own row. Set Fan-out Fields to a comma-separated list from the allowed set:
Fan-out topics are added to the Schema list automatically — you do not need to register them manually. Each fan-out record contains the list element’s fields plus a _ctx_event_id for correlation back to the parent Stripe event.
Fan-out topics do not emit tombstone records when list items are removed (for example when a line item is removed from an invoice). To handle deletions, configure the downstream sink for delete-and-reinsert on each parent event, or treat each parent record as the source of truth and full-replace the child rows.

Signature Verification

Stripe signs every webhook with HMAC-SHA256. Streamkap parses the Stripe-Signature header (t=timestamp,v1=hex_signature) and verifies the payload against the signing secret you provide. To enable verification, paste your destination’s signing secret (whsec_xxx) into the Auth tab’s Signing Secret field. The connector checks all v1 signatures sent during secret rotation, so you can rotate without downtime. Leave the field empty only when testing — anyone who knows the connector URL could otherwise submit fake events.

Snapshot

Once your source is live, you can run a snapshot from the Streamkap UI to load historical data for selected resources. Webhook streaming continues to run in parallel — snapshot is a one-time backfill, not an alternative to live events.

Snapshottable Resources

Only these resources can be snapshotted via the Stripe REST API: All other resources you select in the Schema tab (checkout, quote, credit_note, transfer, etc.) cannot be snapshotted — they only receive live events via webhooks once you register them in Stripe. This is a limitation of the Stripe REST API, which exposes historical-fetch endpoints only for the resources above.

Troubleshooting

Limitations

  • The Stripe Webhook source is currently Beta.
  • Stripe expects a 2xx response promptly. The connector responds immediately and processes asynchronously; failures are captured in the DLQ when enabled.
  • Snapshot supports only the 14 resources listed above. Other resources (checkout, quote, credit_note, transfer, etc.) are streamed via webhooks only.
  • Only Stripe’s Snapshot (v1) payload format is supported. Thin payloads (v2.core.event) are not processed.
  • Stripe does not guarantee event ordering. Use the _event_created timestamp for ordering and _event_id for deduplication.
  • Maximum payload size is 50 MB and maximum header size is 64 KB.
  • The connector runs as a single task; horizontal scaling requires multiple source instances.

See Also