> ## Documentation Index
> Fetch the complete documentation index at: https://vlyai-1c28d863.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Subscription billing

> Multi-tier subscriptions, trials, billing portal, dunning. ~60 minutes.

Add subscription billing to an existing app. Multiple tiers, trial period, customer-facing billing portal, handling of failed payments.

**Time:** \~60 min. **Difficulty:** Intermediate. **Integrations:** [Stripe](/integrations/stripe).

<Note>
  Full walkthrough being written. See [Stripe integration](/integrations/stripe) for credentials setup.
</Note>

## Foundation prompt

```text theme={null}
Add Stripe subscription billing. Three tiers: Starter (Free), Pro ($10/mo,
14-day trial), Business ($40/mo).

Pricing page lists the three tiers with feature comparison. Logged-in users
click Upgrade to start Stripe Checkout. After successful checkout, user's
plan is updated.

Customer billing portal accessible from settings — handles upgrades,
downgrades, payment method changes, invoices.

When invoice payment fails, mark workspace as 'past_due' and show a banner.
After 7 days past_due, downgrade to Free automatically.
```

## Related

<CardGroup cols={3}>
  <Card title="Stripe integration" icon="credit-card" href="/integrations/stripe">
    Setup details.
  </Card>

  <Card title="Multi-tenant SaaS" icon="building" href="/recipes/multi-tenant-saas">
    Where this layers in.
  </Card>

  <Card title="Webhooks recipe" icon="webhook" href="/recipes/webhooks">
    The webhook handler pattern.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.