How to add a VAT customer field in WHMCS

Question

Some domain registries (e.g. DNS PT, ITNIC) require submitting a VAT number when registering domains under company contact handles. WHMCS doesn't include this data field by default, therefore domain registration may fail with the "Invalid VAT number" error.

How to provide a VAT number during domain registration?

Answer

  1. Navigate to Setup > Custom Client Fields and create a VATNumber|VAT Number text field.
    Screenshot_2020-07-08_at_12.23.52.pngScreenshot_2020-07-08_at_12.23.07.png
    Make sure it appears in the admin area on the Client Profile tab
  2. Add a valid VAT of your client to their profile
  3. On your WHMCS installation uncomment the following line in /whmcs/modules/registrars/openprovider/OpenProvider/API/Customer.php in the __construct method:
    $this->vat  =  CustomField::getValueFromCustomFields('VATNumber', $params['customfields']);
  4. Retry domain registration.
Was this article helpful?
Additional questions? Submit a request