{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Everything Else","description":"Developer documentation for the WHMCS API — the","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"everything-else","__idx":0},"children":["Everything Else"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following hooks are provided for Everything Else related events."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"affiliateactivation","__idx":1},"children":["AffiliateActivation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes as an affiliate is being activated."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters","__idx":2},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["affid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The new unique id for the affiliate (tblaffiliates)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["userid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response","__idx":3},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code","__idx":4},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('AffiliateActivation', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"affiliateclickthru","__idx":5},"children":["AffiliateClickthru"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when a user has clicked an affiliate referral link."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-1","__idx":6},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["affiliateId"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The unique id of the affiliate that the link belongs to"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-1","__idx":7},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-1","__idx":8},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('AffiliateClickthru', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"affiliatecommission","__idx":9},"children":["AffiliateCommission"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes as affiliate commission is being applied to an affiliate to clear later."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-2","__idx":10},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["affiliateId"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["referralId"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The id of the referral"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["serviceId"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The id of the referred service"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["commissionAmount"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The amount of commission to be appplied"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["commissionDelayed"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["bool"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Will the commission be delayed"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["clearingDate"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["null"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["payout"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["bool"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Will this commission be applied to the affiliate commissions"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["message"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The reason commission will not be applied if ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payout"]}," is false"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-2","__idx":11},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Return boolean values to override 'skipCommission' or 'payout'."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-2","__idx":12},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n\n//Skip applying the commission for affiliate 2\nadd_hook('AffiliateCommission', 1, function($vars) {\n    $return = [];\n\n    if ($vars['affiliateId'] == 2) {\n        $return['skipCommission'] = true;\n    }\n    return $return;\n});\n\n\n//Ensure commission is applied for affiliate 3\nadd_hook('AffiliateCommission', 1, function($vars) {\n    $return = [];\n\n    if ($vars['affiliateId'] == 3) {\n        $return['payout'] = true;\n    }\n    return $return;\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"affiliatewithdrawalrequest","__idx":13},"children":["AffiliateWithdrawalRequest"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when an affiliate withdrawal request is submitted."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-3","__idx":14},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["affiliateId"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The unique id of the affiliate making the request"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["userId"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The user id of the user making the request"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["clientId"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The client id being acted on"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["balance"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The amount of commission the withdrawal request is for"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-3","__idx":15},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the return to skip creating a ticket. Return a boolean value of skipTicket."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-3","__idx":16},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n\n//Do not open a ticket for affiliate 2\nadd_hook('AffiliateWithdrawalRequest', 1, function($vars) {\n    $return = [];\n    if ($vars['affiliateId'] == 2) {\n        $return['skipTicket'] = true;\n    }\n\n    return $return;\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"afterconfigoptionsupgrade","__idx":17},"children":["AfterConfigOptionsUpgrade"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes after a product configurable options upgrade has been processed"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-4","__idx":18},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["upgradeid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-4","__idx":19},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-4","__idx":20},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('AfterConfigOptionsUpgrade', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ccupdate","__idx":21},"children":["CCUpdate"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes after CC details have been stored for a client or the remote storage functions completed."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-5","__idx":22},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["userid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["cardtype"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["cardnum"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Only if stored locally"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["cardcvv"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["expdate"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["cardstart"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["cardissue"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-5","__idx":23},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-5","__idx":24},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('CCUpdate', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"calcaffiliatecommission","__idx":25},"children":["CalcAffiliateCommission"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes as the amount of commission is being calculated"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-6","__idx":26},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["affid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["relid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The id of the referred service"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["amount"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The amount the commission is being calculated on"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["commission"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-6","__idx":27},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-6","__idx":28},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('CalcAffiliateCommission', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"customfieldload","__idx":29},"children":["CustomFieldLoad"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when custom fields are being loaded"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-7","__idx":30},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["fieldid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["relid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The related id for the field type."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-7","__idx":31},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Override the value of the custom field returning the \"value\" key."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-7","__idx":32},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n\nadd_hook('CustomFieldLoad', 1, function($vars) {\n    return array('value' => 'overridden value',);\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"customfieldsave","__idx":33},"children":["CustomFieldSave"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when custom fields are being saved"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-8","__idx":34},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["fieldid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["relid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The related id for the field type."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-8","__idx":35},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Override the value of the custom field returning the \"value\" key."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-8","__idx":36},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n\nadd_hook('CustomFieldSave', 1, function($vars) {\n    return array('value' => 'overridden value',);\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"emailprelog","__idx":37},"children":["EmailPreLog"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Runs prior to email being logged."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-9","__idx":38},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["userid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["date"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Current timestamp"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["to"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma separated list of recipients"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["cc"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma separated list of CC recipients"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["bcc"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Comma separated list of BCC recipients"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["subject"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["message"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["attachments"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-9","__idx":39},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Accepts a return of key/value pairs to override the parameters to be logged. Use the same names as the input parameters. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["abortLogging"]}," to abort logging of the email."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-9","__idx":40},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n\n//Do not log emails for userid 2\nadd_hook('EmailPreLog', 1, function($vars) {\n    $return = [];\n\n    if ($vars['userid'] == 2) {\n        $return['abortLogging'] = true;\n    }\n\n    return $return;\n});\n\n//Override the saved subject of the email for userid 3\nadd_hook('EmailPreLog', 1, function($vars) {\n    $return = [];\n\n    if ($vars['userid'] == 3) {\n        $return['subject'] = 'This subject is overridden';\n    }\n\n    return $return;\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"emailpresend","__idx":41},"children":["EmailPreSend"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Runs prior to any templated email being sent."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-10","__idx":42},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["messagename"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The name of the email template being sent"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["relid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The related entity ID for the email being sent."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["mergefields"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Original mergefield data"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-10","__idx":43},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An array of key/value pairs to be made available as additional email template merged fields. To abort the sending, return the key/value pair ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["abortsend=true"]},". To attach a file(s) to the email return an array of the following structure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["['attachments'=>[['filename'=>'file1.pdf','data'=>'<file_content_1>'],['filename'=>'file2.png','data'=>'<file_content_2>'],...]]"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-10","__idx":44},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n\nadd_hook('EmailPreSend', 1, function($vars) {\n    $merge_fields = [];\n    if (!array_key_exists('my_custom_var', $vars['mergefields'])) {\n        $merge_fields['my_custom_var'] = \"My Custom Var\";\n        $merge_fields['my_custom_var2'] = \"My Custom Var2\";\n    }\n    if ($vars['messagename'] == 'My Message Name' && $vars['relid'] == 2) {\n        //Stop the email from sending a specific message and related id.\n        $merge_fields['abortsend'] = true;\n    }\n    $merge_fields['attachments'] = [\n        [\n            'filename' => 'invoice.pdf',\n            'data' => file_get_contents('path/to/file.pdf'),\n        ],\n    ];\n\n    return $merge_fields;\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"emailtplmergefields","__idx":45},"children":["EmailTplMergeFields"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when editing an email template."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-11","__idx":46},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The type of email template being edited."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-11","__idx":47},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["an Array of key -> value pairs of merge fields"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-11","__idx":48},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n\n//Output additional merge fields in the list when editing an email template\nadd_hook('EmailTplMergeFields', 1, function($vars) {\n    $merge_fields = [];\n    $merge_fields['my_custom_var'] = \"My Custom Var\";\n    $merge_fields['my_custom_var2'] = \"My Custom Var2\";\n    return $merge_fields;\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"fetchcurrencyexchangerates","__idx":49},"children":["FetchCurrencyExchangeRates"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when updating currency exchange rates. All supported automatic update currencies are returned"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-12","__idx":50},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["USD"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["GBP"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-12","__idx":51},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An array of key -> value pairs to define or override additional exchange rates. The rate should be appropriate to the EUR currency."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-12","__idx":52},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n\n//Return an exchange rate for the XBT currency\nadd_hook('FetchCurrencyExchangeRates', 1, function($vars) {\n    //Code here to fetch the the current exchange rate relative to EUR\n\n    //Return exchange rate relative to 1 EUR\n    return ['XBT' => 927.121,];\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"intelligentsearch","__idx":53},"children":["IntelligentSearch"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes as the Intelligent Search is being completed"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-13","__idx":54},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["searchTerm"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The term being searched for"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["numResults"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The number of results to return"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-13","__idx":55},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An array of additional search results. See example for array structure. A string response was supported in versions prior to WHMCS 7.7."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-13","__idx":56},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n\nadd_hook('IntelligentSearch', 1, function ($vars) {\n    /**\n     * This is an example of array return for an Intelligent Search.\n     * This format is supported in the blend WHMCS Admin Template.\n     * Any template based on blend and updated to WHMCS 7.7+ is also supported.\n     */\n    $searchResults = array();\n\n    // look for exact matches in client notes field\n    $result = \\WHMCS\\Database\\Capsule::table('tblclients')\n        ->where('notes', $vars['searchTerm'])\n        ->get();\n\n    foreach ($result as $client) {\n        $searchResults[] = [\n            'title' => $client->firstname . ' ' . $client->lastname, // The title of the search result. This is required.\n            'href' => 'clientssummary.php?userid=' . $client->id, // The destination url of the search result. This is required.\n            'subTitle' => $client->email, // An optional subtitle for the search result.\n            'icon' => 'fal fa-user', // A font-awesome icon for the search result. Defaults to 'fal fa-star' if not defined.\n        ];\n    }\n    return $searchResults;\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"linktracker","__idx":57},"children":["LinkTracker"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when a link.php link is being used."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-14","__idx":58},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["linkid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The id of the link being followed"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-14","__idx":59},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-14","__idx":60},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('LinkTracker', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"logactivity","__idx":61},"children":["LogActivity"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes after an activity log entry has been created."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-15","__idx":62},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["description"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["user"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["userid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ipaddress"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-15","__idx":63},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-15","__idx":64},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('LogActivity', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"notificationpresend","__idx":65},"children":["NotificationPreSend"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes prior to a notification being sent to allow for additional conditional criteria to be applied and manipulation of the notification message."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-16","__idx":66},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["eventType"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["'Ticket', 'Invoice', 'Order', 'Service', 'Domain', or 'API'"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["eventName"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["rule"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\\WHMCS\\Notification\\Rule"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Notification rule that has been matched."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["hookParameters"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["notification"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\\WHMCS\\Notification\\Contracts\\NotificationInterface"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-16","__idx":67},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["No response supported"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-16","__idx":68},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n\nadd_hook('NotificationPreSend', 1, function($vars) {\n\n    $eventType = $vars['eventType'];\n    $eventName = $vars['eventName'];\n    $rule = $vars['rule'];\n    $hookParameters = $vars['hookParameters'];\n    $notification = $vars['notification'];\n\n    // Perform additional conditional logic and throw the AbortNotification\n    // exception to prevent the notification from sending.\n    if ($eventType == 'Invoice'\n        && $eventName == 'created'\n        && (isset($hookParameters['invoiceid'])\n            && $hookParameters['invoiceid'] > 1000)\n    ) {\n        throw new \\WHMCS\\Notification\\Exception\\AbortNotification();\n    }\n\n    // If allowing the notification to continue, you can manipulate the $notification\n    // object using the interface, WHMCS\\Notification\\Contracts\\NotificationInterface.\n    $notification->setTitle('Override notification title');\n    $notification->setMessage('Override notification message body');\n\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"paymethodmigration","__idx":69},"children":["PayMethodMigration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when legacy payment details are being migrated."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-17","__idx":70},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["client"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\\WHMCS\\User\\Client"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Client Model"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-17","__idx":71},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A gateway module name."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-17","__idx":72},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('PayMethodMigration', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"preemailsendreducerecipients","__idx":73},"children":["PreEmailSendReduceRecipients"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Runs prior to a client email being sent and allows selective removal of CC and BCC recipients."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-18","__idx":74},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["messagename"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The name of the email template being sent"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["relid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The related entity ID for the email being sent"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["recipients"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Array containing 'cc' and 'bcc' recipients. Each recipient will be an array containing 'email' and 'fullname' indices"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-18","__idx":75},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An array with a 'cc' and 'bcc' list of recipients. Each recipient in those lists should be indexed with the original index hash as provided by $recipients argument. If an empty 'cc' or 'bcc' list provided, it will remove all 'cc' or 'bcc' recipients respectively. If the 'cc' or 'bcc' is omitted in the return, the original list will remain unaltered"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-18","__idx":76},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('PreEmailSendReduceRecipients', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"preupgradecheckout","__idx":77},"children":["PreUpgradeCheckout"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes on checkout of an upgrade order, after the price calculation. The upgrade order may have completed already when this hook runs."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-19","__idx":78},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["clientId"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ID of the client for the upgrade order"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["upgradeId"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ID of the upgrade order"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["serviceId"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ID of the service for the upgrade order"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["amount"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The upgrade order amount. A negative value denotes a credit calculation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["discount"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The upgrade order discount."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-19","__idx":79},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Return 'amount' and/or 'discount' key with override price for the upgrade order."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-19","__idx":80},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('PreUpgradeCheckout', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"premiumpriceoverride","__idx":81},"children":["PremiumPriceOverride"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when searching for a premium domain. The return can alter the registration & renewal costs, stop the domain being available for purchase or force the client to contact support."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-20","__idx":82},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["domainName"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["tld"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["eg com in whmcs.com"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["sld"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["eg whmcs in whmcs.com"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["register"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["If a registration, the registration price of the premium domain"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["transfer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["If a transfer, the transfer price of the premium domain"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["renew"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The renewal price of the premium domain"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-20","__idx":83},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Accepts returns to override register, transfer or renew pricing. Also boolean values of noSale or contactUs to stop the sale of the domain with different messages"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-20","__idx":84},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n\n//Stop the Domain Purchase for this Premium Domain\nadd_hook('PremiumPriceOverride', 1, function($vars) {\n    return ['noSale' => true,];\n});\n\n//Force the Client to Contact Support to Purchase Domain\nadd_hook('PremiumPriceOverride', 1, function($vars) {\n    return ['contactUs' => true,];\n});\n\n//Override the Register and Renew Pricing & Skip Markup Application\nadd_hook('PremiumPriceOverride', 1, function($vars) {\n    return [\n        'register' => 150.00,\n        'renew' => 200.00,\n        'skipMarkup' => true,\n    ];\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"premiumpricerecalculationoverride","__idx":85},"children":["PremiumPriceRecalculationOverride"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Executes when a premium domain price is being automatically recalculated."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-21","__idx":86},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["domainName"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The full domain name."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["tld"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The TLD of the domain (E.g. com in whmcs.com)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["sld"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SLD of the domain (E.g. whmcs in whmcs.com)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["renew"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["float"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The current renewal cost of the domain before any applied markup."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-21","__idx":87},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This return is accepted to override the renewal price or skip applying markup. E.g. return array('renew' => 50.00, 'skipMarkup' => true);"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-21","__idx":88},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\nadd_hook('PremiumPriceRecalculationOverride', 1, function($vars) {\n    // Perform hook code here...\n});\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"vatnumberverification","__idx":89},"children":["VatNumberVerification"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Verification of a VAT Number."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"parameters-22","__idx":90},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["vatNumber"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\\WHMCS\\Billing\\VAT\\VatNumber"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"response-22","__idx":91},"children":["Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Constant from \\WHMCS\\Billing\\VAT\\Verification\\VerificationInterface (STATE_VERIFIED, STATE_UNVERIFIED, or STATE_UNKNOWN)"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-code-22","__idx":92},"children":["Example Code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"<?php\n/**\n * Hook for VatNumberVerification must return a verification constant from\n * \\WHMCS\\Billing\\VAT\\Verification\\VerificationInterface:\n * * STATE_VERIFIED - if the VAT number is registered\n * * STATE_UNVERIFIED - if the VAT number is not registered\n * * STATE_UNKNOWN - if the hook cannot determine the registration state of the\n *   VAT number\n *\n * Multiple hooks may be registered. When a hook responds with STATE_VERIFIED or\n * STATE_UNVERIFIED, the response is treated as authoritative and final.\n * By final:\n *  * when there are multiple hooks are registered, the first authoritative answer\n *    will be yielded to the application, and remaining registered hooks will not\n *    be consulted, and no additional integrated services will be consulted.\n *\n * If neither STATE_VERIFIED nor STATE_UNVERIFIED is yielded after process all\n * registered hooks, STATE_UNKNOWN will be used by the system. When the system\n * uses STATE_UNKNOWN, other integrated services of the system will be polled in\n * an attempt to get an authoritative, final response of STATE_VERIFIED or\n * STATE_UNVERIFIED.\n *\n * Two examples:\n * 1) a hook that uses custom logic for Ireland and Germany and all other EU regions\n * 2) a hook that allows some hypothetical test mode to give results for test numbers\n *\n * While these two could be in one hook, registering both illustrates the pipeline\n * for the verification request.\n */\n\nadd_hook('VatNumberVerification', 1, function($vars) {\n    /** @var \\WHMCS\\Billing\\VAT\\VatNumber $vatNumber */\n    $vatNumber = $vars['vatNumber'];\n    $isValid = null;\n\n    if ($vatNumber->getPrefix() == 'IE') {\n        // Handle Ireland VAT numbers with custom logic\n        $number = $vatNumber->getNumber(); // Example: '091234567'\n\n        // custom logic here\n        $isValid = customIrelandVatCheck($number);\n    } elseif ($vatNumber->getPrefix() == 'DE') {\n        // Handle Germany VAT numbers with custom logic\n        $isValid = customGermanyVatCheck($vatNumber->getNumber());\n    } elseif ($vatNumber->isEU()) {\n        // Handle Germany VAT numbers with custom logic\n        $isValid = customEuVatCheck($vatNumber->getNumber());\n    }\n\n    if ($isValid === false) {\n        return \\WHMCS\\Billing\\VAT\\Verification\\VerificationInterface::STATE_UNVERIFIED;\n    } elseif ($isValid === true) {\n        return \\WHMCS\\Billing\\VAT\\Verification\\VerificationInterface::STATE_VERIFIED;\n    } else {\n        // let any other hook or the system give a final answer\n        return \\WHMCS\\Billing\\VAT\\Verification\\VerificationInterface::STATE_UNKNOWN;\n    }\n});\n\nadd_hook('VatNumberVerification', 1, function($vars) {\n    /** @var \\WHMCS\\Billing\\VAT\\VatNumber $vatNumber */\n    $vatNumber = $vars['vatNumber'];\n\n    if ($someTestModeFlag) {\n        if ($vatNumber->getIdentifier() == 'GB123456789') {\n            return \\WHMCS\\Billing\\VAT\\Verification\\VerificationInterface::STATE_VERIFIED;\n        } elseif ($vatNumber->getIdentifier() == 'GB987654321') {\n            return \\WHMCS\\Billing\\VAT\\Verification\\VerificationInterface::STATE_UNVERIFIED;\n        }\n    }\n\n    // let any other hook or the system give a final answer\n    return \\WHMCS\\Billing\\VAT\\Verification\\VerificationInterface::STATE_UNKNOWN;\n});\n"},"children":[]}]},"headings":[{"value":"Everything Else","id":"everything-else","depth":1},{"value":"AffiliateActivation","id":"affiliateactivation","depth":2},{"value":"Parameters","id":"parameters","depth":4},{"value":"Response","id":"response","depth":4},{"value":"Example Code","id":"example-code","depth":4},{"value":"AffiliateClickthru","id":"affiliateclickthru","depth":2},{"value":"Parameters","id":"parameters-1","depth":4},{"value":"Response","id":"response-1","depth":4},{"value":"Example Code","id":"example-code-1","depth":4},{"value":"AffiliateCommission","id":"affiliatecommission","depth":2},{"value":"Parameters","id":"parameters-2","depth":4},{"value":"Response","id":"response-2","depth":4},{"value":"Example Code","id":"example-code-2","depth":4},{"value":"AffiliateWithdrawalRequest","id":"affiliatewithdrawalrequest","depth":2},{"value":"Parameters","id":"parameters-3","depth":4},{"value":"Response","id":"response-3","depth":4},{"value":"Example Code","id":"example-code-3","depth":4},{"value":"AfterConfigOptionsUpgrade","id":"afterconfigoptionsupgrade","depth":2},{"value":"Parameters","id":"parameters-4","depth":4},{"value":"Response","id":"response-4","depth":4},{"value":"Example Code","id":"example-code-4","depth":4},{"value":"CCUpdate","id":"ccupdate","depth":2},{"value":"Parameters","id":"parameters-5","depth":4},{"value":"Response","id":"response-5","depth":4},{"value":"Example Code","id":"example-code-5","depth":4},{"value":"CalcAffiliateCommission","id":"calcaffiliatecommission","depth":2},{"value":"Parameters","id":"parameters-6","depth":4},{"value":"Response","id":"response-6","depth":4},{"value":"Example Code","id":"example-code-6","depth":4},{"value":"CustomFieldLoad","id":"customfieldload","depth":2},{"value":"Parameters","id":"parameters-7","depth":4},{"value":"Response","id":"response-7","depth":4},{"value":"Example Code","id":"example-code-7","depth":4},{"value":"CustomFieldSave","id":"customfieldsave","depth":2},{"value":"Parameters","id":"parameters-8","depth":4},{"value":"Response","id":"response-8","depth":4},{"value":"Example Code","id":"example-code-8","depth":4},{"value":"EmailPreLog","id":"emailprelog","depth":2},{"value":"Parameters","id":"parameters-9","depth":4},{"value":"Response","id":"response-9","depth":4},{"value":"Example Code","id":"example-code-9","depth":4},{"value":"EmailPreSend","id":"emailpresend","depth":2},{"value":"Parameters","id":"parameters-10","depth":4},{"value":"Response","id":"response-10","depth":4},{"value":"Example Code","id":"example-code-10","depth":4},{"value":"EmailTplMergeFields","id":"emailtplmergefields","depth":2},{"value":"Parameters","id":"parameters-11","depth":4},{"value":"Response","id":"response-11","depth":4},{"value":"Example Code","id":"example-code-11","depth":4},{"value":"FetchCurrencyExchangeRates","id":"fetchcurrencyexchangerates","depth":2},{"value":"Parameters","id":"parameters-12","depth":4},{"value":"Response","id":"response-12","depth":4},{"value":"Example Code","id":"example-code-12","depth":4},{"value":"IntelligentSearch","id":"intelligentsearch","depth":2},{"value":"Parameters","id":"parameters-13","depth":4},{"value":"Response","id":"response-13","depth":4},{"value":"Example Code","id":"example-code-13","depth":4},{"value":"LinkTracker","id":"linktracker","depth":2},{"value":"Parameters","id":"parameters-14","depth":4},{"value":"Response","id":"response-14","depth":4},{"value":"Example Code","id":"example-code-14","depth":4},{"value":"LogActivity","id":"logactivity","depth":2},{"value":"Parameters","id":"parameters-15","depth":4},{"value":"Response","id":"response-15","depth":4},{"value":"Example Code","id":"example-code-15","depth":4},{"value":"NotificationPreSend","id":"notificationpresend","depth":2},{"value":"Parameters","id":"parameters-16","depth":4},{"value":"Response","id":"response-16","depth":4},{"value":"Example Code","id":"example-code-16","depth":4},{"value":"PayMethodMigration","id":"paymethodmigration","depth":2},{"value":"Parameters","id":"parameters-17","depth":4},{"value":"Response","id":"response-17","depth":4},{"value":"Example Code","id":"example-code-17","depth":4},{"value":"PreEmailSendReduceRecipients","id":"preemailsendreducerecipients","depth":2},{"value":"Parameters","id":"parameters-18","depth":4},{"value":"Response","id":"response-18","depth":4},{"value":"Example Code","id":"example-code-18","depth":4},{"value":"PreUpgradeCheckout","id":"preupgradecheckout","depth":2},{"value":"Parameters","id":"parameters-19","depth":4},{"value":"Response","id":"response-19","depth":4},{"value":"Example Code","id":"example-code-19","depth":4},{"value":"PremiumPriceOverride","id":"premiumpriceoverride","depth":2},{"value":"Parameters","id":"parameters-20","depth":4},{"value":"Response","id":"response-20","depth":4},{"value":"Example Code","id":"example-code-20","depth":4},{"value":"PremiumPriceRecalculationOverride","id":"premiumpricerecalculationoverride","depth":2},{"value":"Parameters","id":"parameters-21","depth":4},{"value":"Response","id":"response-21","depth":4},{"value":"Example Code","id":"example-code-21","depth":4},{"value":"VatNumberVerification","id":"vatnumberverification","depth":2},{"value":"Parameters","id":"parameters-22","depth":4},{"value":"Response","id":"response-22","depth":4},{"value":"Example Code","id":"example-code-22","depth":4}],"frontmatter":{"title":"Everything Else","seo":{"title":"Everything Else"}},"lastModified":"2026-08-04T14:47:26.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/hooks-reference/everything-else","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}