Skip to content
Last updated

UpdateClientAddon

Updates a Client Addon

Request Parameters

ParameterTypeDescriptionRequired
actionstring"UpdateClientAddon"Required
idintThe ID of the client addon to update.Required
statusstringThe status to change the addon to.Optional
addonidintThe configured addon ID to update the client addon to.Optional
namestringThe custom name to apply to the addon.Optional
setupfeefloatThe setup fee for the client addon.Optional
recurringfloatThe recurring amount for the client addon.Optional
billingcyclestringThe billing cycle for the addon.Optional
nextduedatestringThe next due date for the addon. Format: Y-m-dOptional
terminationdatestringThe termination date of the addon. Format: Y-m-dOptional
notesstringThe admin notes to associate with the addon.Optional
autorecalcboolWhether to automatically recalculate the recurring amount of the addon (this will ignore any passed $recurring).Optional

Response Parameters

ParameterTypeDescription
resultstringThe result of the operation: success or error
idintThe ID of the updated addon.

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

Example Request (Local API)

$command = 'UpdateClientAddon';
$postData = array(
    'id' => '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",
    "id": "1"
}

Error Responses

Possible error condition responses include:

  • Addon ID Not Found
  • Nothing to Update

Version History

VersionChangelog
1.0Initial Version