Swarmz

WHMCS module

Resell Swarmz from WHMCS with no code. Install the module, set your API key once, create a server, and every WHMCS service lifecycle event provisions, signs in, suspends, and tears down a tenant for you.

If you already run WHMCS, this is the fastest way to resell Swarmz. WHMCS keeps the billing and the customer relationship; the module turns each service lifecycle event — create, suspend, terminate — into a single call to the Platform API. You write no code.

Open source, MIT licensed

The module lives at github.com/swarmzlabs/whmcs-module. Download the latest release to install. Read the source, open issues, or fork it.

What you get

The download installs two modules in one step.

Provisioning module

A WHMCS server module. Attach it to a product and WHMCS drives the full tenant lifecycle — create, plan change, suspend, unsuspend, terminate — through the Platform API.

Reseller Console

An admin addon where you set your API key once and see every customer's plan and live credit + cloud usage (your wholesale cost) in one place.

Before you start

You will need:

  • WHMCS 8.x or newer, on PHP 8.1+ with the curl, json, and mbstring extensions enabled.
  • An active Swarmz platform account. If yours is still draft, calls return 409 account_inactive — see Onboarding.
  • Your API key (sk_live_…), issued once during onboarding. See Authentication.

The key is server-to-server only

An sk_live_ key has full control of your platform account. WHMCS stores it encrypted. Keep it on the server; never put it in client-side code or commit it anywhere.

Install and connect

The whole setup is: drop in the files, set your key once, create one server, then point a product at it.

Upload the module

Download the ZIP from the latest release and unzip it over your WHMCS root. It writes two folders, each where WHMCS expects:

<whmcs-root>/modules/servers/swarmz/   ← provisioning module
<whmcs-root>/modules/addons/swarmz/    ← Reseller Console

Nothing outside those two folders is touched.

Activate the Reseller Console and set your key

In WHMCS admin, go to Setup → Addon Modules, find Swarmz Reseller Console, and click Activate. Open its settings and paste your sk_live_… key into API Key. Leave API Base URL as https://api.swarmz.net.

Set the key here once

The server module automatically reuses this key whenever a server's Password field is left blank — so this is the only place you need to enter it. The console also uses it to show per-customer usage.

Add a server

Go to Setup → Products/Services → Servers → Add New Server.

FieldValue
NameSwarmz (anything you like)
Hostnameapi.swarmz.net
ModuleSwarmz
Usernameleave blank
Passwordleave blank — reuses the key from the console above
Secure (SSL)on

Save, then click Test Connection. A green result confirms your key is valid and the API is reachable.

Prefer a per-server key?

You can instead paste the sk_live_… key into this server's Password field. If set, the server's own key wins over the console key. Either way works; pick one.

Put the server in a group

Still under Servers, click Create New Group, name it (e.g. Swarmz), add the server you just made to the group, and save. Products attach to a group, not a server directly.

Create a product

Go to Setup → Products/Services → Products/Services and create a product (any type that supports a module, e.g. Other). On the Module Settings tab:

  • Module Name: Swarmz
  • Server Group: the group you just created

The plan's entitlement options appear below. Set them, then save. See the full option list further down.

Place a test order

Create an order for the product against a test client and accept it. WHMCS calls platform-create and the module stores the new tenant's id and dashboard URL on two service custom fields it creates automatically: Swarmz Tenant ID and Swarmz Dashboard URL. The client area now shows an Open AI Editor button.

What each WHMCS action does

Once the product is live, WHMCS lifecycle events map straight onto Platform API calls. You never invoke these yourself — WHMCS does, on what your customers trigger through billing.

WHMCS eventCallsEffect
Accept order / Createplatform-createProvisions the tenant; stores its id + dashboard URL
Initial top-up (at create)platform-topupGrants the one-time credits you configured
Upgrade / Downgradeplatform-planPushes the new plan's entitlements
Suspendplatform-suspendPauses compute + cloud, unpublishes sites, blocks SSO
Unsuspendplatform-unsuspendResumes compute + cloud, republishes sites
Terminateplatform-terminatePermanent teardown
Client clicks Open AI Editorplatform-ssoMints a fresh redirect and logs the customer in
Client area / Console usageplatform-usageReads current-period credit + cloud usage

The module addresses each tenant by external_ref, set to whmcs:<serviceid> automatically, so you never track tenant UUIDs by hand.

Plan options

Each product carries the plan's entitlements. Set them on the product's Module Settings tab.

OptionWhat it does
Credits per dayDaily AI credit budget per workspace. Empty = unlimited.
Monthly credit capOptional hard monthly ceiling. Empty = none.
Max projectsProject cap. 0 or empty = unlimited.
Max custom domainsCustom-domain cap. 0 = unlimited; a number is a hard cap.
Max compute sizeEditor compute ceiling (nano4xl).
Cloud budget cap (USD)Optional per-workspace cloud spend ceiling. Empty = none.
Initial credit top-upOne-time credits granted at provisioning.
Monthly credits (paid grant)Paid credits added each billing cycle. 0 = none.
Credit rolloverHow long unused monthly credits carry over (None / 1 / 2 months).
Max published projectsHow many projects can be live at once. 0 = unlimited.
Custom domains enabledAllow this plan to connect custom domains at all (yes/no).

These map to the entitlements sent on every platform-create and platform-plan call.

Customer sign-in and usage

In the client area, the module adds an Open AI Editor button (rename it in the console). It calls platform-sso, mints a short-lived redirect, and drops the customer into their dashboard already logged in — a fresh token on every click, nothing cached.

The Reseller Console reads platform-usage and shows each customer's plan and live consumption in one table, so you can reconcile against your wholesale invoice. Its settings also control client-area presentation: the editor button label, what you call "credits", and whether to show AI and cloud spend to the customer. See Usage and Billing summary.

Troubleshooting

Calls return 409 account_inactive

Your platform account isn't active yet. A card on file is the gate — see Onboarding. Until then, create and sso are blocked by design.

  • Test Connection fails with 401 — the key is wrong, rotated, or not set. Paste the current sk_live_… key into the console's API Key (or the server's Password). See Authentication.
  • Nothing provisions when an order is accepted — open the product's Module Settings and confirm Module Name is Swarmz and a Server Group is selected.
  • Customer can't open the editor — the tenant is likely suspended; SSO returns 409 suspended until you unsuspend.
  • Want to see what was sent — every call is recorded under Utilities → Logs → Module Log (the API key is redacted).

Prefer to build it yourself?

Not on WHMCS, or wiring provisioning into your own panel? Every action above is a plain REST call. Start at Authentication and Create a tenant.

On this page