Get The Most Affordable Hosting in the World!

Starting at just $1.87/month, Vercaa offers unbeatable pricing for world-class web hosting services.

Fast, reliable, and secure hosting to power your website without breaking the bank. Plus, enjoy a free CDN for faster loading times worldwide!

Get Started Now!

Symptom

When using the WHMCS API, you may the following error:

<result>error</result>
<message>Your license key is invalid</message>
 

Cause

This issue occurs when you perform a required license check from a non-web context (for example, the command line interface or a cron job) and the server’s outbound IP address is different than the license's IP address.

WHMCS offers both external and internal APIs. This error typically occurs when you did not choose the correct API to use.

  • Use the internal API in a web context within WHMCS files, hooks, modules, and custom pages.
  • Use the external API in non-web contexts and from any other locations.

Solution

In most cases, daily usage of the Admin Area (a web context) will ensure that a recent license response is valid for short-term use in non-web contexts. If you see this error, however, your installation may not be undergoing daily use.

For non-web contexts, we recommend making API calls remotely against the website instead of using the localAPI helper function. This ensures that your calls perform any required license check relative to the website request. The license check will reference your website's specific IP address instead of the general outbound IP address of your website's server.

This requires changing your script to send HTTP requests to the API endpoint at https://domain.com/whmcs/includes/api.php, where domain.com is the licensed valid domain and whmcs is the licensed valid directory.

 

 

The End! should you have any inquiries, we encourage you to reach out to the Vercaa Support Center without hesitation.

 

 

 

 
Was this answer helpful? 1 Users Found This Useful (1 Votes)