LicenPro
DocumentationSubscription license

Subscription license

Subscription licenses model time-bounded access (renewal cycles). The server persists SubscriptionExpiryDate and maps to SDK SubscriptionLicense with SubscriptionDuration metadata. End-user apps should validate online regularly; the SDK exposes expiry notices before the end date for in-app renewal UX.

Renewal window

Dashboard + SDK expiry alignment.

Warnings

SubscriptionExpiryWarningDays (default 7).

Online-first

ValidateAsync checks server state.

How it works

Creating a subscription with subscriptionDuration / subscriptionDurationHours shifts SubscriptionExpiryDate forward from issuance when those fields are provided; you may also set explicit dates depending on UI/API usage. The SDK builds SubscriptionLicense with UserName, SubscriptionStartDate, and SubscriptionDuration for client-side display logic.

Creating a subscription (dashboard / API)

  1. POST /api/Licenses with type: "Subscription", issuedTo, softwareReleaseId, and duration fields and/or subscriptionExpiryDate.
  2. Attach entitlement sets for tiered SaaS features.
  3. Download license.bin after creation.

REST API

Same family as other licenses: GET/POST /api/Licenses/... for CRUD, POST /api/Licenses/refresh/{licenseKey} for refresh flows, validate endpoints for server checks. See API reference.

SDK integration

After successful ValidateAsync, read result.ExpiryNotice or subscribe to client.LicenseExpiringSoon. Tune warning lead time with SubscriptionExpiryWarningDays (set 0 to disable).

using LicenPro.SDK;
using LicenPro.SDK.Enums;

await using var client = new LicenseClient(new LicenseClientOptions {
    LicenseFilePath = "license.bin",
    PublicKey = publicKeyBase64,
    LicenseKey = subscriptionKey,
    ExpectedLicenseType = LicenseType.Subscription,
    SubscriptionExpiryWarningDays = 14
});

client.LicenseExpiringSoon += (_, e) => {
    var n = e.Notice;
    // Non-blocking banner from n.WholeDaysRemaining, etc.
};

var result = await client.ValidateAsync();
if (result.IsValid && result.ExpiryNotice != null)
{
    // Same ExpiryNotice as event for manual validate path
}
Online vs offline

Online validation keeps subscription state aligned with revocations and billing. Offline validation only consults the signed file and local clock — use only when your contract explicitly allows limited offline grace (see SDK SdkSettings for cache/grace-related defaults).