Learn WHMCS

WHMCS is the top web host billing and support automation tool used by thousands of customers across the globe!

• Last Updated: 05/08/2024
• ( 8 minutes reading )

How to manage API credentials in WHMCS

Introduction

The abbreviation API stands for Application Programming Interface. APIs were conceived to provide developers and dev-ops specialists with a seamless method of creating and integrating communication means between two (or more) applications.

In simpler terms, an API specifies how different software components should interact with each other. It is an intermediary between applications, enabling them to request and exchange information or perform specific tasks.

As WHMCS allows integrations with many third-party services (such as payment gateways, email providers, and registrars), it supports APIs for communicating with them and exchanging the information a web hosting business owner needs to achieve their goals.

In this tutorial, we will go over the process of generating API credentials in WHMCS and what information you need to allow communication between your WHMCS installation and the third-party services you installed for it.

Getting Started

To begin the process of generating API credentials, please log inside your WHMCS admin area. Afterward, please move your mouse cursor over the wrench icon on the top right side of the screen.

 

system-settings

 

Doing so will inveil a drop-down menu. Please select the "System Settings" option.

 

After doing that, you will be redirected to the "System Settings" page, where you will see all the available WHMCS settings. Please use the search bar on the left side and type in "API Credentials".

 

Doing so will reveal the API credentials option. Please click on it.

 

api-credentials

 

Upon doing so, you will be redirected to the "API Credentials" page, where you will see all currently generated tokens, and you will also have an option of adding API roles and additional sets of credentials for these roles.

 

Creating API Roles

 

Before generating the API credentials, we need to create a role to associate them with. To do that, please click on the "API Roles" tab, located on the right side of the "API Credentials" tab.

 

api-roles

 

Afterward, please click the "+ Create API Role" button beneath the mentioned tabs above. Performing this action will open a popup window allowing you to assign "Allowed Actions" for the role you are about to create. 

 

create-new-api-role

 

Here are all the options available on the popup window:

 

  • Role Name - Please use this text field to set a name for the new API role.
  • Description - Please use this content box to give some context behind the new API role, who will use it, and why.
  • Allowed API Actions - Please use the array of options available here to assign specific actions the new API role can perform. To do so, please use the available checkboxes to filter out the API actions you want the role to have. If you want to assign everything, use the “Check All” link underneath the available API actions. For example, you can only give the new role access to the Support and Ticketing APIs of WHMCS, which will restrict it from using billing or payment-related APIs meant for other roles or applications.

 

Once you have set a name and description and allowed the necessary API actions for your role, please click on the "Save" button located at the bottom right side of the popup window.

 

Clicking the "Save" button will immediately populate the API roles table section with the newly created role.

 

role-list

 

Now that you have created an API role, it is time to create your set of API credentials that the respective role can use.

 

Creating API Credentials

 

To do so, please click on the "API Credentials" tab, located on the left side of the "API Roles" tab.

 

api-credentials-tab

 

Upon doing so, WHMCS will reveal the API credentials table section, and above it, you will see the "+ Generate New API Credentials" button. Please click on it.

 

required-info-for-api-credentials

 

By doing that, you will open a popup window, allowing you to generate a set of API credentials. Here is the necessary information required to do so:

 

  • Admin User - Please use this drop-down menu to select the WHMCS admin user if you want to create API credentials for. 
  • Description - Please use this text field to describe how the admin user will use these API credentials.
  • API Role(s) - Please select the API Role(s) this admin user will be assigned to use. You may choose more than one using Ctrl + Click (Windows) or Command + Click (Mac).

 

When you have typed/selected the required information above, please click on the "Generate" button at the bottom right side of the popup window.

 

api-identifier-and-secret

 

After doing that, the popup window will disappear, and in its place, you will see a new one containing the API credentials you need - the API Identifier & API Secret. 

 

IMPORTANT: Copy and save the API Secret somewhere, as it will not show up anymore after you close the popup window.

 

When you save your API Identifier and API Secret and close the popup window, you will notice that the API Credentials table section is now populated with the new pair of credentials.

 

That's it! You can now start using these API credentials in conjunction with the WHMCS APIs and integrate them with your applications so they can begin communicating together!

Conclusion

This concludes our tutorial on how to manage your API credentials in WHMCS. We hope you found it helpful and that you were able to integrate your application with all your third-party services successfully. If you want to learn more about WHMCS, please check the rest of our tutorials in our WHMCS section.

...
Nikola Zgurev
Technical Support Captain

Nikola is an accomplished tech-savvy extraordinaire with over six years of experience in the web hosting field. He started as a customer care representative and quickly rose the ranks to become a support supervisor and, eventually - the head of the technical department in HostArmada. His deep understanding of the client's needs, combined with his technical knowledge, makes him the perfect man to create the ideal harmony between client satisfaction and professional problem-solving. You will often find him creating helpful tutorials, articles, and blog posts that help existing customers get around.

Learn more about WHMCS in the other tutorials that we have: