Manage2 API Function - Service Credit

Last modified: March 12, 2021


Description

This function returns the Manage2 account’s service credit status.

Examples

XML

https://manage2.cpanel.net/XMLserviceCredit.cgi?liscid=123456

JSON

https://manage2.cpanel.net/XMLserviceCredit.cgi?liscid=123456&output=json

YAML

https://manage2.cpanel.net/XMLserviceCredit.cgi?liscid=123456&output=yaml

1
2
3
4
5
6
7
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing("[email protected]", "123456luggage");
$ret = $cpl->addServiceCredit(array(
    "liscid" => "1234"
));
?>

1
2
3
4
5
use cPanelLicensing;
my $cpl = new cPanelLicensing(user => 'username\@example.com', pass => '123456luggage');
my $result = $licenseManager->addServiceCredit(
    'liscid' => '1234'
);

1
2
3
4
<XMLserviceCredit reason="OK" status="1">
  <results license_id="12345" status="approved" status_reason="Successfully applied service credit" />
  <results license_id="54321" status="denied" status_reason="license_id not found in last invoice." />
</XMLserviceCredit>

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
{
  "reason": "OK",
  "status": 1,
  "results": [
    {
      "license_id": "12345",
      "status": "approved",
      "status_reason": "Successfully applied service credit"
      },
    {
      "license_id": "54321",
      "status": "denied",
      "status_reason": "license_id not found in last invoice."
    }
  ]
}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
---
reason: OK
status: 1
results:
- license_id: '12345'
  status: approved
  status_reason: Successfully applied service credit
- license_id: '54321'
  status: denied
  status_reason: license_id not found in last invoice.

Parameters

This function accepts the following parameters:

Return Type Description Example
liscid integer Required
The license ID number. To list multiple licenses, enter this parameter multiple times. For example, add the &liscid=1&liscid=2 string to your browser-based call.
12345

Returns

This function returns the following values:

Return Type Description Example
results array of objects An array of objects containing license IDs and their service credit status.
    licenseid integer The license’s ID number.

The function returns this value in the results object.
12345
    status string The license ID’s service credit status:
  • approved
  • denied
The function returns this value in the results object.
denied
    status_reason string The reason why the status return is the denied or approved value:
  • license_id not found in last invoice.
  • license_id refers to a legacy license.
  • An adjustment has already been granted for this license_id.
  • Adjustment would put license over cpanel revenue percentage limit.
  • Successfully applied service credit.
  • license_id must refer to an inactive license.
license_id not found in last invoice.

Additional Documentation