Administration
Billing and WHMCS
NGCP does no invoicing itself. A billing system (WHMCS, or anything that can call a REST API) creates, suspends and removes game servers through the billing API. A WHMCS module ships with NGCP.
The billing API key
Create an API key with the scope billing (account page → API keys):
- as an administrator: the key works for every customer;
- as a reseller: the key works for that reseller’s customers only, and the customers it creates belong to the reseller.
A billing-only key can provision and manage game servers but cannot open consoles, files or
settings. Add services:all if your billing staff should start / stop servers from the billing
system.
WHMCS
The module comes as ngcp-whmcs-module-X.Y.Z.zip next to the other NGCP packages (source:
integrations/whmcs/):
- Unzip it and copy
ngcp-whmcs/modules/servers/ngcp/to<whmcs>/modules/servers/ngcp/. - WHMCS System Settings → Servers → Add New Server: module NGCP, the panel’s host name and port (tick Secure for https), the API key in Access Hash. Test Connection checks the key and its billing scope.
- Create the NGCP package for each product.
- WHMCS product → Module Settings: the NGCP Package ID, optionally a Datacenter
ID, whether to start after install, and the server name pattern
(
{product} #{serviceid}).
Optional configurable options named slots, datacenter or package let customers choose
those at order time.
| In WHMCS | In NGCP |
|---|---|
| Order accepted / paid (Create) | The game server is created from the package for the client’s e-mail address (the customer account is created when new), installed and, if the package says so, started |
| Overdue invoice (Suspend) | Suspended with the reason, see below |
| Paid again (Unsuspend) | Back as it was: a server that was running starts again |
| Cancelled (Terminate) | The game server and its files are deleted; the customer account stays |
| Upgrade / downgrade (Change Package) | The new package’s limits; slots kept inside its range |
| Change Password | The customer’s panel password |
| Log in to the game panel | A one-time link that signs the client in and opens the game server |
| Daily cron (usage) | Disk used and disk quota per service |
The client area shows the server’s status, address, slots and players. Repeating Create
is safe: the module finds the existing server through its billing reference
whmcs-<service id> instead of creating a second one.
Details, the configurable options and a test harness that runs the whole life cycle without
WHMCS: integrations/whmcs/README.md.
Suspended game servers
A suspension (billing or an administrator) keeps everything and blocks use:
- the server is stopped gracefully (its stop command or RCON, like a normal stop);
- start, restart, console input, the file manager and SFTP are refused; open SFTP sessions are ended;
- scheduled tasks do not run;
- files, backups and ports are kept;
- the owner sees the server as suspended with the reason (for example Overdue on Payment); administrators still have full access.
Unsuspending brings it back; a server that was meant to run starts again.
Other billing systems
The same endpoints work for any billing system (API reference: /api/v1/docs, tag Billing):
| Call | Purpose |
|---|---|
POST /api/v1/services with package_id, owner_email, external_id |
Provision for a customer (found or created by e-mail). Repeating it with the same external_id returns the existing server (existing: true, HTTP 200). |
GET /api/v1/services?external_id=... |
Find the server of your reference |
POST /api/v1/services/{id}/suspend ({"reason": "..."}), /unsuspend, /reinstall |
Suspend, unsuspend, reinstall |
DELETE /api/v1/services/{id} |
Terminate (files deleted) |
PATCH /api/v1/services/{id}/package |
Change package |
GET /api/v1/services/{id}/usage?since= |
Disk, CPU, memory and player usage |
POST /api/v1/users/{id}/password |
Set a customer’s password |
POST /api/v1/users/{id}/sso-link ({"service_id": ...}) |
A sign-in link valid once, for 60 seconds |
Single sign-on links are only issued for customer accounts (users and sub-users), never for administrators or resellers, and every link is recorded in the audit log.