PHP code example of darthsoup / php-whmcs-api

1. Go to this page and download the library: Download darthsoup/php-whmcs-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

darthsoup / php-whmcs-api example snippets



ent = new \DarthSoup\WhmcsApi\Client();

// Auth Credentials with identifier and secret
$client->authenticate('your_identifier', 'your_secret', \DarthSoup\WhmcsApi\Client::AUTH_API_CREDENTIALS);

// Login Credentials with Username and Password (without md5)
$client->authenticate('your_username', 'your_password', \DarthSoup\WhmcsApi\Client::AUTH_LOGIN_CREDENTIALS);

// Set the URL to your whmcs instance
$client->url('http://<your_whmcs_instance_url>');

$client->accessKey('my_access_key');

$client->client()->getClients(['search' => 'firstname']);

$client->orders()->getOrders();

$parameters = ['foo' => 'bar'];
$client->custom()->yourCustomApiName($parameters);