Your SaaS starter boilerplate supports both one-time payments and recurring subscriptions. All payments are powered by Stripe, the most popular and secure payment platform.
This guide explains how payments are structured, why we use Stripe, and how you can manage different payment models for your SaaS.
Payments
Introduction to Payments
Payments are a critical part of any SaaS business. They allow you to:
- Monetize your app
- Offer flexible pricing to users
- Track revenue and subscriptions
In this boilerplate, payments are fully integrated with Stripe, allowing you to process transactions safely and reliably.
Why Stripe
Stripe is chosen because it is:
- Secure and PCI compliant
- Flexible for both one-time and subscription payments
- Well-documented with extensive API support
- Supports multiple payment methods (cards, wallets, etc.)
Using Stripe ensures your users have a smooth checkout experience and your financial operations are robust.
Payment Models Supported
This starter boilerplate supports two types of payments:
1️⃣ One-Time Payments
- Ideal for selling a single product or service.
- User is charged once and gains access to the product.
- Example: Paying for an eBook or a one-time setup fee.
2️⃣ Subscription Payments
- Ideal for recurring SaaS plans (monthly/yearly).
- User is charged on a regular interval automatically.
- Example: Starter, Pro, and Business plans with recurring billing.
You can choose which payment model suits your app or even offer both simultaneously.
How It Works in This Boilerplate
- Stripe integration is pre-configured for both payment types.
- Subscription plans are stored in
/config/landing.ts(seeplansarray). - Payment processing uses Stripe Checkout sessions for simplicity and security.
- Webhooks are set up to handle subscription events (e.g., renewals, cancellations).
Note: You will need a Stripe account and API keys configured in your .env file.
Next Steps
- Configure your Stripe API keys in the
.envfile. - Customize your plans and pricing in
/config/landing.ts. - Learn about the Stripe Checkout flow and webhook handling.
This setup allows you to accept payments safely and start monetizing your SaaS immediately.
Tips
- Always test payments in Stripe’s test mode before going live.
- Keep your plan IDs and pricing consistent between
/config/landing.tsand Stripe. - Use descriptive webhook events to handle subscription updates programmatically.