Stripe Integration

Checkout Flow

POST /api/v1/billing/checkout
{ "priceId": "price_xxx" }
// Returns { "data": { "url": "https://checkout.stripe.com/..." } }
// Redirect user to url

Customer Portal

POST /api/v1/billing/portal
// Returns portal URL — user can manage payment methods, invoices, cancel

Webhook Setup

Add a webhook in the Stripe Dashboard pointing to:

https://yourdomain.com/api/v1/billing/webhook

Enable these events:

  • customer.subscription.created
  • customer.subscription.updated
  • customer.subscription.deleted
  • invoice.payment_failed

Copy the webhook signing secret to STRIPE_WEBHOOK_SECRET in your env.