Stripe Integration
Checkout Flow
POST /api/v1/billing/checkout
{ "priceId": "price_xxx" }
// Returns { "data": { "url": "https://checkout.stripe.com/..." } }
// Redirect user to urlCustomer Portal
POST /api/v1/billing/portal
// Returns portal URL — user can manage payment methods, invoices, cancelWebhook Setup
Add a webhook in the Stripe Dashboard pointing to:
https://yourdomain.com/api/v1/billing/webhookEnable these events:
customer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_failed
Copy the webhook signing secret to STRIPE_WEBHOOK_SECRET in your env.