Dart InnovationsDocs
License Web
dartinnovations.com

Example use cases

Common ways to use License Web, from one-time activation and trials to plugin licensing, reseller inventory and key generation.

License Web supports most product activation scenarios, including trials, subscription products and one-time activation. This page walks through a typical integration and other common uses. For full parameter details, see the API endpoint reference.

One-time activation product#

In this scenario you sell a downloadable product through your web store. The customer receives a product key to activate it.

Add the key when the customer buys#

When a purchase succeeds, your store calls addkeys to push the key into License Web. productCode, email and productKey are required.

[
  {
    "productCode": "MyProductCode",
    "email": "john@contaso.com",
    "productKey": "ABCD-EFGH-IJK1-MOP9"
  }
]

To have License Web email the key to the customer, set sendEmail to true. Set it to false if your store sends the key itself.

For a trial key, also set isTrial to true and duration to the trial length in minutes. This example adds a 14-day trial key (20,160 minutes):

[
  {
    "productCode": "MyProductCode",
    "email": "john@contaso.com",
    "productKey": "ABCD-EFGH-IJK1-MOP9",
    "isTrial": true,
    "duration": 20160
  }
]

The key is now in License Web with the customer's details. The email address is required.

Activate the key from your product#

In your product's installer, or on an activation page or menu, ask the user for the product key and email address. Send them to activateLicense.

Also send a uid, such as the MAC address, host ID or another value unique to the machine. uid is optional, but it stops a key that is meant for one computer from being used on others.

{
  "productCode": "yourproductcode",
  "email": "john@contaso.com",
  "productKey": "ABCD-EFGH-IJK1-MOP9",
  "uid": "1c1E45ox"
}

Store the activation locally#

Store the activation details in your product's local database or elsewhere on the system, so your product does not need to call License Web every time it checks the licence.

If something looks wrong, call getLicenseStatus to check. For example, if the uid stored in License Web does not match the current machine, show a licensing error and ask the user to fix it.

Let users deactivate#

Give users a way to deactivate the key with deactivateLicense. They need this to move the licence from one computer or instance to another.

{
  "productCode": "string",
  "email": "string",
  "productKey": "string"
}

Handle trials#

After the key is activated, call getTrialInfo. Pass ProductCode, Email, ProductKey and UID in the query string. UID is optional, but if you sent a uid to activateLicense, you must send it here too, or validation fails.

/getTrialInfo?ProductCode=LCWEB&ProductKey=9KAZ-VKU9-2IJ6-HT20&Email=williams@outlook.com&UID=2K-3G-70-CI-9X-70
{
  "isTrial": true,
  "duration": 20160
}

Store the response in your local database for reference, and show a trial message if you like. duration is always in minutes.

Send the expiry date back (optional)#

You do not normally need this step. Sending the expiry date from your product back to License Web records when the trial was activated and how long the user has. You can use this for promotions. Use setExpiryDate:

{
  "productCode": "string",
  "email": "string",
  "productKey": "string",
  "uid": "string",
  "expireAt": "2024-09-12T14:51:00+05:30"
}

Check the status when needed#

Your product has the licence details locally, but sometimes you need to check against License Web. Call getLicenseStatus. It returns one of four statuses: Entry, Activated, Deactivated or Expired.

ProductCode, ProductKey and Email are required. UID is also required if you used it for activation.

/getlicensestatus?ProductCode=ADW&Email=john%40contaso.com&ProductKey=FW80-HU3K-3ZM3-9H4G

If any parameter does not match the data in License Web, you get the error Key not found.

Website plugin or theme licensing#

If you build plugins, themes or extensions for websites and license them per website, use the website's host address as the uid. The rest of the flow is the same; License Web validates the key against the host address.

Inventory for resellers#

Resellers can use License Web to keep an inventory of product keys and customer details. Without any activation process, you still track each key and change its status manually.

Key generation utility#

License Web's configurable key generation rules let you create keys in any pattern you choose. Generate Keys creates thousands of keys at once. See Get started with License Web.

Key distribution portal#

License Web can create and issue keys. Its email templates send keys to customers and notify them of status changes such as activation and deactivation, so you can use it as your key distribution portal.

Get help with your scenario#

If you are not sure how to handle your scenario, contact Dart Innovations support.

Type at least two letters. Use ↑ ↓ and Enter to open a result.