Adding Payments to Your Bolt.new App
Monetizing your AI-built app requires Stripe integration. Here's how.
Prerequisites
- A Stripe account (test mode first)
- Your Bolt.new app with user authentication
- A pricing page
Step 1: Install Stripe
In your Bolt.new terminal:
npm install @stripe/stripe-js
Step 2: Create a Checkout Session
Create an API endpoint for Stripe checkout:
"Create a Stripe checkout flow. Add a /api/create-checkout endpoint that creates a Stripe Checkout Session. Build a pricing page with monthly and yearly plans. Handle success and cancel redirect URLs."
Step 3: Webhooks
"Set up Stripe webhook handling for subscription events. Create an endpoint that receives Stripe events and updates user subscription status in the database."
Testing
Always test with Stripe test mode first:
- Card: 4242 4242 4242 4242
- Any future expiry date
- Any CVC
