How to paywall a feature in your SaaS
To paywall a feature in your SaaS, ask Ruba for the customer’s state, which lists their active subscriptions, benefits and meter balances, and open the feature only if the right one is there. Ruba tells your app who has paid. Your app decides what to lock. Ruba pays you to your own bank.
Free and paid in one app
Ruba’s customer state tells your app what a buyer has paid for, and webhooks tell it when that changes. Mehwish in Faisalabad runs a note-taking app. Everyone can write notes. Only paying users can export to PDF. That one export button is a paywalled feature.
The idea is simple: before the button works, the app checks whether this user has paid. The question is how to ask.
Three ways to ask
Ruba has a customer state, benefits such as license keys, and webhooks. Tap each way.
Great for Most web apps. One object tells you everything.
Watch for Cache it, and refresh it from the webhook.
Great for Software with no user accounts.
Watch for Always check the organization ID.
Great for Teams that keep their own access table.
Watch for You must handle missed or repeated events.
What happens when the state changes
- PayUser subscribesOn Ruba’s checkout.
- EventState changescustomer.state_changed fires.
- Your appUpdates its cacheThe user is now paid.
- UseExport opensThe button works.
The webhook fires when a customer is created, modified or removed, and when their subscriptions or benefits change.
For subscriptions, Ruba offers 7, 14 or 30-day trials that save the card without charging it, retries a declined renewal over about 21 days, and gives customers a hosted portal to see invoices, replace a card and cancel.
Who decides what
When a renewal fails, Ruba retries over about three weeks and then revokes the subscription. You can set Keep access after a failed payment to keep benefits during that time. Decide what is kinder to your users.
What to do next
Build in the sandbox, then go live. Apply for Ruba early access. Ruba charges 4% + $0.50 per payment, plus 0.5% on subscriptions, and has no monthly fee. Read how to set up the routes in the Next.js subscriptions guide.
Check the customer’s state, then open the door. A company is not required, and no monthly fee applies. If you are approved during early access, your 4% + $0.50 is locked for your paid feature for as long as your account stays open and in good standing. Surprise fees are covered: Ruba refunds one it never told you about and pays you $100. Terms apply. See the early-access deal.
Questions people ask
How does my app know who has paid?
Read the customer state. One API call, or one customer.state_changed webhook event, returns the customer’s active subscriptions, awarded benefits and meter balances. Using your own external ID, you can connect it quickly.
Should I check on every request?
Cache the result and refresh it when the webhook tells you the state changed. That keeps requests fast, and your app current.
What if a renewal fails?
The subscription moves to past due and Ruba retries over about 21 days. You can set Keep access after a failed payment so benefits stay available while it is past due.
Can I lock one feature, not the whole app?
Yes. Attach a benefit to the paid plan, such as a license key or a custom benefit. Check for it in your app before opening that feature.
Does Ruba enforce the paywall for me?
No. Ruba tells your app the state. Your app decides what to lock. That keeps the control with you.
Sources
We check these when we update this guide. Rules can change, so check them yourself before you decide.
- Ruba: read the customer access stateChecked 26 Nov 2026
- Ruba: subscriptionsChecked 26 Nov 2026
- Ruba: license keysChecked 26 Nov 2026
- Ruba: use Ruba with Next.jsChecked 26 Nov 2026
- Ruba: pricing and feesChecked 26 Nov 2026