WHMCS

WHMCS modules for Proxmox, Pterodactyl and custom panels

A WHMCS module from VulCode means provisioning and hooks for VPS and game server hosts: Proxmox, Pterodactyl and custom panels. It costs from PLN 999 (about EUR 220) and usually takes 2-3 days. Once an order is paid, the VPS or game server is created on its own, and an overdue one gets suspended. When WHMCS stops being enough, we tell you about the Flaem panel.

How a provisioning module works

A module is a PHP file in /modules/servers/ with functions WHMCS calls at set points in a service's life.

  1. 01

    The seven core functions are create, suspend, unsuspend, terminate, renew, change password and change package. Each must return exactly the word success or an error message that staff will see.

  2. 02

    WHMCS decides when a function runs: create after the order is paid, suspend by the cron job when overdue, unsuspend once the overdue invoice is paid. The module only handles talking to the panel or hypervisor.

On success
WHMCS changes the service status itself, and after creation sends the client a welcome email.
Up to 24 settings
A product passes settings configoption1 to configoption24 to the module, e.g. node and template.

From payment to a running VPS

The run with a Proxmox module: from payment to the email with access data.

ClientWHMCSModuleProxmox VE
Client → WHMCS
pays the order
WHMCS → Module
CreateAccount with the product's parameters
Module → Proxmox VE
clone the VM template

API token in the header

Proxmox VE → Module
a UPID task id
Module → WHMCS
success

status Active

Module → Proxmox VE
once the task ends: configure and start
WHMCS → Client
welcome email and access details
Long operations
Proxmox returns a task id and the clone runs in the background. The module stores it, and a job that checks the status finishes the work.

Module functions and panel calls

The same WHMCS function is a different call in each panel.

WHMCS functionProxmox VEPterodactyl
CreateAccountPOST .../qemu/{vmid}/clone, then startPOST /api/application/servers
SuspendAccountPOST .../status/stop or suspendPOST /servers/{id}/suspend
UnsuspendAccountPOST .../status/startPOST /servers/{id}/unsuspend
ChangePackagePUT .../config and .../resizePATCH /servers/{id}/build
TerminateAccountDELETE .../qemu/{vmid}DELETE /servers/{id}

Proxmox paths start with /api2/json/nodes/{node}.

Proxmox and Pterodactyl from the module side

The two most common WHMCS module targets at hosting companies.

Proxmox VEVPS and LXC containersPterodactylgame servers
Authentication an API token with its own permissions and expirya Bearer application key
Creating a service a background task with a UPIDthe server at once in the panel, installed by Wings
Duplicate protection a fixed VMID from the service idthe external_id field
Official WHMCS module none published, we write oneYes

05

What we watch out for with WHMCS

Details from the docs that decide whether automation leaves services half-done.

  1. 01

    Module

    Exactly success

    WHMCS treats a function as successful only on that word. Anything else is an error staff will see.

  2. 02

    Secrets out of the log

    logModuleCall gets a list of values to scrub, so passwords and tokens never land in the Module Log.

  3. 03

    An alert on failure

    The AfterModuleCreateFailed hook passes the failure reason. We send it straight to the support channel.

  4. 04

    API access by IP

    The WHMCS API accepts requests only from allowed IPs by default. An outside integration needs an entry or an access key.

  5. 05

    Hooks in a module

    The hooks.php file is detected when the module is activated. One added later needs the product settings saved again.

Example: VPS hosting on Proxmox with WHMCS

The rollout, step by step.

Company
A small VPS host with a Proxmox VE cluster
Today
VMs set up by hand after every payment
Goal
A VPS ready minutes after payment, with no one involved
  1. 1

    Templates and products

    Each OS gets a VM template, and WHMCS products point to the template, node and resources.

  2. 2

    A narrowly scoped token

    The module gets a Proxmox API token with rights only to the nodes and VMs it needs, with an expiry date.

  3. 3

    Module and completion job

    CreateAccount clones the template, and a background job waits for the clone, sets the password and starts the VM.

  4. 4

    Buttons in the client area

    VM start, stop and restart as custom module functions, shown with the service in the WHMCS client area.

Order, payment, VM and an access email with no manual work, and overdue accounts end in automatic suspension.

WHMCS with modules or Flaem

Flaem is a panel for hosting companies. WHMCS with a good module is often enough.

A provisioning module, hooks and SSO to the panel, in your current WHMCS.

A panel with provisioning on your nodes, with the store and wallet built in.

  1. 01 WHMCS with modules
  2. 02 Flaem

When

  1. You already run WHMCS with clients, invoices and payments.
  2. You only lack automation for one or two panels.
  1. You want one panel for the store, billing and servers.
  2. You are launching a new host and want one panel from day one.

WHMCS with modules

When

  • You already run WHMCS with clients, invoices and payments.
  • You only lack automation for one or two panels.

A provisioning module, hooks and SSO to the panel, in your current WHMCS.

Flaem

When

  • You want one panel for the store, billing and servers.
  • You are launching a new host and want one panel from day one.

A panel with provisioning on your nodes, with the store and wallet built in.

WHMCS and provisioning glossary

Terms from this page: module, hook, provisioning and related ones.

Provisioning
Setting up a service automatically after an order: an account, VM or game server.
Server module
A PHP file in /modules/servers/ through which WHMCS talks to the panel.
Hook
A function called on a WHMCS event, e.g. after a failed service creation.
UPID
A Proxmox task id used to check whether an operation has finished.

Common questions about WHMCS

The main questions about WHMCS modules: fixes, nodes, sign-in, cost and code.

Our ready module misbehaves. Can you fix it?
If its licence allows code changes, yes. If not, we write our own module with the same scope.
How long does it take?
Usually 2-3 days. The exact dated schedule comes with the free quote, and if anything is going to move, you know in advance.
How much does a WHMCS module for Proxmox or Pterodactyl cost?
A WHMCS module costs from PLN 999 (about EUR 220) under our API and integrations service and usually takes 2-3 days. The figure depends on the panel (Proxmox, Pterodactyl, custom), the number of module functions and what should happen on an overdue account. The quote is free and comes back within an hour.
Will the module handle several Proxmox nodes?
Yes. The node comes from the product or a rule, e.g. the least loaded node in a location.
Can the client get into the panel without a second password?
Yes, if the panel allows it. WHMCS has a single sign-on function for modules.
Will the WHMCS module code be mine?
Yes. Once the work is accepted and paid in full, the economic copyright in the module code passes to you and you get the repository with run instructions. Open source libraries keep their own licences.
How do you check a WHMCS module before launch?
On a test WHMCS installation and a test node. We run an order, a payment, service creation, suspension for an overdue account, unsuspension and removal, and only then switch the module on in production.
What if the WHMCS module stops working?
The integration logs every operation and retries the ones that failed by itself. When the problem does not go away you get a notification, and bugs that come from our work are fixed free of charge within the 90 days of support after launch.
What if WHMCS, Proxmox or Pterodactyl changes its API?
We adjust the integration to the provider's changes: within the 90 days of support included after launch, later under a maintenance plan or as a separate short order. We follow the provider's change notices and tell you in advance what needs fixing.

Sources

Technical details come from the WHMCS and Proxmox VE documentation.

Describe your project.

A free quote comes back within an hour during working hours.