Billing & Subscriptions

Subscriptions, trials, and credits via Stripe

Subscription tiers, free trials, usage-based billing, credit systems, plan upgrades, proration, dunning, and webhook handling. BuildBase includes all of it, backed by Stripe.

What's included

Subscription management with plan upgrades, downgrades, and proration. Free trials with automatic conversion. Usage-based billing and credit systems for prepaid API calls.

Payment failure handling with retry logic, grace periods, and customer notifications. Dunning flows that suspend workspaces and restrict features automatically.

Per-workspace invoices with line items. Plan groups for regional pricing. Multi-currency support. Webhook events for every billing state change.

Most teams underestimate billing by 2-3 months. BuildBase moves that timeline to hours.

Billing features

A complete billing system that covers every scenario as your product grows.

Subscription Plans

Tiered subscription plans with versioning. Define pricing, features, limits, and trial periods per plan. Existing subscribers stay on their version until explicitly migrated.

Full Lifecycle Management

Upgrades, downgrades, cancellations, suspensions, and reactivations. Proration calculated automatically. Grace periods enforced. State transitions logged.

Free Trials

Trials convert to paid subscriptions automatically at expiration. Configurable trial duration and optional credit card requirement. Expiration notifications included.

Credit System

Credit packages, promotional grants, and real-time consumption tracking. Credits expire on schedule, balances update instantly, and low-balance alerts fire automatically.

Usage Metering & Quotas

Per-plan limits on any metric: API calls, seats, storage, emails sent. Real-time usage tracking, metered usage sync to Stripe, and automatic overage charges. Quotas reset each billing cycle.

Invoicing

Automated invoices for every billing event. Per-workspace invoice history with line items, taxes, and credits tracked per transaction. Downloadable PDF format.

How it works

Define subscription plans in the BuildBase dashboard — name, price, billing interval, included features, and usage limits. Create plan groups for different pricing in different markets.

When a customer subscribes, BuildBase creates the Stripe subscription, provisions the workspace, applies feature flags, sets usage quotas, and starts tracking metered usage. One API call.

When a payment fails, retries follow Stripe's schedule. The customer receives a notification. Webhook events fire to your application. If the payment ultimately fails, the subscription is suspended and workspace features are restricted automatically.

Every billing event — subscription created, upgraded, payment succeeded, trial ending, credit purchased — fires a system event available via webhooks or workflow triggers.

Stripe integration

BuildBase uses Stripe as the payment processor and adds the business logic Stripe leaves to you — plan transitions, proration, dunning, and subscription state management.

  • Products and prices synced to Stripe automatically
  • Webhook processing for all Stripe events
  • Customer lifecycle management
  • Checkout session creation and handling
  • Subscription state machine with all transitions
  • Payment failure handling with retry logic
  • Metered usage reporting to Stripe
  • Multi-currency and regional pricing support

Hours

To integrate

Most teams spend 2-3 months on billing engineering. Configure plans in the dashboard and start charging in hours.

Full

Revenue visibility

Subscriptions, payments, credits, trials — every billing event is tracked, logged, and available via API.

Automatic

Invoicing

Invoices are generated for every transaction. Per-workspace billing history is always available.

Billing in your code

React hooks for subscriptions, credits, and quotas. Conditional components for paywalls and trial warnings.

Subscriptions — ReactTSX
import {
  useSubscription,
  useTrialStatus,
  useCreateCheckoutSession,
  WhenTrialEnding,
  WhenNoSubscription,
  WhenSubscriptionToPlans,
} from '@buildbase/sdk/react';

function BillingPage({ workspaceId }) {
  const { subscription } = useSubscription(workspaceId);
  const { isTrialing, daysRemaining } = useTrialStatus();
  const { createCheckoutSession } = useCreateCheckoutSession(workspaceId);

  return (
    <>
      <WhenTrialEnding daysThreshold={3}>
        <Banner>{daysRemaining} days left in your trial.</Banner>
      </WhenTrialEnding>

      <WhenNoSubscription>
        <button onClick={() => createCheckoutSession({
          planVersionId: 'pro-v1',
          billingInterval: 'monthly',
        })}>
          Subscribe to Pro
        </button>
      </WhenNoSubscription>

      <WhenSubscriptionToPlans plans={['starter']}>
        <UpgradePrompt />
      </WhenSubscriptionToPlans>
    </>
  );
}
Credits & Quotas — ServerTSX
import BuildBase from '@buildbase/sdk';

const bb = BuildBase({ serverUrl, orgId, getSessionId });

// Record usage and check quota
const usage = await bb.usage.record(workspaceId, {
  quotaSlug: 'api-calls',
  quantity: 1,
});

if (usage.available <= 0) {
  return Response.json(
    { error: 'Quota exceeded' },
    { status: 429 }
  );
}

// Consume credits
const result = await bb.credits.consume(
  workspaceId,
  { amount: 10, description: 'AI generation' }
);

Frequently Asked Questions

Do I still need a Stripe account?

Yes. BuildBase handles subscription lifecycle, plan versioning, and metered usage. Stripe processes the payments. Connect your Stripe API keys in the dashboard.

Can I offer free trials without requiring a credit card?

Yes. Each plan version supports configurable trial periods with optional card requirements. Trial-to-paid conversion is handled automatically.

How does usage-based billing work?

Define a limit on your plan (e.g., 1,000 API calls/month). Usage is counted automatically. Overages are billed through Stripe — no billing code required.

What happens when a user exceeds their quota?

Trial users are blocked at the limit. Paid users continue — overages are tracked and added to the next Stripe invoice.

Can I change pricing without affecting existing subscribers?

Yes. Plans are versioned. Existing subscribers stay on their current version. New subscribers get the latest. Migration paths between versions are supported.

Does the credit system work with Stripe?

Credits are purchased via Stripe checkout. The credit ledger, balance tracking, expiration, and consumption are managed by BuildBase. Credits and subscriptions work independently.

Get started

Configure plans, connect Stripe, and start collecting revenue.