Developers

Stripe webhooks

DevelopersStripe webhooks

BookFlow receives webhooks from Stripe to keep payment status in sync. You don't need to configure anything — when you connect Stripe, BookFlow automatically subscribes to the events that matter.

Endpoint

The Stripe webhook URL is:

https://booking-api.netwit.ca/api/webhooks/stripe

Events handled

The Worker matches on these event types in apps/api/src/routes/webhooks.ts:

EventWhat we do
payment_intent.succeededInsert a row into payments (status 'succeeded') and flip bookings.payment_status to 'paid', amount_paid = total_amount, status = 'confirmed'.
payment_intent.payment_failedSet bookings.payment_status to 'unpaid' where stripe_payment_intent_id matches.
charge.refundedSet payments.status to 'refunded' and update refunded_amount.
account.updatedSync tenants.stripe_charges_enabled and stripe_payouts_enabled from the Stripe account.
any other eventReturns 200 with { received: true, ignored: '<type>' }. The event is not processed.
Events that the docs used to claim are NOT handled
charge.dispute.created, payout.paid, and payout.failed are not matched by the current Worker; they fall through to the generic 200 response. If you need them handled, file an issue.

Signature verification

Stripe signs every request with Stripe-Signature using your webhook signing secret. We verify this signature on every request. You don't need to do anything — it's all on our side.

Idempotency

The Worker does not currently dedupe on stripe-event-id. A payment_intent.succeeded event delivered twice will insert two rows in payments. If you ever see a duplicate row, that's expected. Per-event dedup is on the roadmap.

Replaying events

If a webhook fails (5xx, network error), Stripe retries with exponential backoff for up to 3 days. After that, the event is marked failed in the Stripe dashboard. You can replay it from there.

Testing

Use the Stripe CLI to forward test events: stripe listen --forward-to https://booking-api.netwit.ca/api/webhooks/stripe. Then trigger events with stripe trigger payment_intent.succeeded.

Need a human?

Email hello@netwit.ca or call +1-604-206-8169. NetWit responds in 1 business day.