Stripe Webhooks
Webhooks allow Stripe to notify your app when events happen—like successful payments, subscription changes, or failed charges.Supported Events
Launch handles these webhook events out of the box:| Event | Description |
|---|---|
payment_intent.succeeded | Payment was successful |
payment_intent.payment_failed | Payment failed |
customer.subscription.created | New subscription started |
customer.subscription.updated | Subscription changed (upgrade/downgrade) |
customer.subscription.deleted | Subscription cancelled |
invoice.payment_succeeded | Recurring payment successful |
invoice.payment_failed | Recurring payment failed |
How It Works
- Stripe sends event to your webhook endpoint
- API verifies signature to ensure authenticity
- Handler processes event and updates database
- User sees changes reflected in the app
Webhook Endpoint
Location:apps/api/src/routes/stripe-webhooks.ts
Local Development
For local testing, use ngrok to expose your API:Database Updates
When webhook events are received, the following tables are updated:StripeCustomer- Customer informationSubscription- Subscription status and detailsPayment- Payment history
Debugging
Check your API logs for webhook activity:Test Checklist
- Webhook endpoint responds to Stripe test events
STRIPE_WEBHOOK_SECRETmatches the dashboard- Subscription/payment records update in the database
Troubleshooting
If events are not received, verify ngrok URL and webhook configuration in Stripe Dashboard.Remove / Disable
To disable payments while you configure Stripe, set:apps/mobile/features/feature-registry.tsx → featureFlags.payments = false
For production removal guidance, see Removing Features.
Next Steps
Setup Guide
Configure webhook endpoints and secrets.
Database Schema
View the database models for payment data.