I wrote a guide for Null Studio about pricing a SaaS product, and its main argument is that pricing is an architecture decision, not a copy decision. Every unit you charge for has to be counted by your software, every plan boundary has to be enforced somewhere, and those boundaries should live in one place, as data, rather than as plan-name checks scattered through the code.

Then I did the thing I keep doing after writing these: I opened two of my own products and checked. One of them is a white-label portal for voice AI agencies with real Stripe plans. The other is a job-alert tool that has only ever had a free tier and a comment promising paid plans later. Neither one fully passes, and they fail in opposite directions, which is more useful than if they had failed the same way.

The portal: three answers to one question

VoiceDash is a white-label client portal for voice AI agencies. The agency pays, puts its brand on it, and adds its own clients, who log in and see their own calls. The obvious thing to limit by plan is how many clients an agency can add.

Here is where that number lives. The plan table:

// src/lib/stripe/plans.ts export const PLAN_LIMITS: Record<PlanId, { clients: number; agents: number }> = { STARTER: { clients: 1, agents: 1 }, GROWTH: { clients: 5, agents: 5 }, ULTIMATE: { clients: Infinity, agents: Infinity }, }; 

The sidebar that shows "Clients: 2 / 5":

// src/components/layout/AgencySidebar.tsx const clientLimit = PLAN_LIMITS[(plan as PlanId) || "STARTER"]?.clients ?? 5; 

And the database:

model Workspace { plan Plan @default(STARTER) clientSlots Int @default(10) // ... } 

So "how many clients can a Starter workspace add?" has three answers in the repo: 1, 5 and 10. Only the first one is enforced. The ?? 5 is a fallback that can only fire if the plan string is something the table does not know, at which point the sidebar shows a limit the server will not honour. And clientSlots is a column with a default of 10 that, as far as grep can tell me, nothing reads or writes. It looks like the start of a per-workspace override that never got wired up.

To be fair to past me, the part that matters is in decent shape. There is one helper per limit, and both create routes call it:

// src/lib/plan-limits.ts const plan = (workspace?.plan || "STARTER") as PlanId; const limit = PLAN_LIMITS[plan].clients; const current = await prisma.client.count({ where: { workspaceId } }); return { allowed: limit === Infinity || current < limit, current, limit: limit === Infinity ? -1 : limit, }; 

The -1 is there because Infinity does not survive JSON.stringify (it becomes null), and this result ends up in an API response. That is the kind of detail I am glad I hit early rather than in a customer's browser.

What is wrong is narrower. The limits are keyed by plan name, so a custom deal ("Growth, but with eight clients") means a new enum value and a migration, which is exactly the fork the guide warns about. The dead clientSlots column is the right idea in the wrong state: a per-account override that the helper should read first and fall back to the plan if it is null. And the check is count-then-insert with no lock, so two clients created in the same second can both pass at the limit. For a limit of one on a portal where an agency owner adds clients by hand, I am not losing sleep over that race, but it is there.

The question I never answered: what happens on downgrade

The guide has a section on trials that asks what happens on the last day. The portal answers half of it. When Stripe sends customer.subscription.deleted, the webhook does this:

// src/app/api/webhooks/stripe/route.ts await prisma.workspace.update({ where: { id: workspace.id }, data: { plan: "STARTER" }, }); 

And that is the whole downgrade. A Growth workspace with five clients that cancels becomes a Starter workspace with five clients and a limit of one. Nothing archives the extra four, nothing hides them, nothing tells the agency. checkClientLimit blocks creating a sixth, which it was already doing. The sidebar will happily show "5 / 1".

I am not sure that is wrong. Locking an agency's clients out of their own call history the moment a card fails would be worse, and the guide itself says a trial that ends with the customer's data behind a lock is a bad review. But it is a decision the code made by omission, not one I made. The fix I would write is small: on downgrade, keep everything readable, block creation and editing above the limit, and show the over-limit state with the upgrade path in the UI. None of that is shipped today.

The job-alert tool: a table keyed by plan, read as a constant

Upwork Scout is the opposite case. It has never charged anyone. It has a free tier, and the landing page says "Paid plans with higher limits are coming; early users lock in generous limits."

The data model looks ready for that:

// lib/models.ts plan: "free"; // stripe-ready seam export const LIMITS = { free: { maxCategories: 3, maxKeywords: 10, maxInstantPerDay: 15, maxAiScoresPerDay: 150, }, } as const; 

A table keyed by plan, with a comment calling it a seam. Then every single caller does this:

// app/api/me/route.ts limits: LIMITS.free, const lim = LIMITS.free; // app/api/cron/scan/route.ts } else if (aiToday < LIMITS.free.maxAiScoresPerDay) { const allowance = Math.max(0, LIMITS.free.maxInstantPerDay - capDoc); 

Four call sites, and none of them read u.plan. The plan field on the user is typed as the literal "free", written once at signup, and returned by /api/me next to limits that ignore it. So the seam is a table shaped like an entitlement layer that is used like a constant. Adding a paid plan means touching every call site, not adding a row. That is the "two hundred inline checks" failure from the guide, just at a size where it is four.

The fix is boring and I should just do it: one limitsFor(user) function that resolves plan plus any override, and nothing else in the codebase is allowed to say LIMITS.free.

The "early users lock in generous limits" line is the one that bothers me more. That is a grandfathering promise, and grandfathering is precisely what an entitlement layer is for: old accounts keep the bundle they had. There is nothing in the data that records who is an early user. There is a createdAt, so I could draw the line by date later, but a promise on a public page should have a field behind it, not a query I hope to remember to write.

Limits that say no quietly

The other thing the audit turned up is how the limits behave when you hit them.

Categories are fine: the dashboard checks the count and shows "Free plan includes up to 3 categories." Keywords are not. The server keeps the first ten and drops the rest with .slice(0, lim.maxKeywords), and the dashboard has no check of its own, so the eleventh keyword appears to save, then disappears on the next load with no message.

The alert cap is worse, and I only noticed it while writing this. In the instant-alert path, each matched job gets a delivery record with status "sent" first, and then the email is built from fresh.slice(0, Math.min(allowance, 5)). Any job past that slice already has a delivery row marked sent, so it will never be emailed, not in this run and not after the cap resets tomorrow. On a busy scan, the sixth match is not deferred. It is gone, and the database says it was delivered. (I wrote a whole post about writing the delivery row before the send. I did not, at the time, follow that row through the cap.)

The rule I take from both: a limit should be enforced at the point of action and announced at the point of action. A silent .slice is a limit the customer discovers by losing something.

What I am changing

  • Upwork Scout: a single limitsFor(user) resolver; ban LIMITS.free outside it; record the early-user cohort as a field now; mark over-cap matches as deferred instead of sent; a keyword counter in the UI that matches the server.
  • VoiceDash: read clientSlots as an override (or drop the column), delete the ?? 5, and decide the downgrade state on purpose instead of by omission.

None of these are shipped as I write this. They are small, which is the point of the original guide: the prices are the cheap part, and the structure under them is cheap only if you build it before there are paying accounts sitting on top.

The full client-facing version, with the questions I ask before scoping a SaaS build, is on the Null Studio blog.

Where do your plan limits actually live? If you grep for your free tier's name right now, how many hits do you get?