Skip to main content
POST
Stripe webhook receiver (per-connection, BYO)
Per-connection variant of the Stripe webhook receiver for workspaces that connected their own Stripe account with Connect a Gateway. The event is verified with that connection’s own signing secret (resolved from connID) before the payload is trusted. Invoice and credit-note events are bound to the connection’s workspace; subscription, payment-attempt and ACH-return handling are not (see below). Event handling is otherwise identical to the platform receiver.
Each connection has its own URL. Read webhook_path from List Gateway Connections (for example /webhooks/stripe/{connID}), append it to https://api.recurso.dev, and register that URL in the Stripe Dashboard under Developers > Webhooks using the webhook_secret (whsec_...) you supplied when connecting, or set later with Set Gateway Webhook Secret. A connection without a webhook secret cannot verify deliveries and rejects them.

Parameters

Request Body

The raw Stripe event payload. The type field selects the handler: Any other event type is acknowledged without side effects. An invoice named in metadata.invoice_id that belongs to a different workspace than the connection is ignored, never applied, and a refund whose credit note belongs to another workspace is likewise ignored. Three paths are not bound to the connection’s workspace: customer.subscription.deleted resolves the subscription by its Stripe subscription id, payment_intent.payment_failed resolves the payment attempt by its PaymentIntent id, and the ACH-return fallback on the refund events (a succeeded refund with no credit note) resolves the bank-debit payment attempt by its PaymentIntent id and reverses that attempt’s invoice under the attempt’s own workspace. None of those three is checked against the connection’s workspace.

Example Request

Stripe sends a POST request with event data:

Response

Returns 200 OK on successful processing. Unhandled event types, and events whose metadata.invoice_id is missing or malformed, are also acknowledged with ok so Stripe stops redelivering them. A payment_intent.succeeded whose invoice_id matches no invoice is acknowledged the same way; an invoice.payment_failed whose invoice_id matches no invoice is treated as an error and returns 500, so Stripe keeps redelivering it.

Fields

Deduplication keys on the Stripe event id. An event is only recorded as processed after a successful response; a delivery that fails with 5xx is retried by Stripe and reprocessed.

Errors

Errors use the standard envelope — see Errors.

Authorizations

Authorization
string
header
required

Headers

Stripe-Signature
string
required

Stripe webhook signature header.

Path Parameters

connID
string<uuid>
required

The tenant's Stripe gateway-connection id.

Body

application/json

Raw Stripe event payload.

Response

Event processed (or deliberately ignored).

status
enum<string>
Available options:
ok,
ignored
reason
string