1. Home
  2. Sell products as a vendor
  3. Provide product
  4. Deliver software licenses automatically

Deliver software licenses automatically

If you sell software, it is a good idea to secure your product with a license key. Digistore24 can deliver a license key with your product.

The license keys are delivered with the order confirmation via email and are displayed on the order confirmation page.

Insert WordPress Content

To deliver a license key with the product, you first need to edit the product, switch to the "Deliver" tab and select one of the following three options for "License key type":

1. License key type: "generated by Digistore24"

Digistore24 creates the license key. The license key is random and unique (i.e. two different orders are guaranteed to have different license keys). Digistore24 must then be able to send the key to your system so that the license key can be verified within your software.

Pros and cons

You do not have to worry about generating the license keys. Digistore24 ensures that the keys are unique (among all the license keys supplied by Digistore24).

However, your system must accept the Digistore24 key (as a GET parameter when forwarding to the thank you page or through an IPN notification) and store it in your database. Your software must then be able to verify the key against your database.


2. License key type: "Your license server"

You set up a URL that Digistore24 uses to request the license keys. An HTTP call is then made for each order.

You can find an example script in PHP for a license server here.

Pros and cons

You can program your license server so that it integrates the customer data into the key. For example, the customer could then enter their name and key in your software. The software will only be unlocked if both match.

Since an HTTP call is carried out for each order, you need to make sure that your server can be reached and that you have not installed any security plug-ins that could interfere with the call.


What data does Digistore24 expect from your license server?

Digistore24 expects a JSON-encoded data set with the license data:

status   => 'success'
key        =>  LICENSE KEY
data      => LICENSE DATA
LICENSE DATA is a data set with any key-value pairs, e.g.:
name => 'John Smith'
order_id => 'A1B2C3D4

Useful feature: Order data transfer to license server

Once Digistore24 gains access to the URL of your license server, Digistore24 will transfer the following data via POST:

  • order_id
  • email
  • product_name
  • product_id
  • quantity – The quantity of ordered products
  • api_mode – ‚live‘ or ‚test‘ (for test orders)
  • address_first_name
  • address_last_name
  • address_street
  • address_city
  • address_state
  • address_zipcode
  • address_phone_no

3. License key type: Key list

You provide Digistore24 with a list of license keys. Digistore24 will then remove one key from the list for each purchase and provide it to the customer.

To do this, in the vendor view go to Settings > License keys and provide a list of license keys.

You can fill the list by copy and pasting keys or you can specify a URL. Digistore24 will then read the license keys from this URL. You can find an example script in PHP for a bulk license server here.

With this method, you always have to make sure that you complete the key list in Digistore24, otherwise no further license keys will be delivered.

Please comply with the license key criteria specified by Digistore24 for your license keys.


Criteria for a license key

A license key must meet the following requirements:

  • Minimum key length is 4 characters
  • Maximum key length is 511 characters
  • No spaces allowed at the beginning or in the middle (will be deleted)
  • Allowed characters: a-z A-Z 0-9 – + # _,. :; / () $% & <> | space

If you want to place multiple products/add-ons in a license key, use the "|" and a colon ":". For example:

"A product:12345678|An add-on:87654321|Another add-on:aabbccddee"

This will be displayed to the buyer as follows:

A product: 12345678
An add-on: 87654321
Another add-on: aabbccddee

You can add as many products/add-ons as you like as long as the key is no longer than 511 characters.

Other functions

Test the validity of a license key with an API

You can use the API function validateLicenseKey to continuously test whether a license key is still valid. For example,  if you offer software as a subscription, you could program this API function to check the license key every time someone subscribes.

Instead of sending license keys, send login data to Digistore24's member page

Just as Digistore24 requests a license key from your server, you can also specify that access data be transmitted to member sites. Find out more here.

Updated on 14. February 2020

Was this article helpful?

Related Articles