07-26-2023, 11:18 PM
I have 2 problem with [WHMCS LocalAPI][1].
### (1) I have a problem when I add order to client via LocalAPI.
I use a webservice where I must send my request to a web service and if returned `true` then I must add a order to client, but when I use addorder API the WHMCS apply credit automatically and it is not suitable for me. I want to add order and DO NOT paid invoice through credit.
### (2)
I have a additional domain field in `domainadditionalfields` in whmcs database that fieldname as figure, but I do not know what syntax is true I use this code but value field is `empty`:
![enter image description here][2]
$command = 'AddOrder';
$postData = array(
'clientid' => 701,
'domain' => array($domain),
'domaintype' => array('register'),
'regperiod' => array($period),
'nameserver1' => $ns1,
'nameserver2' => $ns2,
'additionalfields["irnichandle"]' => "ABC",
'paymentmethod' => 'mailin',
'applycredit' => false,
);
$adminUsername = 'adminuser'; // Optional for WHMCS 7.2 and later
$results = localAPI($command, $postData, $adminUsername);
$orderid = $result['orderid'];
$invoiceid = $result['invoiceid'];
print_r($results);
[1]:
### (1) I have a problem when I add order to client via LocalAPI.
I use a webservice where I must send my request to a web service and if returned `true` then I must add a order to client, but when I use addorder API the WHMCS apply credit automatically and it is not suitable for me. I want to add order and DO NOT paid invoice through credit.
### (2)
I have a additional domain field in `domainadditionalfields` in whmcs database that fieldname as figure, but I do not know what syntax is true I use this code but value field is `empty`:
![enter image description here][2]
$command = 'AddOrder';
$postData = array(
'clientid' => 701,
'domain' => array($domain),
'domaintype' => array('register'),
'regperiod' => array($period),
'nameserver1' => $ns1,
'nameserver2' => $ns2,
'additionalfields["irnichandle"]' => "ABC",
'paymentmethod' => 'mailin',
'applycredit' => false,
);
$adminUsername = 'adminuser'; // Optional for WHMCS 7.2 and later
$results = localAPI($command, $postData, $adminUsername);
$orderid = $result['orderid'];
$invoiceid = $result['invoiceid'];
print_r($results);
[1]:
[To see links please register here]
[2]: