WHMCS registrar module
Download moduleGet the current integration package and setup instructions.
Code examples
Use these minimal read-only examples from your backend. They do not create accounts, deposits or domain purchases.
Bash / cURL
curl --request GET \\n --header "Accept: application/json" \\n --header "Authorization: Bearer $WW_API_KEY" \\n "https://api.wonderweb.co.zw/v1/account/"PHP 8
<?php
$base = 'https://api.wonderweb.co.zw/v1/';
$key = getenv('WW_API_KEY');
if (!$key) throw new RuntimeException('API key missing');
$ch = curl_init($base . 'pricing/');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $key,
'Accept: application/json'
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => false,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_TIMEOUT => 20,
]);
$raw = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($raw === false || $status !== 200) {
throw new RuntimeException('Catalogue request failed: ' . $status);
}
$data = json_decode($raw, true, 512, JSON_THROW_ON_ERROR);
if (($data['success'] ?? false) !== true) {
throw new RuntimeException('Unconfirmed API result');
}
// Validate the resource fields before using the response.Python 3
import json
import os
from urllib.request import Request, build_opener, HTTPRedirectHandler
from urllib.error import HTTPError, URLError
base = 'https://api.wonderweb.co.zw/v1/'
key = os.environ['WW_API_KEY']
request = Request(base + 'wallet/', headers={
'Authorization': 'Bearer ' + key,
'Accept': 'application/json',
})
class NoRedirect(HTTPRedirectHandler):
def redirect_request(self, req, fp, code, msg, headers, newurl):
return None
try:
with build_opener(NoRedirect()).open(request, timeout=20) as response:
data = json.load(response)
except HTTPError as exc:
raise RuntimeError(f'API returned HTTP {exc.code}') from None
except URLError:
raise RuntimeError('API connection failed') from None
if data.get('success') is not True:
raise RuntimeError('Unconfirmed API result')
# Validate and use the account-scoped wallet response.The example rejects unexpected redirects so credentials are not forwarded to another host. Validate the expected resource shape, apply rate limits and avoid storing raw credentials in logs.
Next steps
Authentication and integration security explain how to store and rotate credentials safely.