Licensing a SaaS product
A B2B SaaS vendor selling tiered plans — seats, feature gates and a metered API quota — without building a licensing subsystem.
The shape: your backend holds the license; end users never see codes. One entitlement per customer, seats for their users, meters for their consumption.
How the pieces map
Section titled “How the pieces map”| You need | You use |
|---|---|
| Basic / Pro / Enterprise tiers | One plan set with three plans; each customer’s entitlement applies one |
| Feature gates per tier | Features snapshotted into the license — checked in-process, no per-request API call |
| Seat limits | A numeric feature (users.max) enforced by your app, or per-user activation with seat allocation |
| API call quotas | A monitored asset with a monthly quota and tier thresholds |
| Upgrade/downgrade, renewal, churn | Entitlement operations + Entitlement.* webhooks into your CRM |
Integration sketch
Section titled “Integration sketch”- Your backend embeds the .NET SDK (or calls REST
directly). Each customer environment activates with
LicenseFingerprint.ForTenant(customerId)— a stable logical fingerprint, so restarts and autoscaled instances share one seat instead of leaking new ones. - Feature checks are local: the license is a signed token your process validates in memory. A request handler asking “is SSO enabled for this customer?” costs nothing.
- Report API consumption in batches
(
UsageReporter.ReportAssetUsageAsync("api-calls.total", n)); the platform aggregates against the quota and firesMeteredUsage.OverageStatusChangedwhen a customer crosses Warning or hits their cap — your webhook receiver opens the upsell conversation. - Sales operations stay in the portal: new customer → new entitlement from a template; upgrade → apply a different plan; churn → cancel, and the license stops validating at the next renewal.
Why not roll your own?
Section titled “Why not roll your own?”The parts that look easy — plan changes mid-period, usage aggregation windows, grace on renewal failure, “we promised customer X an exception” — are the parts that harden into unmaintainable config tables. Here they’re policies on an entitlement, changed per customer without a deploy.
See it live: the Mirage demo is exactly this use case — an AI media studio with metered daily quotas, prepaid credits and an in-app plan upgrade.
Start with the API quickstart — the full loop is eight calls.