Enable Billing & SaaS Monetization
Complete guide on connecting Stripe, creating subscription & one-time plans, enforcing table row limits, and user billing portals.
Enable Billing & SaaS Monetization
NoCodeBackend provides a complete, turnkey monetization engine that turns any database into a multi-tiered SaaS application in minutes. With zero backend billing code or manual webhook configuration required, you can connect your Stripe account, create recurring subscriptions or one-time payment plans, and enforce database table row limits automatically.
How It Works
- Direct Payouts: Connect your Stripe account via Stripe Connect. Customer payments and subscriptions go directly to your Stripe account.
- Plan & Limit Enforcement: Set maximum row limits per table for each plan (e.g., Free tier gets 5 projects, Pro tier gets 500 projects). NoCodeBackend automatically enforces these limits on your create operations.
- Turnkey End-User UI: The
@nocodebackend/account-reactcomponent provides a pre-built Billing tab where your users can view their active plan, upgrade/downgrade, and open the Stripe Customer Portal to manage cards and invoices.
Step 1: Open Enable Billing
- Go to your NoCodeBackend Dashboard → My databases.
- Click the 3 dots (⋮) menu on the database card you want to monetize.
- Select "Enable billing" (or navigate to
/databases/<your-database>/monetization).
Step 2: Connect Your Stripe Account
- On the Enable Billing page, click Connect with Stripe.
- Complete the Stripe Connect onboarding flow to link your bank account for customer payouts.
- Database Isolation & Account Reuse:
- Each database on NoCodeBackend can have its own dedicated Stripe account.
- If you have already connected a Stripe account for another database, you can select "Use existing account" to link the same Stripe account with one click.
Step 3: Turn On SaaS Monetization
- Toggle the Enable SaaS Monetization switch to ON.
- Once enabled, you can immediately begin creating pricing plans and setting usage limits for your application.
Step 4: Create Pricing Plans
Click Add Plan to configure your pricing tiers with the following options:
- Plan Name: The display name of your tier (e.g.,
Starter,Pro, orLifetime Deal). - Billing Type:
Recurring: For monthly or annual subscription plans.One-Time: For lifetime access, credit packs, or standalone purchases.
- Interval (for recurring plans): Choose
MonthorYearbilling frequency. - Price & Currency: Set your price and select the currency (e.g.,
$19.00 USD). - Free Plan: Check this box if the tier is a $0 free plan.
Setting a Default Plan
In the Default Plan dropdown, select which plan new users are automatically assigned when they register in your application (typically your Free tier).
Step 5: Configure Table Row Limits
Enforce feature paywalls by setting the maximum number of records users on a given plan can create in specific tables.
- Under your chosen plan, click Add Limit.
- Select the Table to restrict (e.g.,
projects,documents,tasks). - Set the Max Rows:
- Enter a specific number (e.g.,
5for Free,500for Pro). - Leave blank or set to
Unlimitedfor no row restrictions.
- Enter a specific number (e.g.,
- Set a Feature Label (e.g.,
Active Projects) to display as a user-friendly label on your user's billing dashboard.
How Row Limits Are Enforced
When an end user attempts to create a record in your application:
- Within Quota: The record is created successfully.
- Quota Exceeded: NoCodeBackend returns a
402 Payment Requiredresponse with an upgrade notice, protecting your database against unauthorized usage.
Step 6: Customer Checkout & Billing UI
Option A: Using the @nocodebackend/account-react Component (Recommended)
If you installed the @nocodebackend/account-react package in your app, your users automatically get a complete customer billing dashboard:
- Billing Tab: Displays their active plan, live usage progress bars against table quotas, and available upgrade options.
- 1-Click Checkout: Clicking Upgrade redirects directly to Stripe Checkout with your app's return URLs handled automatically.
- Stripe Customer Portal: Active subscribers see a Manage Billing button that opens Stripe's hosted portal where they can update payment methods, download invoices, or cancel their subscription.
Option B: Custom Frontend Checkout API
If you are building a custom pricing page or billing UI in your frontend, initiate checkouts using the API proxy:
// Trigger checkout session
const res = await fetch("/api/ncb/account/billing/checkout", {
method: "POST",
headers: { "Content-Type": "application/json" },
credentials: "include",
body: JSON.stringify({
plan_id: "YOUR_PLAN_ID",
success_url: window.location.origin + "/dashboard?payment=success",
cancel_url: window.location.origin + "/dashboard?payment=cancelled",
})
});
const { url } = await res.json();
if (url) window.location.href = url;
Step 7: Automatic Webhook Sync
You do not need to configure any webhook endpoints in Stripe! NoCodeBackend automatically receives and verifies Stripe webhook events in the background:
- Subscription Created / Renewed: Instantly updates user access and billing cycle dates.
- Subscription Cancelled: Automatically downgrades the user back to your default Free plan.
- Payment Failed: Marks the subscription as past due so your app can prompt for updated payment details.
