Integrate a Payment System
Add subscription payments with checkout, webhooks, and billing management using Stripe, Polar, or Lemon Squeezy.
10-15 min|Intermediate
BuildDeep WorkDeveloperFounder
Prompt Template
Add subscription payments to my app. Check my project for any existing payment setup, then recommend and integrate the best option (Stripe, Polar, or Lemon Squeezy). Plans: [list your pricing tiers with prices] Example: - Free: $0 (limited features) - Pro: $15/month or $90/year - Team: $15/seat/month, minimum 2 seats Requirements: 1. Checkout: redirect to hosted checkout page with the selected plan 2. Webhooks: handle checkout.completed, subscription.updated, subscription.canceled 3. Store subscription state in my database: plan, status (active/canceled/past_due), current period end 4. Billing portal: link to hosted billing page for customers to manage their subscription 5. Entitlement: a helper function isSubscribed(userId) that checks if the user has an active subscription 6. Free trial: [yes/no, if yes: how many days] Webhook security: verify the webhook signature before processing. Do NOT store credit card details in my database. All payment data stays with the payment provider. Do NOT build a custom checkout form. Use the hosted checkout." **Output format:** Checkout API route + webhook handler + database schema + entitlement helper.
Payment integrations fail when they miss the webhook handler or don't properly verify signatures. This prompt makes both explicit requirements.
When adding paid features to your app. Start with a simple monthly plan and expand later.