The VirtFusion module for WHMCS automates the VPS lifecycle: when a customer orders and pays, WHMCS creates the server in VirtFusion; overdue invoices suspend it; cancellations terminate it. Customers can also jump from the WHMCS client area into the VirtFusion panel without a second login.
Before you start
- A working VirtFusion setup with at least one hypervisor, IP block, OS templates and package; see add a hypervisor.
- WHMCS installed and up to date; see install WHMCS.
- The VirtFusion WHMCS module, downloaded from your VirtFusion account or its documentation.
Create an API token in VirtFusion
- In the VirtFusion admin area, open the API section and create a new token for WHMCS.
- Give it a clear name, for example WHMCS, and copy the token. It is shown only once.
- If VirtFusion lets you restrict the token by IP, allow only your WHMCS server's IP.
Install the module in WHMCS
- Upload the module files to your WHMCS installation, keeping the folder structure (provisioning modules go in
modules/servers/). - Follow any extra steps in the module's readme, such as hooks or an addon component.
Add VirtFusion as a server in WHMCS
- In WHMCS go to Configuration → System Settings → Servers and click Add New Server.
- Enter the VirtFusion panel hostname, choose the VirtFusion module type and paste the API token in the field the module uses.
- Click Test Connection, then save. Put the server in a server group if you have several.
Create VPS products
- Go to Configuration → System Settings → Products/Services and create a product of type Server/VPS.
- On Module Settings, select the VirtFusion module and server group.
- Choose the VirtFusion package (and hypervisor group, if offered) the product should use.
- Choose Automatically setup the product as soon as the first payment is received.
- Set pricing on the Pricing tab and save.
Configurable options
Use WHMCS configurable options to let customers pick extras such as the operating system, extra IPs, more memory or a location. Create an option group under Configuration → System Settings → Configurable Options, assign it to the product, and name the options exactly as the module documentation requires so they map to VirtFusion values.
Single sign-on
With the module active, the client area shows controls and a button to open the VirtFusion panel. The module creates the matching VirtFusion user automatically and logs the customer in through SSO, so they never need a separate password.
Verify
- Place a test order as a client and mark the invoice paid.
- Confirm the server appears in VirtFusion and boots.
- Test suspend, unsuspend and terminate from the WHMCS admin product page.
Troubleshooting
- Test Connection fails: wrong hostname or token, or the token is IP-restricted to a different address.
- Order stays pending: check Utilities → Logs → Module Log in WHMCS for the API error, for example no free IPs or no capacity in the package.
- SSO button missing: the module's client-area template or hook is not installed.
