Last Modified February 15, 2022

Dynamic Credit Licensing

  1. Overview
  2. Setting up Dynamic Credit Licensing
  3. Set Credits in the DNA Connector
  4. Consume Credits in your application with the DNA RESTful API
  5. Viewing and Managing the Credits

 

With Dynamic Credit Licensing (usage-based licensing), you can define and allocate multiple Credits to a License Code or Buyer Email that can then be consumed by the Application.

Allocation of Credits can be completed via our DNA eCommerce Connectors:

  • on initial License Delivery, the Credits specified in the DNA Connector for the SKU, are allocated to the License Code or the Buyer Email
  • on subsequent Replenishment transactions, the Credits specified in the DNA Connector for the Replenishment SKU, are added to the License Code or Buyer Email

Allocation of Credits can also be done manually, on a per License basis, from the DNA Control Panel Code View screens.

Consuming a Credit from the Application is done using our RESTful API Credit Consume. An internet connection is required to consume a Credit.

 

Key features with Dynamic Credits
  • up to five(5) Credit types per License Code or Buyer Email (defined for the DNA Product)
  • you can have multiple SKU's (representing different offers) defined in the eCommerce Connector allocating different mixes and quantities of each Credit
  • you can specify if the Credits are pooled for a specific License Code or a Buyer Email:
    • for License Code, only that License Code can use the Credits
    • for Buyer Email, any License Code associated with that Buyer Email can use the Credits
  • when consuming a Credit, you speficy the Credit type and Count to be consumed
  • when consuming, you can specify if it uses only the License Code Credits, or the Buyer Email Credits, or both (the License Credits are consumed first)
  • the App can query the current status of Credits and display to the User

A typical Dynamic Credits License process would look like the following:

  • User (Buyer) purchases your application with a set of "Credits" and quantities

  • A License Activation Code is generated and the Credits are allocated to the License Code or the Buyer Email

  • While using the App, when a Credit is to be consumed, the App issues a RESTful API call to validate and consume a <count> of a Credit type from either the License Code, the Buyer Email or both.

  • At anytime, the App can issue a RESTful API call to query the currently allocated Credits and display to the User.

To replenish the Credits:

  • Buyer purchases a "Replenish" product/SKU providing a given set of Credits.

  • The Credits are added to the License Code or Buyer Email Credit pools.

The above can be fully automated using our supported eCommerce Connectors (recommended), or done manually by directly editing the Credit information for a specific License Activation Code or Buyer Email.

 

Setting up Dynamic Credits Licensing

To enable Dynamic Credit Licensing, from the Product Configuration screen, edit () the License Options and enable Dynamic License Credits.

Enable Entitlements

When the "Dynamic Credits" option is enabled for the Product:

  • The Product Configuration screen will display a new section and allow you to define the Credit types to be used by this Product.

  • The Code View screen will display and allow you to manage / edit the Credits information

  • The eCommerce Connector Configuration screens will allow you to enter the Credits settings to be used for each SKU received via the eCommerce Connector for the initial License Delivery and subsequent Replenish events.

Click on Edit for Dynamic License Credits to define the Credit types:

  • for each Credit type, define a <Name> and a <defaultCount> and Add the Credit type
  • you can define up to five(5) Credit types for each Product
Define Entitlements

Set Credits in a DNA eCommerce Connector

  • from the Product Configuration screen, click on the eCommerce Connector (or create one) to view the eCommerce Connector
  • click on one of the defined SKU’s, or create one, to reach the SKU configuration screen

in the SKU configuration screen:

  • indicate if this SKU is a Replenishment SKU or an initial License Delivery
  • indicate if the Credits are to be allocated to the License Code or the Buyer Email
  • in the Credits section, enable one or several of the Credit types defined for this Product, and specify an override value if required
  • click on Save Configuration
Define Entitlements

 

Consume Credits in your application with the DNA RESTful API

When the activated App is running, and it is time to consume a given Credit (ex: generate a PDF Report), your App will issue a RESTful API call to the DNA Servers, and receive a Success / Fail indication and updated status of the Credit in JSON-based format.

Your App can also issue a query API call to receive the current status of all Credits associated with this License Code and associated Buyer Email, in JSON-based format.

Please consult our RESTful API   documentation for implementation details. (requires a DNA Control Panel account)

The following are cURL examples of the HTTPS commands you would use in your App:

POST Credit Consume example - returns updated count of the Credit

curl -v -X POST https://api.softworkz.com/v1/credits/<productId>/TEST12345/consume
-H "Accept: application/json"
-u "<clientId>:<API Key>"
-d '{"Name":"Reports","Count":1,"Target":"LICENSE","UserIp":"0.0.0.0"}'
                

Example of API Response with Credits Consume

{
  "Name": "Reports",
  "Count": 10
}
                

GET Credits (Query) example - returns updated count of the Credits for this License Code

curl -v -X GET https://api.softworkz.com/v1/credits/<productId>/TEST12345
-H "Accept: application/json"
-u "<clientId>:<API Key>"
-d '{"Target":"ALL","UserIp":"0.0.0.0"}'
                

Example of API Response with Get Credits

[
    {
        "Target": "LICENSE",
        "Name": "Reports",
        "Count": 3
    },
    {
        "Target": "EMAIL",
        "Name": "Reports",
        "Count": 5
    }
]
                

Viewing and Managing the Credits

All Credit replenishments, consumption and resets will be shown in the Event Logs for the product or the License Code.

The License Code Configuration screen will show the current status Credits for the License and associated Buyer Email:

Credits History

To reset the Credits for a given License Code, click on Edit from the License Code configuration screen. You can reset any of the Credit types for this License Code, as defined for the Product.

Edit License Credits

To view the history of the allocation or consumption of Credits for a given DNA Product or a given License Code, click on the View Credits History button on the Product Configuration, or the License Code Configuration screens.

Credits History