Implement Usage-Based Pricing Model

This blog covers how to implement usage-based pricing, both in your code and in the Cryptolens dashboard. We will go through two use cases. One is where you charge customers based on their usage of a specific feature. The other one is instead where you give a customer X amount of credit points, and each time they use the feature, one credit point is removed.

You can find the full documentation page here. If you would rather watch a video, we have made the following:

The two use cases for the usage-based pricing model

Let’s start off with the use case where you charge a customer different prices each month depending on how much they use a specific feature. Theoretically, the way to implement that is to track how much the customer uses that particular feature and change them accordingly. Another way is to let customers pay upfront for a specific number of credit points Each time they use a specific feature, one credit point is used up. When they reach 0, they would have to buy more credits.

You can also combine these use cases with other pricing models. One way is to have a standard subscription fee and charge them using a usage-based method for a particular feature. In the first use case, you can simply add the feature usage cost to the normal subscription fee. For the second use case with credits, you can instead give different pricing plans different amounts of credits. The basic plan can come with 10 credits. If they want more, they have to buy them individually!

The use-based approach in the Cryptolens dashboard

Creating and managing usage-based licenses is easy in the Cryptolens dashboard. After you have signed in, go to the product page. Click on a license key to bring up the menu. Scroll down to the section called “Data Objects”. At the bottom of that section, click the text that says “add/edit data objects”.

A data object is a custom variable that you can add to your license in Cryptolens. Data objects can store a string value and an integer value. This is how you track the feature usage!

To get started with the usage-based approach, please create a new data object by entering a name of your choice, for example, “usage of feature 1”. Click on the “Create” button.

Go back to the product page and bring up the license key menu by clicking on a license key. Head back to the section called “Data Objects”. This time, click on the text that says “manage credit usage”.

This page is perfect when you implement usage-based pricing. You can see the usage history, remaining credits, and where you can manually add or remove credit points for that particular license key.

In the “Current credits” cell, you will see the name you have given to the data object responsible for tracking the feature usage. You can see the current remaining credit points in the “Current value” cell. The last cell named “operations” is where you can manually add or remove credit points for that particular license key.

Simulating feature usage

To add 10 credit points, simply give the “Operations” field the value 10 and click on the green plus icon. You will now see that the “Current credits” cell has a value of 10. In the section below called “History”, you can also see a new entry saying that you added 10 credit points to that license key.

You can also simulate actual feature usage. Set the “Operations” field to the value of 1 and click instead on the red minus icon. That removed a credit and added the reduction to the history section.

Please note that all licenses that are using the usage-based approach need to include this data object. We suggest using feature templates to automatically create licenses that include this data object. You can find that tutorial here.

Usage-based pricing model in code

To implement usage-based pricing into your application’s code, we suggest you check out our full documentation page for the usage-based licensing model. You can find that here.

You can also watch the YouTube video we mentioned earlier where we cover code examples in Python.


Get Started with Cryptolens Today!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.