Expire Licenses — XMLlicenseExpire.cgi

This Manage2 function allows you to expire an existing license. When a license is expired, cPanel & WHM cannot be accessed on that license's IP.

Variables

Input

  • liscid (integer) — The ID number of the license you wish to expire.
    • Example: 12354
  • reason (string) — The reason for expiring the license.
    • note Note: This is useful when managing multiple licenses.
  • expcode (string) — The reason code for expiring the license (distributors only).
    • Valid Codes:
      • normal (Normal Cancellation - No Security Risk)
      • nocomplete (Customer did not complete transaction - No Security Risk)
      • noverify (Customer did not complete transaction or you were unable to verify the customer - Security Risk)
      • shutoff (Customer did not comply with policies (spam, payment, etc) - Security Risk)
      • chargeback (Customer reversed charged - Medium Security Risk)
      • fraud (Customer provided compromised or fraudulent information - High Security Risk)
      • other (Other reason)

Output

  • licenseid (string) — The ID of the license that has been expired.
  • reason (string) — Describes, in English, the result of the request.
    • Example: Expired 45-DAY-TEST license 7216526 in the 'cPanel/WHM Auto Trial' group on 69.90.243.165 for reason: Normal Cancellation - No Security Risk.
  • status (integer) — The status of the license expiration.
    • 1 — The license has been successfully expired.
    • 0 — The request has failed.

Examples

Using HTTP (direct API call)

Calling http://manage2.cpanel.net/XMLlicenseExpire.cgi?liscid=7216526&expcode=normal in a web browser will produce XML output similar to the following:

<XMLlicenseExpire licenseid="7216526" status="1"
reason="Expired 45-DAY-TEST license 7216526
in the 'cPanel/WHM Auto Trial' group on 69.90.243.165
for reason: Normal Cancellation - No Security Risk."/>

Calling the function using the URL above will return XML data by default. To change the output format that will be returned, use either of the following URLs:

  • JSONhttp://manage2.cpanel.net/XMLlicenseExpire.cgi?output=json&liscid=7216526&expcode=normal
  • YAMLhttp://manage2.cpanel.net/XMLlicenseExpire.cgi?output=yaml&liscid=7216526&expcode=normal
For more information about each of these output types, visit our Choosing an Output Type documentation.

Using a Perl module

The following is an example of a Perl module that will call XMLlicenseExpire.cgi. You can use this module to pass input variables to a Manage2 API function. You will need to edit the example below to suit your needs.

use cPanelLicensing;
    my $cpl = cPanelLicensing->new(user => $user, pass => $pass);
    $cpl->expireLicense(liscid => 7216526, expcode => "normal"); 

In the example above, $liscid is meant to stand for the license ID corresponding to the license you wish to expire.

Learn more about using a Perl module to call API functions.

Using a PHP class

The following is an example showing how to call the cPanelLicensing PHP class. You can use this class to pass input variables to the Manage2 API using a few short calls.

<?php
    include("cpl.inc.php");
    $cpl = new cPanelLicensing($user, $pass);
    $cpl->expireLicense(array( "liscid" => "7216526", "expcode" => "normal"));
?>

PICK Remember: $user and $pass represent the username and password for your Manage2 account.

Learn more about using a PHP class to call API functions.

Topic revision: r20 - 21 Feb 2013 - 20:10:22 - Main.ColinShannon
ManageTwo.ExpireLicense moved from Sandbox.ExpireLicense on 21 Jul 2009 - 19:13 by Main.JustinSchaefer - put it back