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 pricing page

Quota Subscription + Credits

subscription_quota

Subscription includes monthly quota. Buy extra credits when needed.

Great for products with base usage + elastic demand

Unlimited Subscription pricing page

Unlimited Subscription

subscription_unlimited

Monthly/yearly billing with unlimited usage. Supports free trials.

Great for high-frequency, low-cost services like Grammarly

Credits pricing page

Credits

credits

Pay as you go. Buy what you need.

Great for API services and AI products like Claude Code

Lifetime pricing page

Lifetime

lifetime

Pay once, use forever.

Great for code products like Tailwind CSS, Pay4SaaS

Payment Methods

Stripe checkout

Stripe

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

Creem checkout

Creem

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

PayPal checkout

PayPal

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

Alipay checkout

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

Email + password, Google & GitHub OAuth via Supabase
Stripe, Creem, PayPal, Alipay payments with webhook verification
4 pricing models, switch with one environment variable
Full subscription lifecycle with 30+ edge cases handled
Three-tier credits system with atomic deduction
Multi-tenant support, one database for multiple projects
Vercel & Alibaba Cloud deployment, dual-domain EN/CN auto-adaptive, multi-currency
Twitter (@taoWithSaaS) & WeChat, direct author support
Lifetime free updates via GitHub repo
$299$199

One purchase. Lifetime access.

FAQ

I was a React beginner myself before building Pay4SaaS. The entire project was built with AI assistance. Just describe what you need — Claude Code handles the code.
Yes, just me. Pay4SaaS is my own product. DM me if you run into anything — you'll get my contact info after purchase.
You'll receive a GitHub organization invite after payment. Just clone and start building.
Yes. No project limits. Buy once, use everywhere.
No refunds once the GitHub repository invitation has been sent. Invitation sent = product delivered. The system logs the delivery time and GitHub username for every purchase. Questions before buying? Reach me on @taoWithSaaS or email:

The hard part is done.

Go build what actually matters.