如何在Codeigniter项目中集成WHMCS?

I hope everyone doing good. I have a question how can i integrate WHMCS in a Codeignitor project?

I have my front end i.e HTML and CSS and all routing on the Codeignitor framework. Now how do i integrate with WHMCS for automation. I have no clue where to start from or what to look for. All i know WHMCS script can be added from the control pannel but i don't think that will add it in my codeignitor project. So any help would be appreciated

Thanks

You will probably use the WHMCS API, for example to order a product or domain you will use the AddOrder api function like below:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.example.com/includes/api.php');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
    http_build_query(
        array(
            'action' => 'AddOrder',
            // See https://developers.whmcs.com/api/authentication
            'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',
            'password' => 'SECRET_OR_HASHED_PASSWORD',
            'clientid' => '1',
            'pid' => array(1,1),
            'domain' => array('domain1.com', 'domain2.com'),
            'billingcycle' => array('monthly','semi-annually'),
            'domaintype' => array('register', 'register'),
            'regperiod' => array(1, 2),
            'dnsmanagement' => array(0 => false, 1 => true),
            'nameserver1' => 'ns1.demo.com',
            'nameserver2' => 'ns2.demo.com',
            'paymentmethod' => 'mailin',
            'responsetype' => 'json',
        )
    )
);
$response = curl_exec($ch);
curl_close($ch);