Skip to content

Selling sub-servers with WHMCS and Paymenter

Set the Split Limit of a server through the Application API, and add it to your WHMCS or Paymenter module.

1 min readUpdated
On this page3 sections

Splitter registers the Split Limit as an extension field of servers that the Application API accepts and returns, so a billing panel can sell sub-servers as part of a plan or as an add-on.

Create a server with a Split Limit

Send the field under extensions when you create the server:

http
POST /api/application/servers
Authorization: Bearer ptla_...
Content-Type: application/json
 
{
  "name": "Survival Network",
  "user": 12,
  "egg": 5,
  "limits": { "memory": 16384, "swap": 0, "disk": 102400, "io": 500, "cpu": 800 },
  "feature_limits": { "databases": 2, "allocations": 4, "backups": 2 },
  "allocation": { "default": 41 },
  "extensions": { "splitter": { "split_limit": 3 } }
}

Change it later

Send it with the server details, for example after an upgrade or when an add-on is bought:

http
PATCH /api/application/servers/{id}/details
 
{
  "name": "Survival Network",
  "user": 12,
  "extensions": { "splitter": { "split_limit": 5 } }
}

Use null for the default split limit and 0 to turn splitting off. The value must be a whole number from 0 to 100. A server read from the Application API returns it under attributes.extensions.splitter.

WHMCS and Paymenter

The stock Pterodactyl modules of WHMCS and Paymenter send the server limits and feature limits, but not the extensions object. To sell sub-servers:

  1. Add a product option (a configurable option in WHMCS, a product setting in Paymenter) for the number of sub-servers.
  2. In the module's create-server request, add "extensions": { "splitter": { "split_limit": <option value> } }.
  3. In the module's upgrade or change-package request, send the same field to PATCH /api/application/servers/{id}/details.

tip

Plan the memory, CPU, disk and allocation limits of the main server with the sub-servers in mind. Sub-servers take their resources from the main server, so the total never grows.