BillingFox API

You can use your BillingFox installation API to perform remote commands on your hosting billing software installation.

Choose a documentation section.

You can use your BillingFox API to remotely manage your website.

API could be included from the /API/clientapi.php file.

The API URL could be changed from the /API/clientapi.php file.

Get the current user count:
Copy to clipboard
// Create a simple API command: <?php $command = "getUserCount"; $NEED_STATUS = 0; echo BF_API::CMD_EXTERNAL($command, $NEED_STATUS); // If $NEED_STATUS is equal to 1, the command will return a SUCCESS / ERROR message, else it will return the API command response. ?>
Get the current user count:
Copy to clipboard
// Create a simple API command: <?php $command = "getWebVar"; $NEED_STATUS = 0; $data = array("var" => 'webname'); $data_new = json_encode($data); var_dump(BF_API::CMD_EXTERNAL($command, $NEED_STATUS, $data_new)); // This command will return the website name ?>
Other API calls:
Copy to clipboard
// Create a simple API command: <?php * Definitions: * $command: command performed on API call * $NEED_STATUS: if is set to '1', API call will respond with status of command ( ERROR / SUCCESS ), else will respond with message of command. * * VALID RETURN COMMANDS: * - createInstall [back website to the installation page; (usefull to protect your store on an admin attack)] * - getUserCount [outputs website user count] * - getWebVar [outputs website info (getWebVar($parameter))] * * * Example for getWebVar: * * $command = "getWebVar"; * $NEED_STATUS = 0; * * * $data = array("var" => 'webname'); * $data_new = json_encode($data); * var_dump(BF_API::CMD_EXTERNAL($command, $NEED_STATUS, $data_new)); * * * * * - getServices [outputs total services of this website (sold)] * - getDomains [outputs total domains of this website (sold)] * - getCoupons [outputs total coupons of this website] * * * OTHER VALID COMMANDS: * - getUserVar [get an array with an user info] * - modifyUserVar [modify a variable of an user] * - getDepositVar [get an array with a deposit info] * - getServiceVar [get an array with a service info] * - getProductVar [get an array with a product info] * - getDomainVar [get an array with a domain info] * - userExists [check if an user exists (return true/false)] * - checkLogin [check if credentials of an user are correct (return 1/0)] * * Example for getUserVar: * * $command = "getUserVar"; * $NEED_STATUS = 0; * * * $data = array("id" => 11); * $data_new = json_encode($data); * var_dump(BF_API::CMD_EXTERNAL($command, $NEED_STATUS, $data_new)); * * * * * Example for checkLogin: * * $command = "checkLogin"; * $NEED_STATUS = 0; * * * $data = array("email" => "default@billingfox.net", "password" => "mystrongpassword"); * $data_new = json_encode($data); * $returndata = BF_API::CMD_EXTERNAL($command, $NEED_STATUS, $data_new); * if($returndata == 1) * { * echo 'Credentials are correct.'; * } * else * { * echo 'Credentials are incorrect.'; * } * * * * // Examples for getDepositVar, getServiceVar, getProductVar, userExists, and getDomainVar have same syntax as getUserVar * * * Example for modifyUserVar: * * $command = "modifyUserVar"; * $NEED_STATUS = 0; * * $data = array("id" => 11, "var" => "email", "operation" => "set", "value" => "someone@newemail.com"); * $data_new = json_encode($data); * echo BF_API::CMD_EXTERNAL($command, $NEED_STATUS, $data_new); * * The array will run modifyUserVar function in remote website (check documentation) id, user_variable, operation (set/add/substract), value. ?>