Billing Settings

Virtualizor has an Inbuilt Billing Panel which is specific to sell Virtual Private Servers online thereby enhancing the User Experience considerably. Virtualizor Cloud Billing System supports Hourly Billing.

Use the Billing Settings API to set the billing parameters for your Virtual Machines. The API response will contain “done” as “1” on after the billing settings are saved successfully.

Billing panel is currently in Beta. The Billing Panel is free during the Beta stage and will be chargeable when it becomes stable. Please read the full guide on how to setup Virtualizor Inbuilt Billing .

HTTP Request

https://hostname:4085/index.php?act=billing

Parameters

NameMethodValueDescriptionRequired
actGETbillingThe action will return done as 1 if the settings have been successfully savedYes
inhouse_billingPOST1/0If set inhouse billing will be enabledNo
cp_urlPOSTtextThe URL of this Control panel which will be used in all user communicationYes
billing_dayPOSTIntThe day of month when a invoice will be generated. By default its the last day of the monthNo
billing_currencyPOSTtextThe currency to show the usersYes
billing_symbolPOSTtextThe currency symbol to show the usersYes
billing_warn_balPOSTIntThe If not empty, when the current usage exceeds the user’s balance percentage, a notification will be sent to the userNo
billing_minPOSTIntThe minimum amount a user can pay towards balanceYes
billing_maxPOSTIntThe maximum amount a user can pay towards balanceYes
enable_registrationPOST1/0If set Allows users allowed to register to create their Cloud AccountNo
default_uplidPOSTIntWhen a new user registers, the default plan which will be assigned to the userNo
user_pass_min_charPOSTIntThe minimum password length a user password should beNo
captcha_secretPOSTtextThis will enable recaptcha on cloud user registration, if blank captcha will be disabledNo
captcha_sitekeyPOSTtextThis will be your sitekey, For more details: https://www.google.com/recaptchaNo
support_emailPOSTtextThe Support Email to show users in all communicationsYes
billing_compPOSTtextThe name of the company who will be invoicing the usersYes
billing_addr1POSTtextThe billing address of your companyYes
billing_addr2POSTtextThe billing address of your companyNo
paypal_enablePOST1Enable paypal payment gatewayYes
paypal_accountPOSTtextThe paypal email accountYes
paypal_api_userPOSTtextThe paypal API usernameYes
paypal_api_passPOSTtextThe paypal API passwordYes
paypal_api_sigPOSTtextThe paypal API signatureYes
paypal_envPOSTtextThe paypal environment valid values are ‘production’ and ‘sandbox’Yes

Sample Code

<?php

    require_once('/usr/local/virtualizor/sdk/admin.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $post = array();
    $post['cp_url'] = 'http://127.0.0.1';
    $post['billing_currency'] = 'USD';
    $post['billing_symbol'] = '$';
    $post['billing_min'] = 30;
    $post['billing_max'] = 50;
    $post['support_email'] = 'samplemail@test.com';
    $post['billing_comp'] = 'xyxy';
    $post['billing_addr1'] = 'xyxy';
    $post['paypal_enable'] = 1;
    $post['paypal_account'] = 'sample@test.com';
    $post['paypal_api_user'] = '1723817238713'; 
    $post['paypal_api_pass'] = '827349274';
    $post['paypal_api_sig'] = '1313213213';  
    $post['paypal_env'] = 'production';

    $output = $admin->billingsettings($post);

    print_r(json_encode($output));
?>

Output

{
    "title": "Billing Settings",
    "done": 1,
    "info": {
        "path": "/usr/local/virtualizor",
        "slave": 0,
        "masterkey": "",
        "masterip": "",
        "key": "lf6klmphhpyrxqacmuebs2ioxlzrc37g",
        "pass": "ti3thxss38v8jj6cybhwdc1xvghyetob",
        "kernel": "kvm",
        "lv": "",
        "thin_lv": "",
        "disk_path": "",
        "dbhost": "localhost",
        "db": "virtualizor",
        "dbuser": "root",
        "dbpass": "25etajy45w",
        "sn": "API Virt",
        "cookie_name": "SIMCookies3042",
        "gzip": 0,
        "cpu_nm": 0,
        "overcommit": 0,
        "language": "english",
        "soft_email": "samplemail@virtualizor.com",
        "theme_folder": "default",
        "timezone": "0",
        "update": 0,
        "email_update": 0,
        "email_update_client": 0,
        "cron_time": "18 16 * * 3",
        "emps_cron_time": "18 16 * * 3",
        "logo_url": "",
        "logo_login_url": "",
        "mail": 0,
        "mail_server": "mail_server",
        "mail_port": 25,
        "mail_user": "test@test.com",
        "mail_pass": "test",
        "mail_smtp_secure": 0,
        "mail_debug": 0,
        "mail_connect_timeout": 0,
        "off": 0,
        "off_subject": "",
        "off_message": "",
        "admin_logs": 2,
        "vps_logs": 2,
        "login_logs": 2,
        "system_logs": 2,
        "status_logs": 7,
        "bandwidth_logs": 0,
        "sess_len": 30000,
        "copyright": "",
        "interface": "",
        "xen_pvbridge": "",
        "xen_hvmbridge": "",
        "xen_dom0mem": 0,
        "use_xl": "",
        "ipadd": "",
        "netmask": "",
        "gateway": "",
        "ip6add": "",
        "gateway6": "",
        "int_bridge": "",
        "int_ipadd": "",
        "int_netmask": "",
        "login_attempts": 5,
        "login_ban_time": 15,
        "alert_load_limit": 0,
        "alert_disk_limit": 0,
        "vswap": 0,
        "noc_apikey": "",
        "noc_apipass": "",
        "disable_webuzo": 0,
        "disabled_scripts": "",
        "disable_icons_monitor": 0,
        "disable_icons_cp": 0,
        "disable_email": 0,
        "node_bandwidth": 0,
        "vps_bandwidth_threshold": 0,
        "change_ssh_port": 0,
        "max_ssh_login": 0,
        "vnc_ip": "192.168.1.240",
        "ping_ip": "",
        "distro": "",
        "dhcp_interface": "",
        "support": "",
        "addvs_io_class": "",
        "addvs_io_prio": "",
        "addvs_cpu_prio": "",
        "vpslimit": "",
        "ploop": 0,
        "enable_tuntap_cp": 0,
        "enable_ppp_cp": 0,
        "enable_fuse_cp": 0,
        "enable_ipip_cp": 0,
        "enable_ipgre_cp": 0,
        "enable_nfs_cp": 0,
        "enable_quotaugidlimit_cp": 0,
        "enable_iolimit_cp": 0,
        "enable_iopslimit_cp": 0,
        "enable_enduser_vnc": 0,
        "show_server": 0,
        "band_suspend": 0,
        "speed_cap_disable": 0,
        "is_master_only": 0,
        "xcp_lv_prefix": "",
        "novnc": 1,
        "novnc_master_only": 0,
        "novnc_server_name": 0,
        "queue_creation": 0,
        "disable_dd_flags": 0,
        "dbbackup_email": "samplemail@virtualizor.com",
        "dbbackup_cron": "1 * * * *",
        "dbbackup_type": "EMAIL",
        "dbbackup_server": 0,
        "dbbackup_server_dir": "",
        "is_cloud": "",
        "bridge": "viifbr0",
        "pv_on_hvm": 0,
        "band_calc_creation": 0,
        "no_ebtables_on_plans": "",
        "master_name": "",
        "inodes_gb": "",
        "openvz_suspend_load": 0,
        "disable_login_logo": 0,
        "enable_rdns": 0,
        "disable_backup_cp": 0,
        "auto_add_zone": 0,
        "enable_console": 0,
        "curl_timeout": "",
        "del_novps_user": 0,
        "del_slave_ostemplate": 0,
        "disable_master_vpsname": 0,
        "showsearch": 0,
        "site_domain": "",
        "use_new_theme": "",
        "turnoff_virtdf": 1,
        "disable_newtheme": 0,
        "disable_recipes": 0,
        "enable_virtio": 0,
        "disable_suspend_email": 0,
        "enable_idsort": 0,
        "del_tasks": 0,
        "disable_apicredential": 0,
        "disable_rescue": 0,
        "disable_change_hostname": 0,
        "disable_change_password": 0,
        "disable_vps_config": 0,
        "disable_os_reinstall": 0,
        "disable_ssh": 0,
        "disable_java_vnc": 0,
        "disable_self_shutdown": 0,
        "disable_server_location": 0,
        "disable_enduser_sshkeys": 0,
        "disable_vga": 0,
        "enable_nic": 0,
        "cb_hash": "oidzotex0av7rueyzonhnbn7nokndmgd",
        "enable_cb": 0,
        "cb_use_https": 0,
        "cb_url": "",
        "cb_suspend": 0,
        "cb_unsuspend": 0,
        "cb_hostname": 0,
        "cb_terminate": 0,
        "cb_changeips": 0,
        "default_sg_name": "",
        "default_sg_reseller_name": "",
        "default_sg_desc": "",
        "custom_mac": "",
        "cloud_allow_virtio": 0,
        "le_primary_domain": "hostname",
        "le_contact_email": "test@test.com",
        "le_key_size": "2048",
        "le_renew_days": 80,
        "le_staging": 0,
        "le_enable_force": 1,
        "2fa_email_otp": 0,
        "enable_2fa": 0,
        "eu_allow_virtio": 0,
        "keep_orphan_template": 0,
        "pass_strength": 0,
        "haproxy_enable": 0,
        "haproxy_src_ips": "192.168.1.240",
        "haproxy_reservedports": "",
        "haproxy_reservedports_http": "80,443",
        "haproxy_allowedports": "",
        "haproxy_cron_logs": 0,
        "backup_queue": 0,
        "restore_queue": 0,
        "server_latitude": 0,
        "server_longitude": 0,
        "disable_nw_config": 0,
        "enable_eu_iso": 1,
        "eu_iso_size": 5120,
        "eu_iso_limit": 3,
        "eu_iso_space": 5120,
        "eu_iso_del_hr": 0,
        "secure_allowed_ips": "",
        "backup_email": "",
        "backup_disable_success_mail": 0,
        "disable_virttop": 0,
        "set_def_hvm": 0,
        "memory_limit": 0,
        "proxmox_server_pass": "",
        "proxmox_server_name": "",
        "proxmox_server_pass_salt": "",
        "max_ips": 250,
        "cp_url": "http://127.0.0.1",
        "inhouse_billing": 0,
        "enable_registration": 0,
        "user_pass_min_char": 0,
        "support_email": "samplemail@virtualixpr.com",
        "default_uplid": 0,
        "billing_warn_bal": 0,
        "billing_currency": "USD",
        "billing_symbol": "$",
        "billing_min": 30,
        "billing_max": 50,
        "billing_day": 0,
        "billing_comp": "xyxy",
        "billing_addr1": "xyxy",
        "billing_addr2": "",
        "paypal_account": "sample@test.com",
        "paypal_api_user": "1723817238713",
        "paypal_api_pass": "827349274",
        "paypal_api_sig": "1313213213",
        "paypal_env": "production",
        "captcha_secret": "",
        "captcha_sitekey": "",
        "resource_pricing": "null",
        "recipe_shell": "#!/bin/sh",
        "paypal_enable": 1
    },
    "timenow": 1537212278,
    "time_taken": "0.348"
}
Was this helpful to you?