Internal Helper File Integration

You can programmatically control and automate LicenseBox from your order management system or any other scripting tool by utilizing the internal helper file, which you can generate from within your LicenseBox administration panel.

Note: Please be advised that helper files are currently only available for the PHP programming language. However, you can access the comprehensive API documentation here which contains all API endpoints, parameters, and cURL snippets to aid you in making requests from your non-PHP applications.

Getting Started

  1. Log in to LicenseBox and create a new API Key of type 'Internal' from the API Settings Page.

  2. Go to Internal Helper File generator from the Generate dropdown on the menu.

  3. Select the API Key, and API Language, and then click Generate and copy the generated code.

  4. Save the generated file as whatever name you want to use in your script, we are going to use lb_internal_helper.php. So when you are done with this step you should have a lb_internal_helper.php file in your script root/includes folder.

  5. Go to your script and include the lb_internal_helper.php file as given below.

  6. At the very top paste the following code:

    require_once 'includes/lb_internal_helper.php';
    $api = new LicenseBoxInternalAPI();
    

    Note: lb_internal_helper.php file on its own does nothing but it contains all the required functions and you can call them however you want.

  7. Now you can call any available Internal API function from your application, to learn more about all the available functions and what they do with live examples, add your generated Internal helper file code as lb_internal_helper.php file in the includes folder present inside licensebox_api_usage_examples folder and view the internal_api_examples.php file.

  8. For example, you can add a new product in LicenseBox using add_product() function.
    $res = $api->add_product("Test Product");
    echo $res['message'];
    
  9. You can also create a new license in LicenseBox using create_license() function.
    $data = array(
      'license_type' => 'Regular License',
      'invoice_number' => '#98765',
      'client_name' => 'John Snow',
      'client_email' => 'jon@example.com',
      'comments' => null,
      'licensed_ips' => null,
      'licensed_domains' => null,
      'support_end_date' => null,
      'updates_end_date' => null,
      'expiry_date' => '2023-01-25 10:00',
      'license_uses' => null,
      'license_parallel_uses' => 1
    );
    $res = $api->create_license($product_id, $data);
    echo $res['message'];
    
  10. You can also block a license using block_license() function.
    $res = $api->block_license($license_code);
    echo $res['message'];
    
  11. There are a lot more ways in which you can use LicenseBox Internal API please check all the available functions of the helper file, if you are facing issues getting the integration to work, enable the Debug mode in the helper file by changing the LB_API_DEBUG value to true.

    ❮ Previous (Client Helper File Integration) Next (FAQs) ❯


    Please mail us your feedback at support@licensebox.app
    Follow us on twitter at @LicenseBoxApp for future product updates