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. To deliver a license key with the product, you first need to edit the product, switch to the tab Deliver 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 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.
Guide
- In the Vendor view, go to Product setup > Product configuration.
- Click on the pencil icon of your product.
- Go to the tab Deliver.
- Under Deliver license key, select “generated by Digistore24” in the dropdown menu.
The license key is transferred as the parameter “license_key” to the thank you page, but can also be sent as IPN notification. You now have two options:
- You can find the GET parameter “license_key” on the thank you page in the link as described here.
- You program an IPN access. You will find the important parameters as well as a guide on how to do this here.
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.
Guide
- In the Vendor view, go to Product setup > Product configuration.
- Click on the pencil icon of your product.
- Go to the tab Deliver.
- In the field License key type, select HTTP request from the dropdown menu.
- Enter the URL of your license server in the License server URL field. To do this, you must first enable access to your license server via an HTTP call. You can download an example of a suitable PHP server here. Digistore24 then expects a JSON-encoded data set from your license server, which you can find below this guide.
- In case of errors, notify: If you want, you can now specify an email address that will be contacted if access to your license server has failed. We recommend this because it will allow you to fix any errors immediately and keep your products secure with the license key.
What data does Digistore24 expect from your license server?
Digistore24 expects a JSON-encoded data set with the license data:
array(status=> 'success' key=>LICENSE KEY data=> LICENSE DATA)
LICENSE DATA is a data set with any key-value pairs, e.g.: array(name => 'John Smith' order_id => 'A1B2C3D4' etc.)
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
- 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 Product setup > 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.
Guide
- In the Vendor view, go to Product setup > License keys.
- Click on the button Create license key list.
- Enter a name of your license key list.
- Now insert one license key per line.
- As an alternative to step 4, you can also automatically fill this list (optional!) by programming a bulk license server (a sample PHP script can be found here). Then enter the retrieval URL in the Refill URL field.
- In case of errors, notify: If you want, you can now specify an email address that will be contacted if access to your license server has failed. We recommend this because it will allow you to fix any errors immediately and keep your products secure with the license key.
- Finally, click on Save.
If you added a bulk license server in step 5 to automatically add license keys to your key list, click the Request keys from URL button. Now you have to connect the license key list to Digistore24:
- In the Vendor view, go to Product setup > Product configuration.
- Click on the pencil icon of your product.
- Go to the tab Deliver.
- For the field License key type, select HTTP request.
- Select the license key list that you just created in the License key list dropdown menu.
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 validate LicenseKey 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.