Cookbook
Short, copy-pasteable recipes for common QuotaStack patterns — each a focused set of API calls.
Plan Purchase as a Usage Event
Buy plans by debiting wallet credits and granting time-limited plan credits — a two-step credit operation with deterministic idempotency.
Read →Stacking Multiple Credit Packs
How credit blocks from multiple purchases coexist and burn in deterministic priority order — no merging, no special handling.
Read →Granting Free Credits on Signup or Action
Patterns for signup bonuses, per-action grants, and time-limited trials using deterministic idempotency keys.
Read →Auto-Purchasing Plans When Credits Run Out
Automatically buy the next plan from the user's wallet when plan credits are exhausted — zero friction, no paywall interruption.
Read →Setting Up a SaaS Pricing Matrix with Typed Entitlements
End-to-end walkthrough of defining typed billable metrics and attaching them to plan variants to build a complete Free vs Pro feature matrix.
Read →End-to-End Billing Setup: From Zero to Working Credits in 10 Steps
Complete walkthrough building a working billing system with Acme Chat — metric, metering rule, plan, variant, customer, subscription, and usage in one linear sequence.
Read →Billing Overage in Arrears
Let customers keep working past their credit balance, then invoice the recorded overage each cycle through your own PSP. QuotaStack stays payment-agnostic.
Read →Importing Existing Customers (Legacy Cutover)
How to move mid-plan customers, remaining wallets, trials, and packs into QuotaStack without double-granting or resetting billing periods.
Read →Notifying Users Before the Wallet Runs Dry
Use credit.low_balance and credit.exhausted to warn customers early and react when they hit zero, without polling balances.
Read →Connect Dodo Payments
Configure sandbox and live Dodo connections, register callbacks, map products, create hosted checkout, and recover payment events safely.
Read →Generate a Client from the OpenAPI Spec
There is no official SDK yet. Generate a typed client from the published spec, and handle the two things a generator will not do for you.
Read →