Webhooks
Stripe Connection Webhook
Receive Stripe webhook events for a workspace’s own connected Stripe account.
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. Thetype 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
Returns200 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
Errors
Errors use the standard envelope — see Errors.
Authorizations
Headers
Stripe webhook signature header.
Path Parameters
The tenant's Stripe gateway-connection id.
Body
application/json
Raw Stripe event payload.