How it works
The license is linked to a subscription in the payment system. Each time the subscription renews, the license’s end date moves forward. When the subscription stops, the end date is not extended and the license expires. The app never sees a payment. It only asks whether the license is still valid.
Most sellers add a few days of grace after the paid period, so a renewal that settles late does not lock a paying customer out. See grace period.
A dated timeline
Example: a monthly subscription bought on 5 January 2027. Clavem sets the end date to the end of the paid period plus three days.
| Date | Event | License |
|---|---|---|
| 5 Jan | Checkout completes | Issued, expires_at 8 Feb |
| 5 Feb | Renewal invoice paid | invoice.paid moves expires_at to 8 Mar |
| 5 Mar | Card declined | Stays valid while Stripe retries |
| 12 Mar | Retries end, subscription becomes unpaid |
Expired |
| 20 Mar | Customer pays the open invoice | Subscription is active again, revived by invoice.paid |
A customer who cancels on 20 January keeps the license until the end of the period they paid for. Stripe sends customer.subscription.deleted then, and the license expires.
Which Stripe statuses keep it valid
| Subscription status | License |
|---|---|
active, trialing, past_due |
Valid |
canceled, unpaid, incomplete_expired, paused |
Expired |
A license you disabled by hand stays disabled whatever Stripe says. A new subscription after a cancellation is a new purchase and issues a new key.
Subscription license versus a fixed-term license
A subscription license renews by itself and follows the billing state. A fixed-term license, such as 365 days, ends on a date and does nothing after it unless the seller extends it. Both have an expiry date. Only one reacts to payment events. Clavem supports both: a product’s validity is perpetual, a number of days, or follows the subscription. Compare with a perpetual license.
How Clavem handles it
Clavem listens to your Stripe account through a webhook it registers there. The events that matter are checkout.session.completed, invoice.paid, customer.subscription.updated and customer.subscription.deleted. Details are in Connecting Stripe.
Expiry is evaluated whenever the license is read, so the API reports expired the moment the date passes and active again as soon as invoice.paid arrives. The signed token’s exp claim includes the three days of grace. Licenses created by hand or imported have no Stripe subscription, so Stripe events never change them. See license expiry.
Questions
What happens to the license if a renewal payment fails?
In Clavem the license stays valid while Stripe retries the payment. If the subscription becomes unpaid or canceled, the license expires. A later payment on the same unpaid subscription revives it, while a new subscription after a cancellation issues a new key.
Does a refund end a subscription license?
Not by itself. Refunding a subscription invoice does not disable the license in Clavem. Cancel the subscription, which expires it, or disable the license yourself.