Subscription Licensing
In Cryptlex, a subscription is a time-based licensing model where a license is valid for a specific duration, such as months or years. It suits recurring billing and time-limited access, and combines with any enforcement type (node-locked, floating, or named user). A subscription is configured by setting a subscription interval or an exact expiration date.
Use a subscription when you want recurring revenue or to bundle ongoing updates and support. For a one-time purchase with no expiry, use a perpetual license instead.
Adding a subscription to a license
To configure a subscription in a license, you can define:
- A subscription interval and start trigger, or
- A fixed expiration date
Set one or the other, not both. These settings define the start of the license term and how its expiry is determined.
Using a subscription interval and start trigger
To define a recurring subscription, use the subscriptionInterval property to specify the duration and the subscriptionStartTrigger to determine when that duration begins.
The subscription interval accepts ISO 8601 durations (P1Y, P3M10D, P30D), which automatically account for varying month and year lengths. The start trigger controls when the period begins:
| Start trigger | Period begins | Use when |
|---|---|---|
| License Creation | When the license is created | You want it aligned with the purchase date |
| License Activation | When the license is first activated | It should begin with first product use |
Using an expiration date
Alternatively, you can set a fixed expiration date by setting the expiresAt property of the license to define exactly when the license should expire.
Renewing a subscription
When a subscription is renewed, Cryptlex adds the current subscriptionInterval to the expiration date, renewing the license for another cycle. The license can be renewed manually from the admin portal or through the Web API.
- Admin portal: Go to the Licenses page, click the Actions menu (three dots) next to the license, and select
Renew License. - Web API: Send a
POSTrequest to the Renew License endpoint.
Updating the expiration date
The expiresAt property of the license can be updated manually to extend, shorten, or correct the license's expiration date, either from the admin portal or through the Web API.
- Admin portal: Go to the Licenses page, click the Actions menu (three dots) next to the license, and select
Update Expiration Date. - Web API: Send a
PATCHrequest to the Update License Expiration endpoint.
Subscription logs
Subscription logs track the history of subscription-related events for each license, which helps you audit and troubleshoot subscription changes over time. Captured events include license expiration date updates (license.expiresAt.updated), license renewals (license.renewed), and modifications to subscription details (license.subscription.updated).
Setting an effective date
The effectiveDate license property defines the earliest date on which the license can be activated. Any attempt to activate the license before this date is rejected, even if the license key has already been delivered to the customer. This applies to any license, independent of its subscription settings.