Configuring the Truehost Domain Reseller API is a seamless process that can be achieved by following the steps below.
Please follow all steps in this guide carefully.
Step 1: Configuring The domain API reseller.
This part is to be done by Domain API Provider. #
Login to WHMCS say Truehost.com.ng as admin,
Go to Addons -> Domain Reseller -> Resellers

Click on Add Reseller.

a) Enter the client details such as email address.
b) Generate an API Key (Copy it : xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx )
c) Allowed IP address : Here you can enter the IP address of the server hosting your WHMCS installation.
Leave this part blank as this can be configured by the client from the Domain Reseller Area in his/her client area account.
d) Set API Status to ON
e) Click Confirm.

You will see Reseller Added successfully.
Step 2: Payment method. #
Once the you have created the Reseller, ensure to Set a Payment method.

Set Payment method.
For me I’ll use “Visa & Mastercard Debit & Credit Cards“
Save changes.

The payment method should now be set.

Step 3: Domain Reseller Area. #
Login to your Client Area -> Domains -> Reseller Area.

If you do not see Reseller Area under domains, Reach out to support for your Domain API reseller to be activated and setup as covered in step 1 & 2.
Go to Reseller Area -> Settings

NOTE: WHMCS Server IP address refers to the server where you have installed WHMCS. Confirm the IP from your provider. For cPanel, you can check on the dashboard for shared IP ADDRESS.
See sample.

Confirm all your details are okay. Click submit
The details will be required in a Later step 5:
Step 4: Now Let’s Move to cPanel where your WHMCS is hosted. #
Login to cPanel and navigate to your whmcs folder
Look for the folder modules/registrars”
Insider the registrars module, Upload the domain API Zip file you got from your email once the order was activated.

Extract the Module

At this point, if you go to WHMCS installation -> Domain registras, You may notice you cannot see Truehost yet.
Go back to cPanel and you will notice when you extracted, a folder called TruehostC was created.

Navigate to this folder.
Inside TruehostC folder, you will see another folder called modules.

Navigate inside modules folder. You will see another folder called registrars

Navigate inside the registrars folder, you will see a folder called Truehost

Now we need to move this folder “Truehost” to the modules/registrars folder where all registrars are placed.
Current location

New expected location.

You should now have a Folder called Truehost on the modules/registrars section.

You can at this point delete TruehostC folder.
Step 5: Domain Registrars Setup. #
Now at this point, you need to login to your WHMCS installation.
Navigate to “System settings“

Go to “Domain Registrars”

Scroll down and locate Truehost
Click on Activate and configure your API.
Get your Details from Reseller Area -> Settings as Shown in Step 3, Second Image (2) above.

All done.
Step 6: Pricing Setup #
NOTE: This step is beyond the scope of our support.
At this point ensure you to setup domain pricing on your WHMCS.
First, I’ll add the extension I want to use. I’ll start by adding .com.ng (Ensure to add all other extensions)

Configure Pricing.
Here Configure Pricing for all listed domains and set Auto Registration to Truehost.
See guide on Configuring Pricing.
https://docs.whmcs.com/domains/pricing-and-configuration/domain-pricing/#lookup-provider

Step 7: Testing #
Let’s test for the domain Availability.
For me, I will test using .com.ng
You may run into the error below stating
yourdomain.com.ng is unavailable
Example below: “mysimpletest.com.ng is unavailable“

The reason for this error is because the extension is not yet listed inside resources/domains/dist.whois.json file
WHMCS can check the availability of over 200 different domain extensions as standard by connecting to the relevant whois server for the domain in question.
It does this by looking through a list of common whois servers contained with in theresources/domains/dist.whois.json file.,
then looking for any custom whois servers in the user-modifiable/resources/domains/whois.json file.
if the domain being checked in this case is not in the list, there are two ways to address the error:
- Add extra whois server details by following the instructions in WHOIS Servers.
whois servers docs
2. Select your domain registrar as a lookup provider (if supported by the module).
For us, we shall use Option 1 : whois servers
Navigate to your cPanel, where you have installed WHMCS.
Locate the folder called “resources”

Insider resources go to the folder called domains.
Inside domains, locate a file called dist.whois.json.

Edit this file and add the code below
[{
"extensions": ".ng,.com.ng,.org.ng,.net.ng",
"uri": "socket://whois.nic.net.ng",
"available": "No Object Found"}
]
Here is a full list of extensions
you can include for .ng
.ng,.com.ng,.org.ng,.net.ng,.gov.ng,.edu.ng,.sch.ng,.name.ng,.mil.ng,.i.ng,.mobi.ng,.gm.gov.ng,.be.gov.ng,.dl.gov.ng,.kg.gov.ng,.na.gov.ng,.oy.gov.ng,.yb.gov.ng,.ab.gov.ng,.bo.gov.ng,.eb.gov.ng,.im.gov.ng,.kn.gov.ng,.ni.gov.ng,.pl.gov.ng,.zm.gov.ng,.ad.gov.ng,.bu.gov.ng,.ed.gov.ng,.jg.gov.ng,.kt.gov.ng,.og.gov.ng,.rv.gov.ng,.abj.gov.ng,.ak.gov.ng,.by.gov.ng,.ek.gov.ng,.kb.gov.ng,.kw.gov.ng,.on.gov.ng,.sk.gov.ng,.an.gov.ng,.cr.gov.ng,.en.gov.ng,.kd.gov.ng,.lg.gov.ng,.os.gov.ng,.tr.gov.ng

Save changes and try to perform domain lookup again. The domain should now be available.
The domain should show available and clients can now register.

Once an order has been placed, it should be available on your WHMCS.
See sample.

Possible Issues. #
A) API is Disabled By admin
You may attempt to accept a domain order but instead you get the error that API is disabled by admin.

Cause : Domain API Status is disabled from the Resellers section on the registrar's end.
This error occurs if during the API setup (In step 1 , the status for API was not toggled to ON)
Resolution : Check with support to Enable API

B) Low Balance
Cause: Insufficient Credit in your account
.
Resolution : Ensure to top up your truehost client area with enough credit for the domain to be registered.

C) Wrong domain search being returned.
Am searching for a .com.ng or .org.ng extension but it returns saying .com available or not available.
Cause: You have not yet Configured .org.ng or .com.ng extension pricing
or the specific extension for that matter.
Resolution : Ensure to configure pricing for all extensions you intend to register on your WHMCS.
See sample below error below.

D) Unable to see Truehost on your WHMCS list of Registrars.
After Uploading and extracting the Domain API module, you go to your WHMCS installation – > Domain Registrars and you cannot see Truehost.
Cause: Extracting the API creates a folder called "TruehostC" which is not fetched by your WHMCS.
Resolution : Follow Step 4
Carefully above.
E) Registrar Error

If you have routed your domain through Cloduflare and enabled DDOS Protection, you may experience the error “Verification is taking longer than expected. Check your Internet connection and refresh the page if the issue persists“
Cause : Incorrect Device Date & Time
Resolution : Check your device’s date and time. If it’s incorrect, this might be why you’re seeing the message. Ensure to set your region correctly and time to Automatic and not Manual.
If you’ve configured static LAN IP configured to multiple devices, check to change this to Automatic Allocation. Having static IP may cause one device to connect successfully while the other still shows the error despite being in the same network.
F) Your Account is not being debited upon domain registration.
You’re using Truehost resellers module, a customer purchases a domain from your website, the order has been completed from your side and payment has been received, but funds for the domain is yet to be debited from your Truehost Account and the domain is thus not registered.
Cause: Misconfigured API URL Endpoint.
Resolution : Ensure to configure the API Endpoint correctly to the platform you got the Domain Reseller API module from. If from Truehost Kenya (truehost.co.ke) ensure the end point reads truehost.co.ke
By default the API end point uses truehost.cloud url (Change this as per Step 5 above to match your correct URL)

G) Provided username is Invalid
You try to manually accept a domain order so as to register but you get the error “provided username is invalid
“
Cause: Misconfigured API URL Endpoint
OR wrong IP address on the domain Reseller Area section.
Resolution : Follow Step 3 & 5
Carefully. Ensure API endpoint and is correct and the IP entered is the IP where your WHMCS installation is hosted at.
API endpoint should match the details in the client area Domain Reseller Area settings as shown in Step 3 image 2 above.
Sample Error 1. When Accepting Orders.

Sample Error 2. Invalid username with IP.

Once you follow step 3 and 5 , the issue should be resolved and domain can be registered.
H) Domain search keeps loading and doesn’t return anything.
Sample Below attached.

Cause: Misconfigured API URL Endpoint
OR wrong IP address on the domain Reseller Area section
Resolution : Follow Step 3 & 5
Carefully. Ensure API endpoint and is correct and the IP entered is the IP where your WHMCS installation is hosted at.
API endpoint should match the details in the client area Domain Reseller Area settings as shown in Step 3 image 2 above.
I) EPP Request Failed. (Action is not allowed..)

Cause: Insufficient API permissions for the specific API Call.
Resolution : Contact Support to adjust API Permissions.
This can be adjusted at Domain Reseller Module section on WHMCS , Groups section under API Permissions.

J) Error ‘Function Not Supported by Registrar Module’
Explanation : This means that registrar on main WHMCS does not support the operation you were trying to do.
Resolution : Nothing to do.
K) Provided domain has not been found in reseller account
Cause:
When the above error is returned by the API for any reseller domain action, it means that the order for this domain was added by default by WHMCS and not by the API of the module (reseller functionality).
Solution:
The domain should be additionally imported to the reseller manually.
Guide 2: https://truehost.com/support/knowledge-base/how-to-assign-domains-to-reseller/
L) Error: ‘Provided domain has not been found in reseller account’
Cause:
The Domains Reseller For WHMCS module does not support the “Transfer Ownership” action. If you attempt to transfer a domain between WHMCS clients (resellers), the above error will appear.
Resolution:
Transfer the domain between resellers manually at the database level. To do so, execute the following command:UPDATE `DomainsReseller_ResellerRelations` SET `resellerid` = (SELECT id FROM `DomainsReseller_Resellers` WHERE `clientid` = :newClientID) WHERE relid = :domainId and type = 'domain';
Where:
- clientid – ID number of a WHMCS client (a reseller) to which a domain has been transferred
- relid – ID number of the transferred domain
This is based on the data from WHMCS system activity log.
For example:UPDATE `DomainsReseller_ResellerRelations` SET `resellerid` = (SELECT id FROM `DomainsReseller_Resellers` WHERE `clientid` = 3804) WHERE relid = 5176 and type = 'domain';
Based on system activity log data:
=====================================================================================
Further Troubleshooting. #
=====================================================================================
In case you experience errors, you can reach out to support and share the error logs from your WHMCS.
You can find this from “System Logs”
See sample below.

Sample error messages from the Logs.
Low balance

Domain not available.

That is all. Happy Hosting !
Thank you.