Documentation
Billing and API
A sale becomes a server without anyone touching the panel. WHMCS works with the included module, and anything else uses the same API.
How it fits together
Your billing platform stays in charge of customers, invoices and products. CorePanel builds and runs the servers. The two talk through CorePanel's API, and CorePanel tells your billing platform what happened through signed webhooks.
The WHMCS module
Installing
- Copy the module's two folders into WHMCS:
modules/servers/corepanelandmodules/addons/corepanel. - In CorePanel, create an API key under Admin → API → API keys with the billing preset.
- In WHMCS, add a server under Setup → Products/Services → Servers with your panel's hostname, the module CorePanel and the key in Access Hash. Test Connection confirms the key has every permission it needs.
- In CorePanel, add a webhook under Admin → API → Webhooks → Add endpoint with the URL
https://billing.yourbrand.com/modules/addons/corepanel/webhook.php. Activate the CorePanel addon in WHMCS (Setup → Addon Modules) and paste the secret the panel shows.
Products
In each product's Module Settings, pick the Plan, the Operating system (the plan's default, a template, or none so the customer installs one) and the Node pool. The lists come straight from your panel. To sell extra IPv4 addresses, add a configurable option named Extra IPv4 (added to the plan's count) or IPv4 (the total).
What happens when
| New order | The server is built with its addresses, and WHMCS shows them on the service |
|---|---|
| Overdue | Suspended: the server stops and the customer can no longer start it |
| Paid | Unsuspended and running again |
| Upgrade | The server moves to the new plan. Disks only ever grow |
| Cancelled | The server and its addresses are removed. Its backups follow after your grace period |
WHMCS staff also get buttons to boot, shut down, reboot, rebuild and re-apply the network, and the customer's service page shows the server's details.
Customer logins
The first order of a new customer creates their panel account and e-mails them a link to choose a password, valid for 7 days. A customer who already has an account with the same address finds the new server next to their others.
Any other billing platform
Everything the module does goes through the same API, open to your own storefront or billing system.
- API keys under Admin → API → API keys carry only the permissions you tick, can be limited to your billing server's addresses, and are shown once.
- Webhooks under Admin → API → Webhooks tell your system when a server is created, suspended, unsuspended or removed. Every delivery is signed and retried until it lands.
- The full reference is in your own panel, under Admin → API → Documentation.
Requests are safe to retry: repeating one with the same key never builds a second server.
Tokens for your customers
Customers create their own access tokens under Account → API tokens for their scripts, with full access or read-only, power or metrics permissions.