License Key Generators

A license key generator allows you to create customized licensing information for customers at the time of purchase. Unlike license key lists, these licenses are not pre-generated. Rather, at the time the customer clicks 'Buy', the cleverbridge platform calls your license key generator, submits the purchase details, and requests the license information back as a response.

This offers you the following advantages:

  • Manual effort is not required any longer to regularly upload additional license key lists.
  • The license can include information about the customer. This helps reduce software piracy because customers are less likely to pass this information on to someone else.

Simulate a License Key Generator Call

When cleverbridge wants to generate a license key for your product, we make a HTTP(S) POST request of a web form to a URL that is hosted on your web server. Your server then takes the submitted data, generates the license, and returns it in the response to cleverbridge.

To simulate what happens when cleverbridge calls your web key generator, do the following:

  1. Download the following sample HTML page: https://www.cleverbridge.com/ca/LicenseGeneratorTest.html
  2. Replace the URL in the <form> tag with your key generator URL.
  3. Click the Send button. You will receive the data in HTTP POST variables. This is the same data that cleverbridge receives when it calls your key generator.

References

License Key Generator Implementation

To implement a simple license key generator, you can use the following:

Define a License Key Template

cleverbridge offers you the option to define a template for your license key. To set up a template in the Commerce Assistant, do the following:

  1. In the Product portal, select the product for which you would like to create a license key template.
  2. Under Delivery, select the Delivery Texts tab.
  3. Select the Key template checkbox. The Key template textbox opens.
  4. Create a template. You can use the following placeholders:

    Placeholder Description
    <Key> License key
    <RegName> Customer name
    <ProductId> Product ID

    <InternalProductId>

    Internal product ID
    <[NAME_OF_X_PARAM]> Corresponding x-parameterClosedThe x-parameter is a variable appended to a URL that allows grouping and tracking orders for later reporting purposes. It also enables you to pass through data that you want to capture in the order process. X-parameters can also be used to control design elements based on the value of the x-parameter.
    <ProductName> Name of the ordered product
    <Quantity> Quantity of the ordered product
    <ProductTrialUrl> URL to download a trial version of the product
  5. Click Save.

Tip

Defining a template in the Commerce Assistant, as opposed to using standard software, allows you to:

  • Use a generic template
  • Insert placeholders that are replaced by purchase info
  • Define multiple languages
  • Use HTML

Note

If you do not enter a key template, the default template is used. A key template starts with <Key>.

For more information about templates, including information about email key templates, see Products ✱.

Add a License Key Generator in the Commerce Assistant

You can use the Key Generator portal to add, view, and edit a web key generator. To add a web key generator, do the following:

  1. In the main menu, select Products & Delivery > Add Web Key Generator. The Key Generator portal opens.
  2. Enter information in the following fields:

    Field Description
    Name Enter a unique name for the key generator.
    Path

    Enter the full URL of the key generator.

    Note

    The URL of your key generator must have an HTTPS scheme.

    Note

    SSL certificates for HTTPS are only supported if they are signed by a trusted authority.

    Authenticate Select to authenticate username and password access to the key generator.
    Username and Password Enter a username and password to access the key generator.
    Interface Select Type 1, unless Client Experience has instructed you otherwise.
    Character Encoding Select the type of XML character encoding to use for the key generation. Most clients typically choose Unicode (UTF-8).
    Use Romanized Contact Values Select to render western characters for the Company, First name, and Last name contact values for languages such as Chinese, Japanese, and Russian.
    Call Once Per Purchase If checked, the key generator is called once for the entire purchase in the shopping cart. If left unchecked, the key generator is called once for every purchase item in the shopping cart.
    Notification Document Type

    If selected, an XML or JSON notification with transactional data is pushed to the key generator during the API call. If not selected, the key generator will receive a limited amount of information.

    Note

    The XML or JSON notification document used in web key generator calls is identical to the PaidOrderNotification, with the exception of the Deliveries Array.

    XML Schema Select the XML schema version. XML notifications can be generated so that they are compatible with newer or older versions of XML.
    Client Handles Errors

    Select if you wish to manage key generation errors on your own. If you do not select this option, cleverbridge manages key generation errors (recommended).

    Note

    If a key generation or key list error occurs, the following happens:

    • If you have set up this notification type, you receive an ErrorNotification.
    • An error log entry is created.
    • The cleverbridge platform makes up to five attempts to generate or obtain the key (after 1-2-4-8-16 hours). After each unsuccessful attempt, an ErrorNotification is sent and an error log entry created.
    • If the fifth attempt to generate or obtain the key fails, our Customer Support will investigate the error (unless Client handles errors is activated).
  3. Click Save.