Clavem

License expiry

License expiry is the date and time after which a license stops being valid, so an app that checks it refuses the paid features until the license is renewed or extended.

How it works

A license has one of three lifetimes:

  • Perpetual. No end date.
  • Fixed term. A set number of days from purchase, such as 365.
  • Subscription. It lasts while a subscription is paid.

The server holds the date. The app learns the result either from the server’s answer or from a signed token that carries the date, and refuses the paid features once it has passed.

A dated example

An example, not a real customer. A product has a validity of 365 days. A key is issued on 19 November 2026 at 09:12 UTC, so expires_at is 2027-11-19T09:12:41.207Z. On 20 November 2027 the app calls validate and gets HTTP 200:

{
  "valid": false,
  "error": "This license key has expired.",
  "license_key": { "id": 305, "status": "expired", "expires_at": "2027-11-19T09:12:41.207Z" },
  "token": "sgt1.eyJ2IjoxLCJsaWQiOjMwNSwi…"
}

Read valid, not only the status code. A known key always answers 200. The token inside also says valid: false, so an offline check agrees with the server.

The customer renews by paying. Or the seller extends the date:

curl -X PATCH https://clavem.io/v1/admin/licenses/305 \
  -H "Authorization: Bearer sk_clavem_…" \
  -H "Content-Type: application/json" \
  -d '{ "expires_at": "2028-11-19T00:00:00Z" }'

The next validate returns valid: true again.

What else an expired license changes

  • Activation is refused with 400 This license key has expired. before the device limit is checked.
  • The releases endpoint returns only version and published_at. Release notes and download links need a license that is neither expired nor disabled, though the app can still tell the customer that an update exists and send them to renew.
  • The app should keep the stored key. A renewal can revive it.

License expiry versus revocation

Expiry follows a date or a subscription. Revocation is a decision made earlier than the date. Status precedence in Clavem is disabled, then expired, then active or inactive, so a license that is both disabled and past its date reads as disabled. A grace period moves the date out a little.

How Clavem handles it

  • expires_at is null for perpetual licenses. A product’s validity is perpetual, a number of days, or following the subscription.
  • For a subscription, expiry is the end of the paid period plus three days. The same date appears in the token as exp, which is absent for perpetual licenses.
  • Expiry is evaluated when the license is read. There is no background job, so the API says expired the moment the date passes.
  • An expired license comes back when invoice.paid arrives or when expires_at moves forward. See connecting Stripe for each event.

Fields and responses are in the API reference.

Questions

Can an expired license be restored?

Yes. In Clavem a paid renewal revives it, and moving the expiry date forward by hand revives it too. A disabled license is different and stays disabled until you enable it.

Does a perpetual license have an expiry date?

No. It has no end date, which Clavem reports as an expiry of null.