Docs apolopanel.com ↗ Start trial ↗
Documentation Integrate

Billing systems

APOLO has provisioning modules for WHMCS, HostBill, Blesta and FOSSBilling. When an order is paid, an invoice goes overdue or a service is cancelled, the billing system creates, suspends or deletes the hosting account in APOLO by itself, and the customer signs in to the panel with one click.

What the modules do

In the billing systemIn APOLO
Create (an order is activated)Creates the account with the product's APOLO package (limits, features, access). Optionally also a PHP website for the order's domain with a Let's Encrypt certificate: while the domain doesn't point to the server yet, APOLO checks every 10 minutes and issues the certificate as soon as it does. If the website can't be added, the account is still created and the reason is logged.
Suspend, UnsuspendSuspends the account and all its websites with the billing system's reason (shown in the panel), or activates it. Repeating it does no harm.
Change packageApplies the new APOLO package.
Change passwordSets the password for the panel, SFTP, SSH and FTP at once; the customer's other panel sessions end.
Terminate, CancelDeletes the account with all its websites, databases, mailboxes and cron jobs. An account that no longer exists counts as deleted.
Log in to APOLOA one-time link (60 seconds) that signs the customer in to their own panel; with two-factor sign-in on, the panel still asks for the code. While the account is suspended it leads only to the panel's address.
Client areaStatus, disk and bandwidth this month, websites, databases and mailboxes, the sign-in button, shortcuts and the account's websites with the state of their certificates.

Usernames: APOLO's are a lowercase letter followed by 2 to 15 lowercase letters or digits, and some names are reserved. If the billing system's username doesn't fit, the module makes one from the domain (for example studiokr for studiokreativa.rs, with digits if taken) and writes it back to the service. Passwords have at least 10 characters; a shorter one at creation is replaced with a generated one of 16. If an account with that username already exists on the server, Create reports an error and doesn't take it over.

Each account belongs to the client of the billing system whose service made it. A service of another client of the same billing system with that username can't manage the account or sign in to it; the module gets an error that says so. An account made in the panel, or by an older module, belongs to the client of the first service that manages it. The account's page in Users shows its billing client, and Unlink lets the next service with that username link it, for example after the service moved to another client. This needs WHMCS module 1.2.0, Blesta 1.1.0, HostBill 1.1.0 or FOSSBilling 1.1.0; FOSSBilling links an account when it gives the module the client's ID.

Before you start

  1. An API token: in APOLO, Settings → General → API tokens → New API token, named after the billing system (its changes appear in the audit log as api:WHMCS and so on), for Hosting accounts (billing system), with the billing server's IP address as the allowed address. The token (apolo_…) is shown once. See API tokens.
  2. Network: the billing server must reach APOLO's administration port (8443); customers open the users' port (2083). If administration access is limited by address, add the billing server's address (Administration access).
  3. The panel address under Settings → General (for example https://panel.example.com:8443): sign-in links lead customers to the users' port of that address.
  4. The panel's certificate: best is a real certificate for the panel's host name (Host name and certificate). With the self-signed one, pin its public key in the module (below).

The modules talk to APOLO only over HTTPS and refuse to send the token otherwise. Get the module for your billing system from the APOLO portal or from support.

WHMCS

For WHMCS 8 with PHP 8.1 or newer (curl and json).

  1. Copy the folder modules/servers/apolo/ into WHMCS (<whmcs>/modules/servers/apolo/).
  2. System Settings → Servers → Add New Server: Module APOLO, the APOLO server's host name or IP, port 8443 ("Override with custom port"), Username empty, Password: the API token (WHMCS stores passwords encrypted), Secure on. Test Connection.
  3. The product: System Settings → Products/Services → (product) → Module Settings: Module APOLO, the server group, APOLO package (a list from the server; or the package's id such as pkg_standard, shown under Limits), Create website and Let's Encrypt SSL.
  • Client area shortcuts: websites, email accounts, webmail, the file manager, databases, WordPress, backups, DNS zones, cron jobs, FTP and SSH, and security and 2FA. Each signs the customer in and opens that page of the panel; only the shortcuts the account's package allows are shown. The template looks the same in the Six and Twenty-One themes and those built on them, in English or Serbian by the customer's language.
  • Server Sync (Utilities → Server Sync): lists the accounts on the APOLO server to import into WHMCS or compare with the services, by username; the product is chosen by the APOLO package, the domain is the account's first website. Useful after a migration.
  • Usage Update: once a day (WHMCS cron) the disk (home folder, databases and mail) and bandwidth of every service is written to WHMCS.
  • The admin's service page shows the APOLO account, usage, traffic and websites.

HostBill

  1. Unpack the module into HostBill's folder (it makes includes/modules/Hosting/apolo/), then Settings → Modules → Hosting Modules → APOLO → Activate.
  2. Settings → Apps → Add new App → APOLO: the panel's host name, the API token in the password field, the port (empty: 8443), the certificate pin if needed, SSL on; Test Connection.
  3. In the product, choose the APOLO package ("Get values from server") and the website options.

Customers get an APOLO panel page in the client area with the usage, the sign-in button and the shortcuts.

Blesta

  1. Copy components/modules/apolo/ into Blesta, then [Settings] > [Company] > [Modules] > Available > APOLO > Install.
  2. [Modules] > Installed > APOLO > Manage > Add Server: a name, the APOLO server's host name, the port (empty: 8443), the API token and the certificate pin if needed. Blesta checks the connection at once.
  3. [Packages] > Create Package, Module APOLO: the APOLO Package, Create website and Let's Encrypt SSL.

Customers get an APOLO tab with the usage, the sign-in button and the shortcuts. The username can't be changed afterwards; a domain changed in Blesta isn't changed in APOLO (change websites in the panel).

FOSSBilling

  1. Copy library/Server/Manager/Apolo.php into FOSSBilling (the file contains the API client too).
  2. Products → Hosting plans and servers → New server: server manager APOLO, the host name, port 8443, Secure (HTTPS) on, the API token, the certificate pin if needed; Test connection.
  3. The hosting plan: its name is the APOLO package's name or id, or use the plan's custom values package (the package id), website = 1 and ssl = 1.

Limits come from the APOLO package; the plan's own limit fields aren't used. Sync reads the account's status and dedicated IP from the server.

The panel's certificate and pinning

With the panel's self-signed certificate, the modules refuse the connection by default. The safe options, best first:

  1. A real certificate for the panel's host name: nothing to set.
  2. Pin the panel's public key in the module (pin=sha256//… in WHMCS's Access Hash and HostBill's certificate field, or the certificate pin field of Blesta and FOSSBilling). Get the value on the APOLO server:
    openssl x509 -in /etc/apolo/tls/panel.crt -pubkey -noout \
      | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | base64
    When the certificate is replaced with a new key, update the pin.

Accepting any certificate (WHMCS's self-signed=accept) lets anyone who can intercept the traffic between the billing system and the panel steal the token. Use it only for a test.

If the module doesn't work

  • Test Connection fails: check that the billing server reaches port 8443, the token, its allowed addresses, and the administration access list.
  • "The certificate isn't trusted": see pinning.
  • Suspend or Terminate says the account doesn't exist: the module finds accounts by the service's username; if it was changed in the billing system, change it back (or in APOLO).
  • "… belongs to another client of the billing system": the service's username is the account of another client. Check the username; if the service has moved to this client, Unlink the account on its page in Users first.
  • Create fails because of a limit: with APOLO Pro, all 3 hosting accounts of the licence may be in use (Accounts and the licence).
  • Every request of the module is in APOLO's audit log as api:<token name>.

Something missing or unclear? Ask support or report a bug.