BillStack Docs
Move billing, checkout, referrals, and subscription ownership out of your product app.
BillStack is a project-scoped billing layer for SaaS platforms. Your app keeps product identity and authorization. BillStack owns payment provider configuration, checkout creation, customer billing portal sessions, invoices, referral tracking, and entitlement calculation.
Use this documentation when you want one billing system to support multiple products without copying Stripe, Razorpay, affiliate, and admin-dashboard code into every app.
What BillStack owns
- Provider credentials and webhook handling for Stripe and Razorpay.
- Project-scoped products, tiers, prices, lifetime deals, and payment links.
- Customer records keyed to your app user through
externalId. - Logged-in checkout sessions and anonymous public payment links.
- Referral codes, referral application, stats, and reward lifecycle.
- Entitlement snapshots your app can read and cache.
- Billing dashboard and customer portal links.
What your app still owns
- Authentication and session handling.
- The app user ID used as
externalId. - Product UX such as pricing buttons, account pages, and upgrade CTAs.
- Authorization gates that read BillStack entitlements.
- Success and cancel pages after checkout.
Standard flow
- Create a BillStack team.
- Create one project for each SaaS product.
- Configure providers, products, tiers, prices, and referrals in BillStack.
- Generate a private API key for server-to-server calls.
- Optionally generate a publishable key for public pricing and payment-link reads.
- Replace local Stripe, Razorpay, and affiliate calls with BillStack API calls.
- Read entitlements from BillStack and keep only a small cache in your app.
v2 is recommended; legacy (v1) is frozen. Build new integrations on the provider-neutral v2 API (BillStackV2Client from @billstack/sdk/v2, 0.7.0 or later). The Stripe-first legacy API stays supported for integrations that already call it, but gets no new features. Legacy pages carry the legacy- prefix in their address.
Start with the quickstart, then add the integration guides that match your product.
All guides and API references
- Quickstart
- Troubleshooting
- Agent skills
- Authentication
- Legacy BillingQL API
- Legacy Checkout Start
- Legacy Entitlements
- Legacy Invoices
- Legacy Portal Sessions
- Legacy Providers and Webhooks
- Legacy Public Payment Links
- Legacy Public Pricing
- Legacy referrals
- Legacy Search billing records
- Multi-provider v2 API
- Referral payout requests and partner sessions
- Referrals
- Sandbox API
- Subscription management
- Architecture
- Test and live environments
- API Keys
- Customer Portal and Admin Links
- Entitlements
- Legacy BillingQL
- Legacy Customer portal
- Legacy Logged-in Checkout
- Legacy Public Pricing and Payment Links
- Legacy Referrals
- Legacy RevenueCat
- Legacy TypeScript SDK
- Lifetime Deal Campaigns
- Lifetime deals
- Multi-provider v2 integration
- BillStack sandbox
- Outbound webhooks
- Partner portal and payout requests
- Personal access tokens
- Referrals with your own billing
- TypeScript SDK
- Migrate an Affiliate System (legacy)
- Backfill Historical Data (legacy)
- Migrate from Razorpay (legacy)
- Migrate from Stripe (legacy)
- Import an Existing Referral System