WHMCS module for Jabali Panel

Last updated

The Jabali Panel server module for WHMCS creates, suspends, upgrades and terminates hosting accounts on Jabali Panel. It also syncs disk and bandwidth usage and adds a Log in to Jabali Panel button for customers and staff. It signs every request with an automation token, so WHMCS never stores a panel admin password. Billing integrations covers how the API, scopes and ports work.

Requirements

  • WHMCS 8.x
  • PHP 7.4 or newer with the curl and json extensions
  • The WHMCS server can reach the panel on 8443, or on 443 with the port 443 option turned on
  • An automation token with read:status, read:users, read:packages, write:users and write:domains, plus delete:users for termination. See Create an automation token.

1. Install the module

Copy the whmcs folder from the repository into WHMCS as modules/servers/jabali/:

git clone https://github.com/shukiv/jabali-billing-modules.git
cp -a jabali-billing-modules/whmcs /var/www/whmcs/modules/servers/jabali

Replace /var/www/whmcs with your WHMCS directory. The folder must be named exactly jabali. Copy all of it, including lib/, which holds the API client, and make sure the web server user can read the files.

2. Add the server

In WHMCS, go to System Settings → Servers → Add New Server and fill in:

FieldValue
ModuleJabali Panel
HostnameThe panel hostname, e.g. panel.example.com
Port8443 (the default), or 443 if the panel admin turned on Also serve the API on port 443
UsernameThe automation token’s ID
PasswordThe automation token’s secret

Click Test Connection. A working connection lists the actions the panel offers.

3. Create a product

Create a product under System Settings → Products/Services and open its Module Settings tab:

  1. Set Module Name to Jabali Panel.
  2. Pick the hosting package in the Package dropdown. The dropdown needs the read:packages scope.
  3. Or paste a package ID into Package ID (override). It takes precedence over the dropdown.

On the product’s Custom Fields tab, add a text field named jabali_user_id and tick Admin Only. When the module creates an account, it saves the panel user ID there and uses it for every later action. Without the field, the module looks the account up by the service username, then by the client’s email, and fails if neither matches. You can also type an ID into this field to link a service to an account that already exists on the panel.

What the module does

WHMCS actionWhat happens on the panel
CreateCreates the account on the product’s package and creates the order’s domain
Suspend / UnsuspendSuspends or reactivates the account
TerminateDeletes the account and its domains (needs delete:users)
Change PasswordSets the customer’s panel password
Upgrade / DowngradeMoves the account to the new product’s package
Log in to Jabali PanelOpens the panel with a single-use login link, from the client area or the admin service page
Test ConnectionChecks the token and lists the panel’s actions
Usage updateFills in disk and bandwidth usage and limits on each service

Usernames. The module uses the service username from WHMCS. If it is empty, it uses the first 8 letters and digits of the domain.

Passwords. Jabali Panel needs passwords of at least 10 characters. If WHMCS generates a shorter one, the module stops before calling the panel and asks you to raise the generated password length in the WHMCS security settings.

Usage sync. WHMCS runs the usage update from its daily cron. The module reads usage for every account on the panel in one call and updates each WHMCS service on that server with a matching username.

Admin service page. Shows the panel user ID, the account’s email and package ID, and disk and bandwidth used against quota.

Client area. The product overview shows the panel username and an Open Jabali Panel button.

Logs and troubleshooting

Every call the module makes is in Utilities → Logs → Module Log, with secrets removed.

SymptomFix
”Jabali requires passwords of at least 10 characters”Raise the generated password length in the WHMCS security settings.
”Cannot map this service to a Jabali user”No saved user ID and no panel account with that username or email. Put the panel user ID into the jabali_user_id custom field.
Create fails with scope_deniedThe token lacks write:domains or write:users. See scopes.
Package dropdown is emptyThe token lacks read:packages. Add it, or use Package ID (override).
Clock skew errorWHMCS and the panel clocks differ by more than 5 minutes. Sync both with NTP.
TLS errorThe panel must present a trusted certificate. The module has no option to ignore certificate errors.

More causes are in Billing integrations: Troubleshooting.

Frequently asked questions

Is there a WHMCS module for Jabali Panel?
Yes. The free Jabali Panel server module for WHMCS 8.x creates, suspends, unsuspends and terminates hosting accounts, changes passwords and packages, syncs disk and bandwidth usage, and adds a one-click 'Log in to Jabali Panel' button for customers and staff.
Where do I install the Jabali WHMCS module?
Copy the module's whmcs folder from the jabali-billing-modules repository to modules/servers/jabali/ in your WHMCS installation. The folder name must be exactly jabali.
Why does WHMCS say Jabali requires passwords of at least 10 characters?
Jabali Panel rejects account passwords shorter than 10 characters. The module checks this before calling the panel. Raise the generated password length in the WHMCS security settings.
Do I need the jabali_user_id custom field?
It is recommended. The module saves the panel user ID there when it creates the account and uses it for every later action. Without the field, the module looks the account up by username, then by email, on each action.