We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • Manage2 API Functions - List Package Information
Skip to end of metadata
Go to start of metadata

Description

This function returns the Manage2 account's packages.

Examples 


 Browser-based Calls
XML
http://manage2.cpanel.net/XMLpackageInfo.cgi
JSON
http://manage2.cpanel.net/XMLpackageInfo.cgi?output=json
YAML
http://manage2.cpanel.net/XMLpackageInfo.cgi?output=yaml

Note:

To see the expanded returns, add expand to the end of each browser-based call.

 cPanel Licensing PHP Class
<?php
include("cpl.inc.php");
$cpl = new cPanelLicensing("barney@example.com","12345luggage");
$lisc = $cpl->fetchPackages();
?>
 cPanel Licensing Perl Module
use cPanelLicensing;
    my $cpl = new cPanelLicensing(user => 'barney\@example.com', pass => '12345luggage');
$cpl->fetchPackages()
 Output (JSON)
{
    "package": [
        {
            "autoscale_target": 0,
            "base_price": "0.00",
            "bulk_charge": "0.00",
            "discountable": 0,
            "external": 0,
            "host_type": "dedicated",
            "is_autoscale": 0,
            "max_accounts": null,
            "name": "2-HOUR-DEPLOYMENT",
            "packageid": "P2",
            "product_name": "cPanel/WHM",
            "producttype": 1,
            "term": null,
            "term_seconds": 7200,
            "trial": 1,
            "user_billing_rate": "0.00",
            "user_billing_threshold": null,
            "valid": 1
        },
        {
            "autoscale_target": 0,
            "base_price": "0.00",
            "bulk_charge": "0.00",
            "discountable": 0,
            "external": 0,
            "host_type": "dedicated",
            "is_autoscale": 0,
            "max_accounts": null,
            "name": "2-DAY-TEST",
            "packageid": "P3",
            "product_name": "cPanel/WHM",
            "producttype": 1,
            "term": null,
            "term_seconds": 172800,
            "trial": 1,
            "user_billing_rate": "0.00",
            "user_billing_threshold": null,
            "valid": 1
        },
        {
            "autoscale_target": 0,
            "base_price": "0.00",
            "bulk_charge": "0.00",
            "discountable": 0,
            "external": 0,
            "host_type": "dedicated",
            "is_autoscale": 0,
            "max_accounts": 0,
            "name": "CPANEL-SERVERS-INTERNAL",
            "packageid": "P9",
            "product_name": "cPanel/WHM",
            "producttype": 1,
            "term": 1,
            "term_seconds": null,
            "trial": 0,
            "user_billing_rate": "0.00",
            "user_billing_threshold": null,
            "valid": 1
        },
        {
            "autoscale_target": 0,
            "base_price": "0.00",
            "bulk_charge": "0.00",
            "discountable": 0,
            "external": 0,
            "host_type": "dedicated",
            "is_autoscale": 0,
            "max_accounts": 1,
            "name": "60-DAY-TEST",
            "packageid": "P27",
            "product_name": "cPanel/WHM",
            "producttype": 1,
            "term": null,
            "term_seconds": 5184000,
            "trial": 1,
            "user_billing_rate": "0.00",
            "user_billing_threshold": null,
            "valid": 1
        },
        {
            "autoscale_target": 0,
            "base_price": "0.00",
            "bulk_charge": "0.00",
            "discountable": 0,
            "external": 0,
            "host_type": "dedicated",
            "is_autoscale": 0,
            "max_accounts": null,
            "name": "ONE TIME FEE",
            "packageid": "P121",
            "product_name": "cPanel/WHM",
            "producttype": 1,
            "term": -32768,
            "term_seconds": null,
            "trial": 0,
            "user_billing_rate": "0.00",
            "user_billing_threshold": null,
            "valid": 1
        },
],
    "reason": "OK",
    "status": 1,
    "version": 0.3
}
 Output (XML)
 <XMLpackageInfo reason="OK" status="1" version="0.3">
  <package name="2-HOUR-DEPLOYMENT" autoscale_target="0" base_price="0.00" bulk_charge="0.00" discountable="0" external="0" host_type="dedicated" is_autoscale="0" max_accounts="" packageid="P2" product_name="cPanel/WHM" producttype="1" term="" term_seconds="7200" trial="1" user_billing_rate="0.00" user_billing_threshold="" valid="1" />
  <package name="2-DAY-TEST" autoscale_target="0" base_price="0.00" bulk_charge="0.00" discountable="0" external="0" host_type="dedicated" is_autoscale="0" max_accounts="" packageid="P3" product_name="cPanel/WHM" producttype="1" term="" term_seconds="172800" trial="1" user_billing_rate="0.00" user_billing_threshold="" valid="1" />
  <package name="CPANEL-SERVERS-INTERNAL" autoscale_target="0" base_price="0.00" bulk_charge="0.00" discountable="0" external="0" host_type="dedicated" is_autoscale="0" max_accounts="0" packageid="P9" product_name="cPanel/WHM" producttype="1" term="1" term_seconds="" trial="0" user_billing_rate="0.00" user_billing_threshold="" valid="1" />
  <package name="60-DAY-TEST" autoscale_target="0" base_price="0.00" bulk_charge="0.00" discountable="0" external="0" host_type="dedicated" is_autoscale="0" max_accounts="1" packageid="P27" product_name="cPanel/WHM" producttype="1" term="" term_seconds="5184000" trial="1" user_billing_rate="0.00" user_billing_threshold="" valid="1" />
  <package name="ONE TIME FEE" autoscale_target="0" base_price="0.00" bulk_charge="0.00" discountable="0" external="0" host_type="dedicated" is_autoscale="0" max_accounts="" packageid="P121" product_name="cPanel/WHM" producttype="1" term="-32768" term_seconds="" trial="0" user_billing_rate="0.00" user_billing_threshold="" valid="1" />
</XMLpackageInfo>

With expand:

<XMLpackageInfo reason="OK" status="1" version="0.3">
    <package name="ALICETESTCOMPANY-CLOUDLINUX-INTERNAL-WITH-CPANEL" base_price="9.00" discountable="0" external="0" host_type="dedicated" max_accounts="0" packageid="P8966" product_name="CloudLinux" producttype="16" term="1" term_seconds="" trial="0" user_billing_rate="0.00" user_billing_threshold="" valid="1"/>
    <package name="ALICETESTCOMPANY-CLOUDLINUX-INTERNAL-WITHOUT-CPANEL" base_price="11.00" discountable="0" external="0" host_type="dedicated" max_accounts="0" packageid="P8970" product_name="CloudLinux" producttype="16" term="1" term_seconds="" trial="0" user_billing_rate="0.00" user_billing_threshold="" valid="1"/>
    <package name="ALICETESTCOMPANY-INTERNAL" base_price="50.00" discountable="0" external="0" host_type="dedicated" max_accounts="0" packageid="P8974" product_name="cPanel/WHM" producttype="1" term="1" term_seconds="" trial="0" user_billing_rate="0.00" user_billing_threshold="" valid="1"/>
    <package name="cPanel Plus Cloud" base_price="25.00" discountable="1" external="0" host_type="virtual" max_accounts="50" packageid="P22081" product_name="cPanel/WHM" producttype="1" term="1" term_seconds="" trial="0" user_billing_rate="0.00" user_billing_threshold="" valid="1"/>
</XMLpackageInfo>
 Output (YAML)
--- 
package: 
  - 
    autoscale_target: 0
    base_price: '0.00'
    bulk_charge: '0.00'
    discountable: 0
    external: 0
    host_type: dedicated
    is_autoscale: 0
    max_accounts: ~
    name: 2-HOUR-DEPLOYMENT
    packageid: P2
    product_name: cPanel/WHM
    producttype: 1
    term: ~
    term_seconds: 7200
    trial: 1
    user_billing_rate: '0.00'
    user_billing_threshold: ~
    valid: 1
  - 
    autoscale_target: 0
    base_price: '0.00'
    bulk_charge: '0.00'
    discountable: 0
    external: 0
    host_type: dedicated
    is_autoscale: 0
    max_accounts: ~
    name: 2-DAY-TEST
    packageid: P3
    product_name: cPanel/WHM
    producttype: 1
    term: ~
    term_seconds: 172800
    trial: 1
    user_billing_rate: '0.00'
    user_billing_threshold: ~
    valid: 1
  - 
    autoscale_target: 0
    base_price: '0.00'
    bulk_charge: '0.00'
    discountable: 0
    external: 0
    host_type: dedicated
    is_autoscale: 0
    max_accounts: 0
    name: CPANEL-SERVERS-INTERNAL
    packageid: P9
    product_name: cPanel/WHM
    producttype: 1
    term: 1
    term_seconds: ~
    trial: 0
    user_billing_rate: '0.00'
    user_billing_threshold: ~
    valid: 1
  - 
    autoscale_target: 0
    base_price: '0.00'
    bulk_charge: '0.00'
    discountable: 0
    external: 0
    host_type: dedicated
    is_autoscale: 0
    max_accounts: 1
    name: 60-DAY-TEST
    packageid: P27
    product_name: cPanel/WHM
    producttype: 1
    term: ~
    term_seconds: 5184000
    trial: 1
    user_billing_rate: '0.00'
    user_billing_threshold: ~
    valid: 1
  - 
    autoscale_target: 0
    base_price: '0.00'
    bulk_charge: '0.00'
    discountable: 0
    external: 0
    host_type: dedicated
    is_autoscale: 0
    max_accounts: ~
    name: ONE TIME FEE
    packageid: P121
    product_name: cPanel/WHM
    producttype: 1
    term: -32768
    term_seconds: ~
    trial: 0
    user_billing_rate: '0.00'
    user_billing_threshold: ~
    valid: 1
status: 1
version: '0.3'

Parameters

ParameterTypeDescriptionPossible valuesExample
expandstring

Displays the following additional package information returns:

  • base_price
  • bulk_charge
  • discountable
  • is_autoscale
  • autoscale_target
  • external
  • host_type
  • max_accounts
  • name
  • packageid
  • producttype
  • product_name
  • term
  • term_seconds
  • trial
  • user_billing_rate
  • user_billing_threshold
  • valid

This parameter does not accept values. 

expand

Returns

ReturnTypeDescriptionPossible valuesExample
packagehashA hash of package information.

A hash of each package's name and ID.

P001="ONE TIME FEE"

reasonstring

Information about the operation.

OK

OK
statusBooleanWhether the function succeeded.
  • 1 — Success.

  • 0 — Failure.
1
packagehash

A hash of expanded package information.

Note:

This return only appears when you add the expand parameter.

This hash includes the following returns:

  • base_price
  • bulk_charge
  • discountable
  • external
  • host_type
  • is_autoscale
  • autoscale_target
  • max_accounts
  • name
  • packageid
  • producttype
  • product_name
  • term
  • term_seconds
  • trial
  • user_billing_rate
  • user_billing_threshold
  • valid

 base_pricenumeric

The base rate of billing.

The function returns this value in the packages hash.

A numeric value that measures the price, in USD.17.50
 bulk_chargenumeric

A non-discountable charge for blocks of additional accounts.

The function returns this value in the packages hash.

A numeric value that measures the price, in USD.2.00
 discountableBoolean

Whether the package qualifies for a discount.

The function returns this value in the packages hash.

  • 1 — Qualifies.
  • 0 — Does not qualify.
1
  is_autoscaleBoolean

Whether the price scales with the license's account volume.

The function returns this value in the packages hash.

  • 1 — Auto-Scales.
  • 0 — Does not Auto-Scale.
1
  autoscale_target

Boolean

Whether the package is an option to licenses whose price scales with account volume (Auto-Scale).

The function returns this value in the packages hash.

  • 1 — Package is an option for Auto-Scale.
  • 0 — Package is not an option for Auto-Scale.
1
 externalBoolean

Whether the partner's hardware hosts the package (external).

The function returns this value in the packages hash.

  • 1 — Is external.
  • 0 — Is not external.
0
 host_typestring

The host type (virtual or dedicated) the license requires.

The function returns this value in the packages hash.

  • virtual
  • dedicated
virtual
 max_accountsinteger

The maximum number of accounts allowed on the license.

The function returns this value in the packages hash.

A positive integer.30
 namestring

The name of the package.

The function returns this value in the packages hash.

A valid cPanel package.

cPanel Pro Cloud
 packageidinteger

The ID number of the package.

The function returns this value in the packages hash.

A positive integer.21163
 producttypeinteger

The product type ID.

The function returns this value in the packages hash.

A numeric value assigned to a product name:

  • 1 — cPanel/WHM
  • 2 — Enkompass
  • 4 — RESERVED
  • 8 — SiteZen
  • 16 — CloudLinux
  • 32 — KernelCare
  • 64 — DNSOnly
  • 128 — LiteSpeed
  • 256 — Imunify360
  • 512 — WHMCS
  • 1024 — JetBackup
1
 product_namestring

The product name.

The function returns this value in the packages hash.

A valid cPanel product name:

  • cPanel/WHM
  • Enkompass
  • RESERVED
  • SiteZen
  • CloudLinux
  • KernelCare
  • DNSOnly
  • LiteSpeed
  • Imunify360
  • WHMCS
  • etBackup
cPanel/WHM
 terminteger

The license billing frequency (in months).

Note:

The term and term_seconds returns are mutually exclusive.

The function returns this value in the packages hash.

  • A positive integer.
  • null — The package uses the term_seconds return.
12
 term_secondsinteger

The number of seconds before the license expires.

Note:

The term and term_seconds returns are mutually exclusive.

The function returns this value in the packages hash.

  • A positive integer.
  • null — The package uses the term return.
120000
 trialBoolean

Whether the package is a trial license.

The function returns this value in the packages hash.

  • 1 — Is a trial.
  • 0 — Is not a trial.
0
 user_billing_rateinteger

The billing rate for each account over the user_billing_threshold.

The function returns this value in the packages hash.

A positive integer.0
 user_billing_thresholdinteger

The number of accounts included with the license. Additional accounts will be billed at the user_billing_rate.

The function returns this value in the packages hash.

  • A positive integer.
  • null — Unlimited accounts.
30
 validBoolean

Whether the package is valid.

The function returns this value in the packages hash.

  • 1 — Is valid.
  • 0 — Is not valid.
1