Child pages
  • Manage2 API Functions - License Invoice Data
Skip to end of metadata
Go to start of metadata

Description

This function returns the raw data of a license's billing data.

Examples


 Browser-based Calls
XML
https://manage2.cpanel.net/XMLinvoice.cgi?date=2019-11&output=xml
JSON
https://manage2.cpanel.net/XMLinvoice.cgi?id=1494276&output=json
YAML
https://manage2.cpanel.net/XMLinvoice.cgi?date=2019-11&output=yaml
 cPanel Licensing PHP Class

Note:

You cannot call this function with cPanel Licensing.

 cPanel Licensing Perl Module

Note:

You cannot call this function with cPanel Licensing.

 Output (JSON)
{
  "status": 1,
  "reason": "OK",
  "results": {
    "company_id": "2221",
    "date": 1568423996,
    "company_name": "Example Private",
    "subtotal": 1665.5,
    "discount": 0.75,
    "licenses": [
      {
        "ip": "192.0.2.102",
        "subtotal": "11.00",
        "package_id": "11997",
        "discount": "0.00",
        "taxed": 0,
        "total": "11.00",
        "host": "epws.example.net",
        "package": "INTERNAL-VPS",
        "bulk_charge": 0,
        "id": "22307167",
        "product": "cPanel\/WHM",
        "accounts": 1,
        "auto_scaled": null
      },
      {
        "ip": "192.0.2.102",
        "subtotal": "32.00",
        "package_id": "11993",
        "discount": "0.00",
        "taxed": 0,
        "total": "32.00",
        "host": "krazyfunfilms.example.net",
        "package": "INTERNAL",
        "bulk_charge": 0,
        "id": "31422437",
        "product": "cPanel\/WHM",
        "accounts": 5,
        "auto_scaled": null
      },
      {
        "ip": "192.0.2.102",
        "subtotal": "32.00",
        "package_id": "11993",
        "discount": "0.00",
        "taxed": 0,
        "total": "32.00",
        "host": "netleon-new-us.example.net",
        "package": "INTERNAL",
        "bulk_charge": 0,
        "id": "46860987",
        "product": "cPanel\/WHM",
        "accounts": 62,
        "auto_scaled": null
      },
      {
        "ip": "192.0.2.102",
        "subtotal": "11.00",
        "package_id": "11997",
        "discount": "0.00",
        "taxed": 0,
        "total": "11.00",
        "host": "linuxindia2.example.com",
        "package": "INTERNAL-VPS",
        "bulk_charge": 0,
        "id": "22306655",
        "product": "cPanel\/WHM",
        "accounts": 98,
        "auto_scaled": null
      }
    ],
    "sales_tax": null,
    "total": 1664.75,
    "previous_date": 1568410735,
    "due_date": 1569719996,
    "bulk_charge": 0,
    "id": "1494276",
    "snapshot": 1
  }
}
 Output (XML)
<?xml version="1.0"?>
<XMLinvoice reason="OK" status="1">
    <results id="1510641" bulk_charge="0" company_id="3541" company_name="EXAMPLE PRIVATE" date="1573861224" discount="0" due_date="1575157224" previous_date="1571181736" sales_tax="" snapshot="1" subtotal="231.3" total="231.3">
        <licenses id="51867429" accounts="245" auto_scaled="" bulk_charge="0" discount="0.0000" host="maxacloud1.example.com" ip="192.0.2.102" package="cPanel Premier Cloud" package_id="21167" product="cPanel/WHM" subtotal="46.5000" taxed="0" total="46.5000"/>
        <licenses id="51867421" accounts="698" auto_scaled="" bulk_charge="0" discount="0.0000" host="maxacluster1.example.com" ip="192.0.2.102" package="cPanel Premier Metal" package_id="21171" product="cPanel/WHM" subtotal="91.8000" taxed="0" total="91.8000"/>
        <licenses id="51867437" accounts="160" auto_scaled="" bulk_charge="0" discount="0.0000" host="maxacluster3.example.com" ip="192.0.2.102" package="cPanel Premier Cloud" package_id="21167" product="cPanel/WHM" subtotal="38.0000" taxed="0" total="38.0000"/>
        <licenses id="51867425" accounts="34" auto_scaled="" bulk_charge="0" discount="0.0000" host="maxacluster4.example.com" ip="192.0.2.102" package="cPanel Plus Cloud" package_id="22081" product="cPanel/WHM" subtotal="25.0000" taxed="0" total="25.0000"/>
        <licenses id="51867433" accounts="22" auto_scaled="" bulk_charge="0" discount="0.0000" host="mailcloud1.example.com" ip="192.0.2.102" package="cPanel Pro Cloud" package_id="21163" product="cPanel/WHM" subtotal="17.5000" taxed="0" total="17.5000"/>
        <licenses id="51867441" accounts="3" auto_scaled="" bulk_charge="0" discount="0.0000" host="instance-2.example.internal" ip="192.0.2.102" package="cPanel Admin Cloud" package_id="21159" product="cPanel/WHM" subtotal="12.5000" taxed="0" total="12.5000"/>
    </results>
</XMLinvoice>
 Output (YAML)
--- 
reason: OK
results: 
  bulk_charge: 0
  company_id: 3544
  company_name: EXAMPLE PRIVATE 
  date: '1573861244'
  discount: '0'
  due_date: '1575157244'
  id: 1510641
  licenses: 
    - 
      accounts: 245
      auto_scaled: ~
      bulk_charge: 0
      discount: '0.0000'
      host: maxacloud1.example.com
      id: 51867429
      ip: 192.0.2.102
      package: cPanel Premier Cloud
      package_id: 21167
      product: cPanel/WHM
      subtotal: '46.5000'
      taxed: 0
      total: '46.5000'
    - 
      accounts: 698
      auto_scaled: ~
      bulk_charge: 0
      discount: '0.0000'
      host: maxacluster1.example.com
      id: 51867421
      ip: 192.0.2.102
      package: cPanel Premier Metal
      package_id: 21171
      product: cPanel/WHM
      subtotal: '91.8000'
      taxed: 0
      total: '91.8000'
    - 
      accounts: 160
      auto_scaled: ~
      bulk_charge: 0
      discount: '0.0000'
      host: maxacluster3.example.com
      id: 51867437
      ip: 192.0.2.102
      package: cPanel Premier Cloud
      package_id: 21167
      product: cPanel/WHM
      subtotal: '38.0000'
      taxed: 0
      total: '38.0000'
    - 
      accounts: 34
      auto_scaled: ~
      bulk_charge: 0
      discount: '0.0000'
      host: maxacluster4.example.com
      id: 51867425
      ip: 192.0.2.102
      package: cPanel Plus Cloud
      package_id: 22081
      product: cPanel/WHM
      subtotal: '25.0000'
      taxed: 0
      total: '25.0000'
    - 
      accounts: 22
      auto_scaled: ~
      bulk_charge: 0
      discount: '0.0000'
      host: mailcloud1.example.com
      id: 51867433
      ip: 192.0.2.102
      package: cPanel Pro Cloud
      package_id: 21163
      product: cPanel/WHM
      subtotal: '17.5000'
      taxed: 0
      total: '17.5000'
    - 
      accounts: 3
      auto_scaled: ~
      bulk_charge: 0
      discount: '0.0000'
      host: instance-2.example.internal
      id: 51867441
      ip: 192.0.2.102
      package: cPanel Admin Cloud
      package_id: 21159
      product: cPanel/WHM
      subtotal: '12.5000'
      taxed: 0
      total: '12.5000'
  previous_date: '1571181736'
  sales_tax: ~
  snapshot: 1
  subtotal: '231.3'
  total: '231.3'
status: 11

Parameters

ParameterTypeDescriptionPossible valuesExample
idinteger

Required.

The license ID for which to return the invoice data.

Note:

You can specify either the id or date parameters, but not both.

A valid license ID.

12345
datestring

Required.

The billing date for which to return the invoice data.

Note:

You can specify either the id or date parameters, but not both.

A valid date in the format YYYY-MM.

2019-09


Returns

ReturnTypeDescriptionPossible valuesExample
company_idintegerThe company ID of the invoiced licenses.A valid company ID.2221
dateintegerThe date of the invoice.A timestamp, in Unix time format. 1568423996
company_namestringThe license's company name.A string value.Example Internet
subtotalnumericThe cost invoiced before any applicable discounts.A numeric value.1665.5
discountnumericThe discount applied to the invoice.A numeric value.0.75
licensesarrayAn array that contains an unnamed hash of license information.One or more unnamed hashes.
unnamed hashhashA hash that contains license information.

This hash contains the following returns:

  • accounts
  • auto_scaled
  • bulk_charge
  • discount
  • host
  • id
  • ip
  • package
  • package_id
  • product
  • subtotal
  • taxed
  • total

        accountsinteger

The number of active accounts.

The function returns this value in the unnamed hash.

A numeric value.30

auto_scaled

Boolean

Whether the license is set to an auto-scaled package type.

The function returns this value in the unnamed hash.

  • 0 — Not in an auto-scaled package.
  • 1 — In an auto-scaled package.
4

bulk_charge

numeric

The amount of the bulk charge for the license.

The function returns this value in the unnamed hash.

A numeric value.0.00

discount

numeric

The discount applied to the invoice.

The function returns this value in the unnamed hash.

A numeric value.0.00

host

string

The license's server's hostname.

The function returns this value in the unnamed hash.

A valid domain name.example.com

id

integer

A license's ID.

The function returns this value in the unnamed hash.

A positive integer.


46860987

ip

string

The license's server's IP address.

The function returns this value in the unnamed hash.

A valid IP address.192.168.0.20

package

string

The name of the package on the invoice.

The function returns this value in the unnamed hash.

A valid string.Example-VPS

packageid 

integer

The license's package ID.

The function returns this value in the unnamed hash.

A valid package ID.761

producttype

integer

The product type ID.

The function returns this value in the unnamed 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

subtotal

integer

The cost invoiced before any applicable discounts.

The function returns this value in the unnamed hash.

A numeric value.100

taxed

Boolean

Whether the license includes tax.

The function returns this value in the unnamed hash.

  • 0 — No tax applied.
  • 1 — Taxes applied.
0

total

integer

The final cost of the license after all taxes and discounts.

The function returns this value in the unnamed hash.

A numeric value.

11.00