Webhooks

POST /api/v1/billing/webhook

Stripe sends webhook events to this endpoint. The portal validates the Stripe signature and updates subscriptions and invoices accordingly. You do not call this endpoint directly; configure it as the webhook target in the Stripe dashboard.

Events handled

  • checkout.session.completed
  • customer.subscription.updated
  • customer.subscription.deleted
  • invoice.paid
  • invoice.payment_failed

Signature verification

The endpoint uses the STRIPE_WEBHOOK_SECRET environment variable to verify event signatures. Unverified events are rejected with 400 Bad Request.

Local development

For local testing, Stripe CLI can forward events to http://localhost:3000/api/v1/billing/webhook.