Billing modules

Sell ScalPanel hosting from WHMCS or Blesta with the ScalPanel provisioning modules.

ScalPanel has provisioning modules for WHMCS (8 or later) and Blesta (5 or later). With them, your billing system creates, suspends, upgrades and terminates hosting accounts on its own, and customers can open their hosting panel from the client area without a second sign-in.

Both modules share one small PHP library and talk to the ScalPanel API over HTTPS with an API token.

What the modules do

Billing actionWhat happens in ScalPanelWHMCSBlesta
CreateCreates the account and its owner with the username and password from the billing system. With Set up domain, also the DNS zone, website and mail domain.YesYes
Suspend / UnsuspendSuspends the account (websites, mail and sign-in) or reactivates it.YesYes
Terminate / CancelTerminates the account and deletes its websites, databases, mail and DNS. Backups stay until their retention ends. An account that no longer exists counts as done.YesYes
Change passwordSets the owner's password. The owner's other sessions and API tokens end.YesYes
Change packageMoves the account to another ScalPanel package.YesYes
Single sign-onOpens the owner's own session in the hosting panel with a one-time link, valid for two minutes.Log in to ScalPanel buttonLog in to ScalPanel tab
UsageRecords disk and this month's transfer, in MB, for every active or suspended service.Daily usage updateNo
Test connectionChecks the server settings and the token.YesChecked when you save the server

The modules find accounts by the owner's username, which both billing systems store.

Single sign-on never skips two-factor authentication. If the owner uses it, the module tells them to sign in to the panel with their password and code instead.

Get the modules

The module files are not part of the ScalPanel server installation. Ask SCB Network at [email protected] for the current package. It contains:

Billing systemCopy the folder to
WHMCS<whmcs>/modules/servers/scalpanel/
Blesta<blesta>/components/modules/scalpanel/

Step 1: Create an API token

  1. Sign in to the admin panel (port 2087) as the provider or the reseller who will own the accounts.
  2. Open Settings → My security, and in API tokens select New token.
  3. Name it after the billing system and give it these scopes:
    • tenants.read, packages.read, sites.read
    • accounts.create, accounts.manage, tenants.suspend
    • users.manage
    • domains.manage, sites.manage, dns.manage, mail.manage, databases.manage
  4. Choose a lifetime and copy the token.

Accounts the billing system creates belong to the token's owner: the provider, or that reseller.

Warning: This token can create, suspend and terminate every account of its owner. Store it only in the billing system, which keeps it encrypted, and plan to replace it before it expires. When it expires, provisioning stops until you paste a new one.

Step 2: Add the server

WHMCS

  1. Open System Settings → Servers and add a new server.
  2. Enter the panel's hostname and choose the module ScalPanel.
  3. Set the port to 2087 and tick Secure (HTTPS).
  4. Paste the API token into Access Hash.
  5. Select Test Connection, then save.

Blesta

  1. Open Settings → Modules, install ScalPanel, and select Add Server.
  2. Enter a name, the hostname, API port 2087, tick Use HTTPS, and paste the API token.
  3. Optionally enter the Customer panel address if customers reach the hosting panel under another name (for example https://panel.example.com:2083). The default is the hostname on port 2083.
  4. Save. Blesta checks the token when you save.

The modules verify the panel's TLS certificate. Turn HTTPS off only for a test server.

Step 3: Create the product

WHMCS: create a product with the module ScalPanel. On Module Settings:

OptionWhat it does
PackageThe ScalPanel package to use. The list is loaded from ScalPanel.
Set up domainOn by default: creates the DNS zone, website and mail domain at once.
Customer panelOptional, for example https://panel.example.com:2083. Default: the server, port 2083.

Blesta: create a package with the module ScalPanel, choose the ScalPanel package, and leave Set up the domain at once ticked unless you want an empty account.

In Blesta, only staff choose the username. On a client's order, the module makes it from the domain, and it makes a strong password if none is given. Passwords must have at least 12 characters.

Troubleshooting

  • Errors in the billing system show the API's own message, for example a package limit or a username that is taken. WHMCS also writes failed calls to its module log.
  • Every call fails with an authentication error: the token is wrong, expired or revoked, its owner was suspended, or the admin panel only accepts staff from certain networks and the billing server is not in them.
  • Accounts appear under the wrong reseller: they belong to the token's owner. Use a token of the right reseller.
  • Single sign-on does not open the panel: the owner uses two-factor authentication, or the account is suspended. They can still sign in normally.