Skip to content
Last updated

UpdateClientDomain

Updates a Client Domain

Request Parameters

ParameterTypeDescriptionRequired
actionstring"UpdateClientDomain"Required
domainidintThe ID of the client domain to update.Required
dnsmanagementboolWhether to enable or disable DNS management.Optional
emailforwardingboolWhether to enable or disable Email forwarding.Optional
idprotectionboolWhether to enable or disable ID protection.Optional
donotrenewboolWhether to prevent renewal.Optional
typestringThe type of domain order ('Register' or 'Transfer').Optional
regdatestringThe registration date of the domain. Format: Y-m-dOptional
nextduedatestringThe next due date of the domain. Format: Y-m-dOptional
expirydatestringThe expiration date of the domain. Format: Y-m-dOptional
domainstringThe domain name to be changed to.Optional
firstpaymentamountfloatThe first payment amount on the domain.Optional
recurringamountfloatThe recurring amount for automatic renewal invoices.Optional
registrarstringThe registrar to associate with the domain. Example: enom, resellerclub, customregistrarnameOptional
regperiodintThe registration period of the domain.Optional
paymentmethodstringThe payment method to associate in system format (for example, paypal).Optional
subscriptionidstringThe subscription ID to associate with the domain.Optional
statusstringThe status to change the domain to.Optional
notesstringThe admin notes for the domain.Optional
promoidintThe promotion ID to associate.Optional
autorecalcboolWhether to recalculate the recurring amount of the domain (this will ignore any passed $recurringamount).Optional
updatensboolWhether to update the nameservers at the registrar.Optional
ns1stringThe first nameserver to save.Optional
ns2stringThe second nameserver to save.Optional
ns3stringThe third nameserver to save.Optional
ns4stringThe fourth nameserver to save.Optional
ns5stringThe fifth nameserver to save.Optional

Response Parameters

ParameterTypeDescription
resultstringThe result of the operation: success or error
domainidintThe ID of the updated domain.

Example Request (CURL)

$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' => 'UpdateClientDomain',
            // See https://developers.whmcs.com/api/authentication
            'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',
            'password' => 'SECRET_OR_HASHED_PASSWORD',
            'domainid' => '1',
            'status' => 'Terminated',
            'responsetype' => 'json',
        )
    )
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);

Example Request (Local API)

$command = 'UpdateClientDomain';
$postData = array(
    'domainid' => '1',
    'status' => 'Terminated',
);
$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later

$results = localAPI($command, $postData, $adminUsername);
print_r($results);

Example Response JSON

{
    "result": "success",
    "domainid": "1"
}

Error Responses

Possible error condition responses include:

  • Domain ID Not Found
  • The Registrar is not active
  • ns1 and ns2 required
  • Registrar Error Message

Version History

VersionChangelog
1.0Initial Version