Manage2 API Function - Expire Licenses


Last modified: June 20, 2023

Description

This function expires a license.

Examples

XML

https://manage2.cpanel.net/XMLlicenseExpire.cgi?liscid=7216526&reason='Normal Cancellation - No Security Risk'&expcode=normal

JSON

https://manage2.cpanel.net/XMLlicenseExpire.cgi?output=json&liscid=7216526&reason='Normal Cancellation - No Security Risk'&expcode=normal

YAML

https://manage2.cpanel.net/XMLlicenseExpire.cgi?output=yaml&liscid=7216526&reason='Normal Cancellation - No Security Risk'&expcode=normal

1
2
3
4
5
6
7
8
9
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing("[email protected]", "123456luggage");
$cpl->expireLicense(array(
    "liscid" => "7216526",
    "reason" => "Normal Cancellation - No Security Risk",
    "expcode" => "normal")
    );
?>

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
my $licenseManager = new cPanelLicensing(
    user => 'username\@example.com',
    pass => '123456luggage'
);

my $liscid = $licenseManager->expireLicense(
    'liscid'  => '7216526',
    'reason'  => 'Normal Cancellation - No Security Risk',
    'expcode' => 'normal'
);

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

1
2
3
4
5
6
{
    "status": 1,
    "reason": "Expired 45-DAY-TEST license 7216526 in the 'cPanel/WHM Auto Trial' group on 192.0.2.0 for reason: Normal Cancellation - No Security Risk.",
    "result": "OK",
    "licenseid": "7216526"
}

1
2
3
4
5
---
status: 1
reason: 'Expired 45-DAY-TEST license 7216526 in the 'cPanel/WHM Auto Trial' group on 192.0.2.0 for reason: Normal Cancellation - No Security Risk.'
result: OK
licenseid: '7216526'

Parameters

This function accepts the following parameters:

Parameter Type Description Example
liscid integer Required
The license ID to expire. The Manage2 List License Information function returns a list of possible values.
7216526
reason string Recommended
The reason to expire a license.
Normal Cancellation - No Security Risk.
expcode string The license expiration reason code:
  • normal
  • nocomplete
  • noverify
  • shutoff
  • chargeback
  • fraud
  • other
This parameter defaults to normal. This parameter is recommended for distributors.
normal

Returns

This function returns the following values:

Return Type
Description
Example
licenseid integer The expired license’s ID. 7216526
reason string The function’s result. Expired 45-DAY-TEST license 7216526 in the "cPanel/WHM Auto Trial" group on 192.0.2.0 for reason: Normal Cancellation - No Security Risk.
result string Whether the license expired:
  • OK — The license expired.
  • "" — The license did not expire.
OK
status Boolean Whether the function succeeded:
  • 1 — Success.
  • 0 — Failure.
1

Additional Documentation