Skip to content

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.

You needYou use
Basic / Pro / Enterprise tiersOne plan set with three plans; each customer’s entitlement applies one
Feature gates per tierFeatures snapshotted into the license — checked in-process, no per-request API call
Seat limitsA numeric feature (users.max) enforced by your app, or per-user activation with seat allocation
API call quotasA monitored asset with a monthly quota and tier thresholds
Upgrade/downgrade, renewal, churnEntitlement operations + Entitlement.* webhooks into your CRM
  1. 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.
  2. 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.
  3. Report API consumption in batches (UsageReporter.ReportAssetUsageAsync("api-calls.total", n)); the platform aggregates against the quota and fires MeteredUsage.OverageStatusChanged when a customer crosses Warning or hits their cap — your webhook receiver opens the upsell conversation.
  4. 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.

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.