Idea
Instead of selling your software as a one-time purchase, you can instead collect monthly or yearly payments from your customers. There are at least three ways to set up a licensing model that supports some form of recurring payments. You can require an active subscription to:- Use the product (or some of its features)
- Get updates, but allow access to older versions of the product after the expiration date (similar to one-time purchase model)
- Receive support, but still allow access to the product. You can combine this with the “updates constraint” above.
expiration date
property that each license key has. We will cover the details of how this is implemented in the next section.
Implementation
In the dashboard
The expiration date of a license key can be controlled by clicking on the desired license on the product page. A box will popup, similar to the one below.
Note, if the textbox in the picture above does not show up, a quick solution is to click on Edit Feature Names on the product page and tick Treat all licenses as time-limited. You can read more about feature definitions here.
In your application
In the introduction, we mentioned three ideas to subscription based licensing model can be used: by constraining access to the entire product, newer versions of it and/or support.Require subscription to access the product
This is quite simple to restrict access to entire product if the license key has expired. In the code below, we assume that you have read the key verification tutorial. The only change is to addHasNotExpired()
in the if-statement below:
HasFeature(<feature number>)
in the if-statement.
Require subscription to access updates
In this scenario, instead of restricting access to all versions of the product, we allow users to keep using the latest major version before they stopped paying for updates.
Remember, in addition to extending the duration of the license key, we need update the notes field with the last major release number.
Require subscription to receive support
If you plan to only use subscriptions to keep track of who is eligible for support, no additional code is required besides what is presented in the key verification tutorial.Integration with other services
The key to get subscriptions up and running is the ExtendLicense method in the Web API. It allows you to extend the expiration date of a license key by a certain number of days. For example, let’s assume the users pays for the subscription on a monthly basis. Once a payment is successful, we can extend the duration of the license by sending a GET request to as shown below (the access token can be created on this page):Although we extending the duration of the license key by 30 days (for a monthly subscription), it is better to add a few extra days in case there are issues with the payment, in order to avoid disruptions.
Tips when integrating with Stripe
If you use subscriptions in Stripe, there are two useful events that you can use to monitor subscriptions (when using Webhooks):invoice.payment_succeeded
- when this event is received, ExtendLicense method should be called for the license that the subscription belongs to.customer.subscription.deleted
- when this event is received, BlockKey should be called to make sure the license key can no longer be used.
An implementation that supports recurring payments will be released in the coming weeks. In meantime, please reach out to us should you have any questions!