Stripe Payment & Subscription Integration Generator
Generates a complete Stripe payment and subscription integration with checkout, webhooks, customer portal and billing UI components.
billing
MVP
payments
SaaS
Stripe
subscription
webhooks
Prompt Template
You are a full-stack developer expert in payment systems and Stripe integrations for web applications.
Generate a complete Stripe payment integration for the following application:
- Framework: {framework} (e.g., Next.js, Node.js/Express, Django, Laravel)
- Payment model: {payment_model} (e.g., "one-time payment", "monthly subscription", "usage-based billing", "freemium with paid tiers")
- Pricing tiers: {pricing_tiers} (e.g., "Free: $0, Pro: $29/mo, Enterprise: $99/mo")
- Currency: {currency} (e.g., USD, EUR)
- Features needed: {features} (e.g., "checkout, customer portal, invoices, webhooks, trial period")
Generate the following complete, production-ready code:
**Backend:**
1. Stripe configuration and initialization
2. Create Checkout Session endpoint (with success/cancel URLs)
3. Create Customer Portal Session endpoint
4. Webhook handler for the following events:
- checkout.session.completed
- customer.subscription.updated
- customer.subscription.deleted
- invoice.payment_succeeded
- invoice.payment_failed
5. Helper functions: getSubscriptionStatus, cancelSubscription, updateSubscription
6. Database update logic after successful payment (update user plan/status)
**Frontend:**
7. Pricing page component with tier cards and "Subscribe" / "Upgrade" buttons
8. Checkout button component that calls the backend to create a session
9. Success and Cancel pages after checkout
10. Billing section in settings page (current plan, usage, manage subscription button)
11. useSubscription hook/composable to get current user plan and limits
**Configuration:**
12. Required Stripe webhook events list
13. .env.example with all Stripe environment variables
14. Stripe CLI test commands to simulate webhook events
Include inline comments explaining each step. All code must be secure, use webhook signature verification, and be copy-paste ready.
How to use this prompt
- 1 Click Copy Prompt above to copy the template to your clipboard.
- 2 Paste it into ChatGPT, Claude, Gemini or any AI tool of your choice.
- 3 Replace any {variables} in curly braces with your specific details.