Your SaaS, Charge with Confidence.
Payments to consumption. All handled.
You've been here before
A user just downgraded.
Apply it now? Features gone, no refund — complaints incoming. Ignore it? You'll overcharge next cycle. Current period stays, next period must change. Spent an entire afternoon testing. Three glasses of water, gone.
Edge cases never end
Spent a full day testing. Got through 8. Scrolled down — 40+ more. Kept opening and closing the list. For the next few days, food had no taste. You were still debugging in your dreams.
Thought it was handled
Clicked 'Pro' with a trial account. The trial kicked in again. Service delivered. Revenue: $0.
Every subscription state, handled.
Built with Next.js + React, powered by Supabase and Tailwind CSS.
Full subscription lifecycle
Trial → active → upgrade/downgrade → cancel → resume → expire. Every state transition handled. Webhooks verified, idempotent, out-of-order safe.
Three-tier credits engine
Subscription quota resets monthly. Bonus credits expire in batches. Purchased credits last forever. Atomic deduction: quota → bonus → purchased. No race conditions.
Two functions, that's the API
checkUserAccess() for permission checks. fastConsumeService() for atomic deduction. Your business logic stays clean — no payment code leaking in.
Every edge case, already handled
Failed payments auto-expire. Trial abuse blocked. Canceling users keep access until period ends. 30+ scenarios covered.
4 ways to charge your users
One environment variable to switch. Pricing page, checkout, access control — all adapt automatically.

Quota Subscription + Credits
subscription_quotaSubscription includes monthly quota. Buy extra credits when needed.
Great for products with base usage + elastic demand

Unlimited Subscription
subscription_unlimitedMonthly/yearly billing with unlimited usage. Supports free trials.
Great for high-frequency, low-cost services like Grammarly

Credits
creditsPay as you go. Buy what you need.
Great for API services and AI products like Claude Code

Lifetime
lifetimePay once, use forever.
Great for code products like Tailwind CSS, Pay4SaaS
Payment Methods

Stripe
Global standard. Sell to customers in 195+ countries, but merchant accounts only available in 46 countries.

Creem
Built-in tax handling (MoR). Indie developer friendly.

PayPal
430M+ users worldwide. Reaches users who prefer not to enter card details.

Alipay
Covers mainland China. Essential for reaching Chinese consumers.
Works for
AI writing, image generation, video tools, API services — if your users pay to use it, Pay4SaaS handles the rest.
Behind the Code
That afternoon you first opened the webhook docs — and sighed.
Those days when food had no taste and you were still debugging in your dreams.
That moment the credits table showed 0, and a user complaint came in.
300 hours. All packed into this codebase.
Get it now at the lowest price
One purchase. Lifetime access.
FAQ
The hard part is done.
Go build what actually matters.