License keys
This feature is available for users with our 2019 Standard and Advanced plans and our legacy Pro plan.
Software license keys are useful to prevent your products from being copied, shared, or otherwise illegally used by a non-licensed user. By providing a key for every individual product, you’re ensuring that the product is only being used under your terms and conditions.
Selling apps, software, themes, templates or any other digital product with license keys is simple.
On this page
How to create a license key
- No license keys issued
- Automatic - You can let us automatically generate the license keys
- List - You can provide your own license keys as a list
- Remote - You can add an existing system that we can query to return your license keys from a provided URL
- Unused: You can delete and they will be removed from the list of license keys for that item
- Used: You can select to view the related order
- product_id (the unique id of the product)
- key (the license key provided by your customer)
- increment_usage_count ("true"/"false", optional, default: "true")
- Remote license keys: We couldn't connect to your remote URL
- List license keys: There are no more licenses available for the item
- Remote license keys: Check that your URL is correctly configured and working
- List license keys: Check the item to ensure that there are license keys available
Create or edit your product and select the Licences tab, to see the following options:
No license keys issued
This is the default for all items and we will not issue any license keys.
Auto-generate
Selecting Auto-Generate enables us to automatically assign a 16 character license that has the form XXXX-XXXX-XXXX-XXXX.
Using Auto-Generate means no other actions are required to maintain the generation and assigning of the licenses.
List
Allows you to add a list of license keys to an item. Each license is added as a new row within the New license keys section. Once an order is processed we'll assign the next available license key from the list.
Once saved you can see licenses that have been used and unused for an item. Select View licenses to see more detail.
You can add additional license keys at any time by pasting them in the New license keys field.
Remote
When you have an existing system to manage your licenses keys we will call this system via a defined URL to obtain the next license.
Enter the URL and click Test, we'll then verify that we can connect to the URL. Once an order is processed we'll assign the license obtained via the URL.
We will make a POST request to the URL with a JSON encoded body shown below. Use the Quantity
property to determine how many licenses need to be returned.
Request
{ "OrderId": "57be45fdcca918100c0156b1", "ReferenceId": "XZHQ59WA", "ProductId": "57be45fdcca918100c0156b3", "BuyerName": "John Doe", "BuyerFirstName": "John", "BuyerLastName": "Doe", "BuyerEmail": "support@selz.com", "Quantity": 3 }
Response
{ "Keys": [ "N3U5-7V5B-74A2", "K3N2-2TYP-U75L", "H0LU-9EEB-34W3" ] }
Verification key
A verification key is provided to verify that the webhook originated from Selz. See our guide to securing webhooks.
How license key enforcement works
License key enforcement is completely up to you. As the seller, you can decide how many uses each key gets depending on the verify license API calls you make. We provide no additional license key verification.
Remember that if you check for a valid license on each launch you will increment the usage count unless you set increment_usage_count flag to false.
You can also make sure a user hasn't refunded or charged back their purchase by checking the status fields of the order the license verify API call response.
Verifying a license key in your application
Verifying a license key uses these parameters:
Note: If you need to locate the Product ID for a product, navigate to Items from the dashboard and click on the product in question. Check the URL in your browser address bar and the numbers and letters at the end of the URL is the Product ID. For example https://app.selz.com/items/edit/5d0c733e701f5d16d88ce692
We use these parameters to call the Selz API and verify the provided license key.
Example
curl --request POST \ --url https://api.selz.com/products/{product_id}/licenses/verify \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '{"key":"xxxx-xxxx-xxxx-xxxx","increment_usage_count":true}'
Response
{ "is_active":true, "usage_count":4, "order":{ "id":"58200c2b131bbb308cc77700", "reference_id":"AAAAAAAA", "customer":{ "first_name":"John", "last_name":"Doe", "email":"jd@selz.com", "company":null, "delivery_address":null, "billing_address":{ "line1":"1 Surfview Road", "line2":null, "city":"Manly", "post_code":"2095", "state_code":"NSW", "country_code":"AU" } }, "items":[ { "product_id":"58200c2b131bbb308cc66603", "product_title":"Some awesome tool", "product_variant_title":null, "discount_code":null, "quantity":4, "unit_price":"1.00", "currency":"AUD" } ], "currency":"AUD", "total_price":"4.40", "total_shipping":"0.00", "total_tax":"0.40", "price_includes_tax":false, "created_time":"2016-11-07T05:59:48.229Z", "custom_fields":null } }
Failed licenses
If an order is processed and a license key cannot be assigned then a notification is sent advising that the order and item require attention.
Common reasons for failed licenses:
The order will still be processed and the customer will be notified within their order confirmation that the license key is pending. Orders with failed license keys will also be highlighted within the order list.
To resolve failed licenses:
Once the above has been resolved, license keys will need to be assigned for each failed order, within the order detail page select 'Retry' and we'll attempt to reassign license keys for the order. Once successful we'll automatically email the customer their license keys.