buycpanel-resources-banner

Resources

If you can’t find the answer you are looking for please submit a ticket.
We are here to help 24/7/365!

BuycPanel API Documentation
Posted by Logan F on 31 March 2016 02:17 PM

BuycPanel.com API V2.0

The BuycPanel API allows BuycPanel customers to access common ordering functions through an automated API. Some example functions using the API are to order new licenses and addons, change the IP address of existing licenses, cancel licenses, or export a report of current IP usage and corresponding license types and status. Commonly, customers integrate their API into web hosting billing software such as WHMCS or custom ordering systems.

The API includes both a LIVE and TEST environment. The live and test environments are accessed using the same URLs below but include a switch for TEST 1 or 0. You must be a current customer to access the API, and have received an API KEY to access the API system by emailing support@buycpanel.com. The API is organized using industry best practices and should not require more than 2 hours of your web programmer’s time to integrate into most existing systems.

Here are the list of available functions and how to integrate each function. If you have any questions feel free to email us at support@buycpanel.com

The following [values] are available for all functions:

  • attracta
  • blesta
  • clientexec
  • cloudlinux
  • cpanel
  • fantastico
  • installatron
  • kernelcare
  • litespeed
  • litespeed_2_cpu
  • litespeed_4_cpu
  • litespeed_8_cpu
  • litespeedultra
  • litespeedvps
  • resourcemonitor
  • rvsitebuilder
  • rvsitebuildervps
  • rvskin
  • servermonitoring
  • softaculous
  • softaculousvps
  • solusvm
  • solusvmminislave
  • solusvmslave
  • solusvmslaveonlymaster
  • solusvmunslave
  • spamscan
  • trendyhtml5
  • whmsonic
  • whmxtra

Output

The responses returned by the API functions are JSON formatted arrays

success: 1 / 0
faultstring: error message
result: result message

Suspend

Parameters

  • suspend – if omitted equals “cpanel”
  • suspendreason – if omitted then defaults by WHMCS to “Overdue on Payment”

Example Input

https://www.buycpanel.com/api/suspend.php?login=andrey@nexsound.org&key=898f8eed2e988253fdf8c51278c907a3&currentip=1.1.1.45

Example Output

{
	"success":1,"result":"Your Resource Monitor, SpamScan, cPanel license(s) for 1.1.1.44 has been successfully suspended."
}

{
	"success":0,"faultstring":"Your license suspension for IP 1.1.1.44 was UNSUCCESSFUL.\nThis product is already suspended on your account."
}

Unsuspend

Parameters

  • package_id – packageID needs to be suspended if omitted using “unsuspend” variable
  • unsuspend – if omitted equals “cpanel”; performance speed is slower than if package_id is provided

Example Input

https://www.buycpanel.com/api/unsuspend.php?login=andrey@nexsound.org&key=898f8eed2e988253fdf8c51278c907a3&currentip=1.1.1.44

Example Output

{
	"success":1,"result":"Your cpanel license for 1.1.1.44 has been successfully unsuspended."
}

{
	"success":0,"faultstring":"Suspended package ID for cpanel type of product was not found."
}

Change IP

GET/POST Access URL: https://www.buycpanel.com/api/changeip.php

Parameters

  • login – Repeat customer email address at Buycpanel.com
  • key – please contact buycpanel support to obtain your access key
  • currentip – your current cPanel or addon license IP
  • newip – a new IP, you want your cPanel or addon license to be transferred to
  • change [value] – (optional) the type of change

Supported Addons

[1 / 0] Set as 1 to change addon IP

  • Attracta
  • Blesta
  • Clientexec
  • Cloudlinux
  • Cpaneladmin
  • Fantastico
  • Installatron
  • Kernelcare
  • Litespeed
  • Litespeedultra
  • Resourcemonitor
  • Rvsitebuilder
  • Rvsitebuildervps
  • Rvskin
  • Servermonitoring
  • Softaculous
  • Softaculousvps
  • Solusvm
  • Spamscan
  • Trendyflash
  • Whmsonic
  • Whmxtra

NOTE: if you want transfer several addons to a new IP address without transferring cPanel license, provide “addons” in change variable

Example Input

https://www.buycpanel.com/api/changeip.php?currentip=0.0.0.0&newip=0.0.0.1&login=test@test.com&key=898f8eed2e8253fdf8c51278c907a3

Example Output

{
"success":1,
"result":"Your IP change has been completed, 0.0.0.0 has successfully been changed to 0.0.0.1"
}

Cancel IP

GET/POST Access URL: https://www.buycpanel.com/api/cancel.php

Parameters

  • login – repeat customer email address at Buycpanel.com
  • key – please contact buycpanel support to obtain your access key
  • currentip – your current cPanel license IP
  • cancel [value] – (optional) the type of cancel

Supported Addons

[1 / 0] Set as 1 to cancel addon IP

  • Attracta
  • Blesta
  • Clientexec
  • Cloudlinux
  • Cpaneladmin
  • Fantastico
  • Installatron
  • Kernelcare
  • Litespeed
  • Litespeedultra
  • Resourcemonitor
  • Rvsitebuilder
  • Rvsitebuildervps
  • Rvskin
  • Servermonitoring
  • Softaculous
  • Softaculousvps
  • Solusvm
  • Spamscan
  • Trendyflash
  • Whmsonic
  • Whmxtra

Example Input

https://www.buycpanel.com/api/cancel.php?currentip=0.0.0.0&login=test@test.com&key=898f8eed8253fdf8c51278c907a3

https://www.buycpanel.com/api/cancel.php?currentip=0.0.0.0&login=test@test.com&key=898f8eed8253fdf8c51278c907a3&cancel=fantastico

Example Output

{
	"success":1,
	"result":"Your cPanel license for 217.12.193.81 has been successfully canceled."
}

Export License Information

GET/POST Access URL: https://www.buycpanel.com/api/export.php

Note that any optional variables can be combined for further filtering of your results. For instance, the expiresbefore and expiresafter variables can be used together to return a set of licenses with a next renewal date inbetween a specific range. If you have many licenses on your account, providing these optional filtering variables can increase the speed of the API’s response.

Parameters

  • login – repeat customer email address at Buycpanel.com
  • key – please contact buycpanel support to obtain your access key
  • verbose – (optional) set to 1 to return additional license information such as the license price
  • expiresafter [YYYY-MM-DD] – (optional) filter results to licenses set to expire after the specified date
  • expiresbefore [YYYY-MM-DD] – (optional) filter results to licenses set to expire before the specified date
  • ip – (optional) filter results to all licenses matching a specific IP
  • status – (optional) filter results to all licenses matching a specific status
    • Active
    • Pending
    • Canceled
    • Suspended
    • Terminated
  • shortcode [value] – (optional) filter results to all licenses matching the product shortcode

Example Input

Default: https://www.buycpanel.com/api/export.php?login=test@test.com&key=898f8eed2e953fdf8c51278c907a3

Verbose: https://www.buycpanel.com/api/export.php?login=test@test.com&key=898f8eed2e953fdf8c51278c907a311&verbose=1&shortcode=blesta&ip=192.168.1.101

All filtering: https://www.buycpanel.com/api/export.php?login=test@test.com&key=898f8eed2e953fdf8c51278c907a311& shortcode=cpanel&ip=192.168.1.122&expiresafter=2015-05-30&expiresbefore=2015-06-02&status=Active

Respective Example Output

{
	"success":1,
	"result":
	[{
		"ip":"192.168.1.122",
		"package":"cPanel/WHM Monthly License 192.168.1.122",
		"shortcode":"cpanel",
		"license_key":"null",
		"status":"active",
		"next_renewal":"2015-06-01"
	},
	{
		"ip":"192.168.1.101",
		"package":"Blesta Unbranded Monthly License 192.168.1.101",
		"shortcode":"blesta",
		"license_key":"monthly-k235h23f83hr839",
		"status":"active",
		"next_renewal":"2015-05-01"
	}]
}

{
	"success":1,
	"result":
	[{
		"ip":"192.168.1.101",
		"package":"Blesta Unbranded Monthly License 192.168.1.101",
		"shortcode":"blesta",
		"license_key":"monthly-k235h23f83hr839",
		"status":"active",
		"next_renewal":"2015-05-01",
		"price":"9.50",
	}}
}

{
	"success":1,
	"result":
	[{
		"ip":"192.168.1.122",
		"package":"cPanel/WHM Monthly License 192.168.1.122",
		"shortcode":"cpanel",
		"license_key":"null",
		"status":"active",
		"next_renewal":"2015-06-01"
	}
}

Order New IP

GET/POST Access URL: https://www.buycpanel.com/api/order.php

Parameters

  • login – repeat customer email address at Buycpanel.com
  • key – please contact buycpanel support to obtain your access key
  • serverip – your IP that you want to license
  • domain – (optional) your domain name
  • ordertype – numeric, order type ID
    • 0 – cPanel / WHM Plus!
    • 10 – NEW! cPanel VPS Optimized
    • 20 – cPanel VPS Optimized Yearly
    • 3 – One Year License
    • 4 – Two Year License
    • 5 – Three Year License
    • 25 – Addon Order

Supported Addons

  • [1 / 0] Set as 1 to add to order
  • Quantity [1-30]
  • [1 / 0] Set as 1 to run as a test
  • Litespeed dedicated license CPU quantity [1/2/4/8]
  • Attracta
  • Blesta
  • Clientexec
  • Cloudlinux
  • Cpaneladmin
  • Fantastico
  • Installatron
  • Installatronvps
  • Kernelcare
  • Licensequantity
  • Litespeed
  • Litespeedultra
  • Litespeedvps
  • Litespeed_cpu
  • Resourcemonitor
  • Rvsitebuilder
  • Rvsitebuildervps
  • Rvskin
  • Servermonitoring
  • Softaculous
  • Softaculousvps
  • Solusvm
  • Solusvminislave
  • Solusvmnovirtual
  • Solusvmslave
  • Solusvmunslave
  • Spamscan
  • Test
  • Trendyflash
  • Trendyflashdedicated
  • Trendyflashvps
  • Whmsonic
  • Whmxtra

cPanelAdmin Parameters

  • Input string
  • [1 / 0] Set as 1 to add monitoring service
  • Integer value [default value]
  • root_login
  • root_password
  • ssh_login
  • ssh_password
  • ssh_port
  • ping
  • pop3
  • pop3_port [110]

cPanelAdmin & ServerMonitoring Parameters

  • [1 / 0] Set as 1 to add monitoring service
  • Integer value [default value]
  • ftp
  • ftp_port [21]
  • http
  • http_port [80]
  • https
  • https_port [443]
  • smtp
  • smtp_port [25]

Note: If you want to purchase several licenses at once use serverip2, serverip3, serverip4, etc. variables for different ips, and also licensequantity variable to set the number of licenses. this also applies to add-ons, use fantastico2, fantastico3, fantastico4, and/or rvskin2, rvskin3, rvskin4 etc to add corresponding add-ons.

Example Input

Order cpanel vps license for 0.0.0.0
https://www.buycpanel.com/api/order.php?login=test@test.com&key=16654d3a6956159dca526caa74e37f37&test=1&domain=test.com&serverip=0.0.0.0&ordertype=10
Order full cpanel license for 0.0.0.0
https://www.buycpanel.com/api/order.php?login=test@test.com&key=16654d3a6956159dca526caa74e37f37&test=1&domain=test.com&serverip=0.0.0.0&ordertype=0
Order fantastico, rvskin and rvsitebuilder addons for existing full cpanel license for 0.0.0.0
https://www.buycpanel.com/api/order.php?login=test@test.com&key=16654d3a6956159dca526caa74e37f37&test=1&domain=test.com&serverip=0.0.0.0&ordertype=25&fantastico=1&rvskin=1&rvsitebuilder=1
Order whmsonic and rvsitebuilder vps addons for existing vps cpanel license for 0.0.0.0
https://www.buycpanel.com/api/order.php?login=test@test.com&key=16654d3a6956159dca526caa74e37f37&test=1&domain=test.com&serverip=0.0.0.0&ordertype=25&whmsonic=1&rvsitebuildervps=1

Example Output

{
	"success":1,
	"result":"thank you! your license is instantly activated!"
}

{
	"success":0,
	"faultstring":"you must provide correct server ip"
}