Install and configure the official xyz.am WHMCS provisioning module. Auto-create premium accounts, sync usage stats, and give your clients one-click SSO into xyz.am.
The official xyz.am WHMCS module is a server provisioning module (no physical server required). When a client orders a product mapped to it, WHMCS calls xyz.am's API to:
curl and json extensions enabled.https://xyz.am/api/.Extract the module archive and upload the xyzam/ folder to:
/path/to/whmcs/modules/servers/xyzam/
├── xyzam.php
└── xyzamclientarea.tpl
Copy xyzamclientarea.tpl into each client area theme that your customers use. For the default theme:
cp modules/servers/xyzam/xyzamclientarea.tpl \
templates/twenty-one/xyzamclientarea.tpl
If you only use one theme, this is the only copy you need. The template renders the SSO button, account details, and usage summary inside the service overview tab.
WHMCS must be able to read the module files. On most setups:
chmod 644 modules/servers/xyzam/*.php modules/servers/xyzam/*.tpl
chown -R www-data:www-data modules/servers/xyzam/
The module declares RequiresServer = false, so you don't need to add a server entry. Configuration lives on the product itself.
Other.On the Module Settings tab, select xyzam from the Module Name dropdown. The four config fields below appear automatically.
| Field | Default | Notes |
|---|---|---|
| API Base URL | https://xyz.am/api |
No trailing slash. Override only if you're testing against staging. |
| API Key | (empty) | Your partner API key. Stored encrypted by WHMCS. |
| Verify SSL | On | Leave on in production. Turn off only for testing self-signed certs. |
| HTTP Timeout (s) | 15 |
cURL timeout. Increase if your WHMCS server has slow outbound networking. |
Save the product, then click Test Connection in the Module Commands section. A green success badge means the API key is valid and reachable. A red error includes the HTTP code and a snippet of the upstream response — usually enough to diagnose.
On the Module Settings tab, check the boxes you want WHMCS to call automatically:
| WHMCS hook | API call | Effect on xyz.am |
|---|---|---|
CreateAccount |
POST /api/create-user.php |
Creates the user (or upgrades an existing one) to premium. Sends client first/last name and email. |
SuspendAccount |
POST /api/suspend-user.php |
Downgrades the user to free and clears the membership expiry. |
UnsuspendAccount |
POST /api/unsuspend-user.php |
Re-promotes to premium. See note below |
TerminateAccount |
POST /api/terminate-user.php |
Permanently deletes the user record. |
UnsuspendAccount hook that calls /api/unsuspend-user.php, but that endpoint isn't yet present on the xyz.am side. Until it ships, unsuspending in WHMCS will return an error and the account will stay on the free tier. Workaround: manually re-run Module → Create to bump the user back to premium, or contact us to enable the endpoint.
When you open a client's xyz.am service in WHMCS admin, the Custom Fields area shows live data pulled from xyz.am:
premium, free, etc.Data is fetched live on every page load — no cron sync required. If a stat shows — it means the upstream call failed; check the module logs.
In the WHMCS client area, the service detail page is replaced by xyzamclientarea.tpl. It shows:
If you maintain a custom theme, the template uses standard WHMCS Smarty + Bootstrap classes, so it's safe to drop into any modern theme. To restyle, edit the <style> block at the bottom of the .tpl or override classes in your theme's CSS.
Every API call is logged via logModuleCall(). View them at Utilities → Logs → Module Log, then filter by Module = xyzam. Each entry shows the request URL, payload, and full response — including HTML snippets if a WAF intercepted the call.
| Error | Likely cause | Fix |
|---|---|---|
Missing API Key |
Config field left blank. | Paste your partner API key on the product's Module Settings tab. |
Forbidden (HTTP 403) |
Wrong API key, or your WHMCS IP isn't allow-listed. | Double-check the key. If it's correct, contact us with your WHMCS server's outbound IP. |
Invalid JSON response: ... |
A WAF (Cloudflare, mod_security) returned an HTML challenge page instead of letting the call through. | Allow-list WHMCS-xyzam/1.1 User-Agent from your WHMCS server's IP, or temporarily disable the rule. |
cURL error: SSL certificate problem |
Outdated CA bundle on the WHMCS server. | Update your PHP CA bundle. Don't disable Verify SSL in production. |
Unknown API error on Unsuspend |
The /api/unsuspend-user.php endpoint isn't deployed yet. |
See the warning under What Each Action Does. |
Click Test Connection on the product's Module Commands. The button calls /api/whmcs-api.php with action=test_connection. The response body (success or error) shows in the WHMCS admin banner. If it succeeds but provisioning still fails, the issue is endpoint-specific — check the per-call entries in the module log.
Authorization: Bearer header and a ?key= query parameter for compatibility with WAFs that strip Authorization headers. If your hosting provider logs query strings, treat those logs as sensitive.