Skip to main content

Purpose

Handles Stripe webhook events for subscription management. Updates both database and Clerk organization metadata.

Handled Events

EventAction
checkout.session.completedLink Stripe customer to org, set status active
customer.subscription.createdUpdate subscription status
customer.subscription.updatedUpdate subscription status
customer.subscription.deletedSet status to canceled

Architecture

Signature Verification

Uses STRIPE_WEBHOOK_SECRET to verify webhook authenticity.

Code Location

src/app/webhooks/stripe_webhook/routes.py