Automatically provision, suspend, unsuspend, and terminate hosting accounts on Opterius Panel directly from WHMCS.
- Create Account - Automatically provisions hosting accounts when a customer purchases a plan
- Suspend Account - Suspends accounts when invoices are overdue
- Unsuspend Account - Reactivates accounts when payment is received
- Terminate Account - Deletes accounts when services are cancelled
- Change Password - Allows customers to change their account password from the WHMCS client area
- Change Package - Handles plan upgrades and downgrades
- Usage Statistics - Syncs disk and bandwidth usage to WHMCS automatically
- Client Area Link - "Login to Panel" button in the WHMCS client area
- Test Connection - Verify your server connection from the WHMCS admin
- WHMCS 8.0 or later
- Opterius Panel 1.0 or later
- PHP 8.1 or later (on the WHMCS server)
- An API key generated from Opterius Panel
Download or clone this repository:
git clone https://github.com/opterius/whmcs-module.gitCopy the modules/servers/opterius/ folder into your WHMCS installation:
cp -r modules/servers/opterius/ /path/to/whmcs/modules/servers/opterius/Your WHMCS directory should look like:
whmcs/
modules/
servers/
opterius/
opterius.php
lib/
OpterusAPI.php
- Log into your Opterius Panel as an admin
- Go to Server Mode > Settings > API Keys
- Click Create API Key
- Name it (e.g., "WHMCS Production")
- Select permissions: check all (or select only what you need)
- Optionally restrict to your WHMCS server's IP address for security
- Click Generate API Key
- Copy the key immediately - it is only shown once
- In WHMCS, go to Configuration > System Settings > Servers
- Click Add New Server
- Fill in the details:
| Field | Value |
|---|---|
| Name | Any name (e.g., "Opterius Server 1") |
| Hostname | Your Opterius Panel hostname (e.g., panel.example.com) |
| IP Address | Your server's IP address |
| Module | Select Opterius from the dropdown |
| Port | 8443 (default Opterius Panel port) |
| Secure | Check this box (HTTPS) |
| Access Hash | Paste the API key from step 3 |
- Click Test Connection to verify everything works
- Click Save Changes
-
Go to Configuration > System Settings > Products/Services
-
Create a new product or edit an existing one
-
On the Module Settings tab:
- Module Name: Select Opterius
- Server Group: Select the group containing your Opterius server
- Package Name: Enter the exact name of the package as configured in Opterius Panel (e.g., "Starter", "Business", "Enterprise")
-
Save the product
That's it! When customers purchase this product, WHMCS will automatically create their hosting account on your Opterius Panel server.
WHMCS products are mapped to Opterius packages by name. The "Package Name" field in the WHMCS product configuration must match the package name in Opterius Panel exactly.
For example:
- Opterius Panel has a package called "Starter"
- In WHMCS product Module Settings, enter "Starter" in the Package Name field
- When a customer purchases this product, WHMCS tells Opterius to create the account with the "Starter" package
To see available packages, go to Server Mode > Packages in your Opterius Panel.
When a customer completes a purchase, WHMCS sends the following to Opterius:
- Domain - The domain entered during checkout
- Username - Generated by WHMCS (or entered by the customer)
- Password - Generated by WHMCS (or entered by the customer)
- Package - The package name from the product configuration
- Client Details - Customer's name and email
Opterius then:
- Creates a user account (or reuses an existing one if the email already exists)
- Creates the hosting account with the specified package
- Sets up the domain with Nginx, PHP-FPM, DNS zone, and auto-SSL
| WHMCS Function | API Endpoint | Description |
|---|---|---|
| CreateAccount | POST /api/v1/accounts/create |
Provision a new account |
| SuspendAccount | POST /api/v1/accounts/suspend |
Suspend an account |
| UnsuspendAccount | POST /api/v1/accounts/unsuspend |
Unsuspend an account |
| TerminateAccount | POST /api/v1/accounts/terminate |
Delete an account |
| ChangePassword | POST /api/v1/accounts/password |
Change account password |
| ChangePackage | POST /api/v1/accounts/package |
Change account package |
| UsageUpdate | POST /api/v1/accounts/usage |
Get disk/bandwidth usage |
| TestConnection | POST /api/v1/test |
Verify API connectivity |
Make sure the module files are in the correct location: whmcs/modules/servers/opterius/opterius.php
- Verify the hostname and port are correct
- Ensure HTTPS is enabled (check the "Secure" box)
- Check that the API key is valid and not expired
- If you set an IP whitelist on the API key, make sure your WHMCS server's IP is included
- Check that port 8443 is open in your firewall
The package name in WHMCS must match the Opterius package name exactly (case-sensitive). Check the available packages in Opterius Panel under Server Mode > Packages.
Your Opterius license has reached the maximum number of accounts. Upgrade your license at opterius.com.
Make sure the WHMCS cron job is running. Usage is synced when WHMCS runs its daily automation tasks.
- Use IP whitelisting - When creating the API key in Opterius, restrict it to your WHMCS server's IP address
- Use minimal permissions - Only grant the permissions your WHMCS integration needs
- Use HTTPS - Always check "Secure" in the WHMCS server configuration
- Rotate keys periodically - Generate a new API key and revoke the old one periodically
- Documentation: opterius.com/docs
- Issues: github.com/opterius/whmcs-module/issues
MIT License - see LICENSE for details.