Introduction
Reseller API for Affordable Domains, optimised for the WHMCS registrar module.
Our sandbox environment is located at https://sandbox.affordabledomains.co.nz. Please send all test requests to this URL.
Our production environment is located at https://www.affordabledomains.co.nz. Please send all live requests to this URL.
In order to use our sandbox environment you will need to register an account at https://sandbox.affordabledomains.co.nz/sign-up. After logging in, you will need to add funds to your account. This can be done by clicking the "Add funds" icon. You will then need to enter an amount and click "Add Funds". This will create a receipt which you will need to pay via a dummy credit card listed below. In order to use a credit card, we require it to be verified. This has been disabled in the sandbox environment so you can simply click the verify button with no input and the card will be verified automatically. After this step you can begin your development using the documentation provided below.
Dummy Credit Cards
| Number | Brand |
|---|---|
| 4242 4242 4242 4242 | Visa |
| 4000 0566 5566 5556 | Visa (debit) |
| 5555 5555 5555 4444 | Mastercard |
| 2223 0031 2200 3222 | Mastercard (2-series) |
| 5200 8282 8282 8210 | Mastercard (debit) |
| 5105 1051 0510 5100 | Mastercard (prepaid) |
| 3782 822463 10005 | American Express |
| 3714 496353 98431 | American Express |
Requests are POSTs with the parameters sent as form fields or as a JSON body. Every response is JSON with a status of success or failed; failures include a statusMsg.
The optional .json suffix on endpoint URLs (e.g. GetNameservers.json) is accepted but not needed.
Authenticating requests
To authenticate requests, include a parameter username in the body of the request.
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
Send your account email address as username and your account password as password with every request. Requests are only accepted from IP addresses you have whitelisted in the API section of our client portal.
Domain Actions
Get Nameservers
requires authentication
Gets the nameservers for a domain.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GetNameservers';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GetNameservers"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GetNameservers" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"nameservers": [
"ns1": "ns1.yourdomain.co.nz",
"ns2": "ns1.yourdomain.co.nz",
"ns3": "ns1.yourdomain.co.nz",
"ns4": "ns1.yourdomain.co.nz"
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Set Nameservers
requires authentication
Updates the nameservers for a domain.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/SetNameservers';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'nameservers' => [
'architecto',
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/SetNameservers"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"nameservers": [
"architecto",
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/SetNameservers" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"nameservers\": [
\"architecto\",
\"architecto\"
]
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully updated nameservers for yourdomain.co.nz.",
"nameservers": [
"ns1": "ns1.yourdomain.co.nz",
"ns2": "ns1.yourdomain.co.nz",
"ns3": "ns1.yourdomain.co.nz",
"ns4": "ns1.yourdomain.co.nz"
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Register a Child Nameserver
requires authentication
Set a child nameserver for a domain.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/RegisterNameserver';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'nameserver' => 'architecto',
'ipaddress' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/RegisterNameserver"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"nameserver": "architecto",
"ipaddress": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/RegisterNameserver" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"nameserver\": \"architecto\",
\"ipaddress\": \"architecto\"
}"
Example response (200):
{
"status": "success",
"statusMsg" : "Successfully set a nameserver for yourdomain.co.nz.",
"nameserver": "ns.yourdomain.co.nz",
"ip": "",
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Modify a Child Nameserver
requires authentication
Modifies the IP of a child nameserver.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/ModifyNameserver';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'nameserver' => 'architecto',
'newip' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/ModifyNameserver"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"nameserver": "architecto",
"newip": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/ModifyNameserver" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"nameserver\": \"architecto\",
\"newip\": \"architecto\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully updated ip address of a nameserver for yourdomain.co.nz",
"nameserver": "ns.yourdomain.co.nz",
"newip": "",
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a Child Nameserver
requires authentication
Delete a child nameserver for a domain.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/DeleteNameserver';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'nameserver' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/DeleteNameserver"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"nameserver": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/DeleteNameserver" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"nameserver\": \"architecto\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully deleted a nameserver for yourdomain.co.nz",
"nameserver": "ns.yourdomain.co.nz",
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Contact Details
requires authentication
Get the registrant, admin, technical and billing contact details for a domain.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GetContactDetails';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GetContactDetails"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GetContactDetails" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"registrant": [
"firstname": "Joe",
"lastname": "Soap",
"name": "Joe Soap",
"email": "joe@soap.co.nz",
"phone": "+64 91231235",
"fax": "+64 91231235",
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": 1
],
"admin": [
"firstname": "Joe",
"lastname": "Soap",
"name": "Joe Soap",
"email": "joe@soap.co.nz",
"phone": "+64 91231235",
"fax": "+64 91231235",
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": 0
],
"billing": [
"firstname": "Joe",
"lastname": "Soap",
"name": "Joe Soap",
"email": "joe@soap.co.nz",
"phone": "+64 91231235",
"fax": "+64 91231235",
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": 1
],
"tech": [
"firstname": "Joe",
"lastname": "Soap",
"name": "Joe Soap",
"email": "joe@soap.co.nz",
"phone": "+64 91231235",
"fax": "+64 91231235",
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": 0
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Set Contact Details
requires authentication
Update the registrant, admin, technical and billing contact details for a domain.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/SetContactDetails';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'contacts' => [
'registrant' => [
'email' => 'zbailey@example.net',
'phone' => 'iyvdljnikhwaykcmyuwpwlvqwrsitcpscq',
'address1' => 'architecto',
'city' => 'architecto',
'state' => 'architecto',
'postcode' => 'architecto',
'country' => 'architecto',
],
'admin' => [
'email' => 'zbailey@example.net',
'phone' => 'iyvdljnikhwaykcmyuwpwlvqwrsitcpscq',
'address1' => 'architecto',
'city' => 'architecto',
'state' => 'architecto',
'postcode' => 'architecto',
'country' => 'architecto',
],
'tech' => [
'email' => 'zbailey@example.net',
'phone' => 'iyvdljnikhwaykcmyuwpwlvqwrsitcpscq',
'address1' => 'architecto',
'city' => 'architecto',
'state' => 'architecto',
'postcode' => 'architecto',
'country' => 'architecto',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/SetContactDetails"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"contacts": {
"registrant": {
"email": "zbailey@example.net",
"phone": "iyvdljnikhwaykcmyuwpwlvqwrsitcpscq",
"address1": "architecto",
"city": "architecto",
"state": "architecto",
"postcode": "architecto",
"country": "architecto"
},
"admin": {
"email": "zbailey@example.net",
"phone": "iyvdljnikhwaykcmyuwpwlvqwrsitcpscq",
"address1": "architecto",
"city": "architecto",
"state": "architecto",
"postcode": "architecto",
"country": "architecto"
},
"tech": {
"email": "zbailey@example.net",
"phone": "iyvdljnikhwaykcmyuwpwlvqwrsitcpscq",
"address1": "architecto",
"city": "architecto",
"state": "architecto",
"postcode": "architecto",
"country": "architecto"
}
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/SetContactDetails" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"contacts\": {
\"registrant\": {
\"email\": \"zbailey@example.net\",
\"phone\": \"iyvdljnikhwaykcmyuwpwlvqwrsitcpscq\",
\"address1\": \"architecto\",
\"city\": \"architecto\",
\"state\": \"architecto\",
\"postcode\": \"architecto\",
\"country\": \"architecto\"
},
\"admin\": {
\"email\": \"zbailey@example.net\",
\"phone\": \"iyvdljnikhwaykcmyuwpwlvqwrsitcpscq\",
\"address1\": \"architecto\",
\"city\": \"architecto\",
\"state\": \"architecto\",
\"postcode\": \"architecto\",
\"country\": \"architecto\"
},
\"tech\": {
\"email\": \"zbailey@example.net\",
\"phone\": \"iyvdljnikhwaykcmyuwpwlvqwrsitcpscq\",
\"address1\": \"architecto\",
\"city\": \"architecto\",
\"state\": \"architecto\",
\"postcode\": \"architecto\",
\"country\": \"architecto\"
}
}
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully updated contact details for yourdomain.co.nz",
"contacts": [
"registrant": [
"name": "Joe Soap",
"email": "joe@soap.co.nz",
"phone": "+64 91231235",
"fax": "+64 91231235",
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": 1
],
"admin": [
"name": "Joe Soap",
"email": "joe@soap.co.nz",
"phone": "+64 91231235",
"fax": "+64 91231235",
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": 0
],
"billing": [
"name": "Joe Soap",
"email": "joe@soap.co.nz",
"phone": "+64 91231235",
"fax": "+64 91231235",
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": 1
],
"tech": [
"name": "Joe Soap",
"email": "joe@soap.co.nz",
"phone": "+64 91231235",
"fax": "+64 91231235",
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": 0
]
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Lock Status
requires authentication
Gets the transfer lock status on a domain
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GetLockStatus';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GetLockStatus"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GetLockStatus" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully queried lock status for yourdomain.co.nz.",
"lockstatus": "locked"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Set Lock Status
requires authentication
Sets the transfer lock status on a domain
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/SetLockStatus';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'registrarlock' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/SetLockStatus"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"registrarlock": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/SetLockStatus" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"registrarlock\": false
}"
Example response (200):
{
"status": "success",
"lockstatus": "unlocked",
"statusMsg": "Successfully updated lock status for yourdomain.co.nz to unlocked"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get EPP/UDAI Code
requires authentication
Get the EPP/UDAI transfer code for a domain name
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/RequestEPPCode';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/RequestEPPCode"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/RequestEPPCode" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"eppcode": "qSweS2D4"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Validate EPP/UDAI Code
requires authentication
Validate the EPP/UDAI transfer code for a domain name Works for all nz domains and any other tld's in your account
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/ValidateEPPCode';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
'authCodes' => [
'domainname.co.nz' => 'authcode',
'domainname.nz' => 'authcode',
'domainname.com' => 'authcode',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/ValidateEPPCode"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on",
"authCodes": {
"domainname.co.nz": "authcode",
"domainname.nz": "authcode",
"domainname.com": "authcode"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/ValidateEPPCode" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"authCodes\": {
\"domainname.co.nz\": \"authcode\",
\"domainname.nz\": \"authcode\",
\"domainname.com\": \"authcode\"
}
}"
Example response (200):
{
"domainname.co.nz": true,
"domainname.nz": false,
"domainname.com": "validateAuthCode is not supported for this domain"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Renew
requires authentication
Renew a domain for the given term
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/Renew';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'years' => 2,
'idProtection' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/Renew"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"years": 2,
"idProtection": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/Renew" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"years\": 2,
\"idProtection\": false
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully renewed yourdomain.co.nz for 1 year(s).",
"expiryDate": "2026-11-16 00:45:22"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Register Domain
requires authentication
Register a domain with Affordable Domains
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/Register';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'domainDetails' => [
'years' => 2,
'nameservers' => [
'ns1' => 'architecto',
'ns2' => 'architecto',
],
'contacts' => [
'registrant' => [
'email' => 'zbailey@example.net',
'phone' => 'iyvdljnikhwaykcmyuwpwlvqwrsitcpscq',
'fax' => 'ldzsnrwtujwvlxjklqppwqbewtnnoqitpx',
'address1' => 'architecto',
'city' => 'architecto',
'state' => 'architecto',
'postcode' => 'architecto',
'country' => 'architecto',
],
'admin' => [
'email' => 'zbailey@example.net',
'phone' => 'iyvdljnikhwaykcmyuwpwlvqwrsitcpscq',
'fax' => 'ldzsnrwtujwvlxjklqppwqbewtnnoqitpx',
'address1' => 'architecto',
'city' => 'architecto',
'state' => 'architecto',
'postcode' => 'architecto',
'country' => 'architecto',
],
'tech' => [
'email' => 'zbailey@example.net',
'phone' => 'iyvdljnikhwaykcmyuwpwlvqwrsitcpscq',
'fax' => 'ldzsnrwtujwvlxjklqppwqbewtnnoqitpx',
'address1' => 'architecto',
'city' => 'architecto',
'state' => 'architecto',
'postcode' => 'architecto',
'country' => 'architecto',
],
'billing' => [
'email' => 'zbailey@example.net',
'phone' => 'iyvdljnikhwaykcmyuwpwlvqwrsitcpscq',
'fax' => 'ldzsnrwtujwvlxjklqppwqbewtnnoqitpx',
],
],
'additionalFields' => [
'dns' => [
[],
],
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/Register"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"domainDetails": {
"years": 2,
"nameservers": {
"ns1": "architecto",
"ns2": "architecto"
},
"contacts": {
"registrant": {
"email": "zbailey@example.net",
"phone": "iyvdljnikhwaykcmyuwpwlvqwrsitcpscq",
"fax": "ldzsnrwtujwvlxjklqppwqbewtnnoqitpx",
"address1": "architecto",
"city": "architecto",
"state": "architecto",
"postcode": "architecto",
"country": "architecto"
},
"admin": {
"email": "zbailey@example.net",
"phone": "iyvdljnikhwaykcmyuwpwlvqwrsitcpscq",
"fax": "ldzsnrwtujwvlxjklqppwqbewtnnoqitpx",
"address1": "architecto",
"city": "architecto",
"state": "architecto",
"postcode": "architecto",
"country": "architecto"
},
"tech": {
"email": "zbailey@example.net",
"phone": "iyvdljnikhwaykcmyuwpwlvqwrsitcpscq",
"fax": "ldzsnrwtujwvlxjklqppwqbewtnnoqitpx",
"address1": "architecto",
"city": "architecto",
"state": "architecto",
"postcode": "architecto",
"country": "architecto"
},
"billing": {
"email": "zbailey@example.net",
"phone": "iyvdljnikhwaykcmyuwpwlvqwrsitcpscq",
"fax": "ldzsnrwtujwvlxjklqppwqbewtnnoqitpx"
}
},
"additionalFields": {
"dns": [
[]
]
}
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/Register" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"domainDetails\": {
\"years\": 2,
\"nameservers\": {
\"ns1\": \"architecto\",
\"ns2\": \"architecto\"
},
\"contacts\": {
\"registrant\": {
\"email\": \"zbailey@example.net\",
\"phone\": \"iyvdljnikhwaykcmyuwpwlvqwrsitcpscq\",
\"fax\": \"ldzsnrwtujwvlxjklqppwqbewtnnoqitpx\",
\"address1\": \"architecto\",
\"city\": \"architecto\",
\"state\": \"architecto\",
\"postcode\": \"architecto\",
\"country\": \"architecto\"
},
\"admin\": {
\"email\": \"zbailey@example.net\",
\"phone\": \"iyvdljnikhwaykcmyuwpwlvqwrsitcpscq\",
\"fax\": \"ldzsnrwtujwvlxjklqppwqbewtnnoqitpx\",
\"address1\": \"architecto\",
\"city\": \"architecto\",
\"state\": \"architecto\",
\"postcode\": \"architecto\",
\"country\": \"architecto\"
},
\"tech\": {
\"email\": \"zbailey@example.net\",
\"phone\": \"iyvdljnikhwaykcmyuwpwlvqwrsitcpscq\",
\"fax\": \"ldzsnrwtujwvlxjklqppwqbewtnnoqitpx\",
\"address1\": \"architecto\",
\"city\": \"architecto\",
\"state\": \"architecto\",
\"postcode\": \"architecto\",
\"country\": \"architecto\"
},
\"billing\": {
\"email\": \"zbailey@example.net\",
\"phone\": \"iyvdljnikhwaykcmyuwpwlvqwrsitcpscq\",
\"fax\": \"ldzsnrwtujwvlxjklqppwqbewtnnoqitpx\"
}
},
\"additionalFields\": {
\"dns\": [
[]
]
}
}
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully registered yourdomain.co.nz for 12 month(s).",
"whois": {
"domain":"yourdomain.co.nz",
"status":"Active",
"registerDate":"2016-09-16 00:45:22",
"expiryDate": "2026-11-16 00:45:22",
"cancelDate":"",
"renewDate":"",
"contacts":{
"registrant":{
"name":"Joe Soap",
"email":"joe@soap.co,nz",
"phone":"+64 212345678",
"fax":null,
"address1":"123 Queen Street",
"address2":"Auckland CBD",
"city":"Auckland",
"country":"NZ",
"state":"Auckland",
"postcode":"1010",
"privacy":false
},
"tech":{
"name":"Joe Soap",
"email":"joe@soap.co,nz",
"phone":"+64 212345678",
"fax":null,
"address1":"123 Queen Street",
"address2":"Auckland CBD",
"city":"Auckland",
"country":"NZ",
"state":"Auckland",
"postcode":"1010",
"privacy":false
},
"admin":{
"name":"Joe Soap",
"email":"joe@soap.co,nz",
"phone":"+64 212345678",
"fax":null,
"address1":"123 Queen Street",
"address2":"Auckland CBD",
"city":"Auckland",
"country":"NZ",
"state":"Auckland",
"postcode":"1010",
"privacy":false
},
"billing":{
"name":"Joe Soap",
"email":"joe@soap.co,nz",
"phone":"+64 212345678",
"fax":null,
"address1":"123 Queen Street",
"address2":"Auckland CBD",
"city":"Auckland",
"country":"NZ",
"state":"Auckland",
"postcode":"1010",
"privacy":false
}
},
"nameservers":{
{
"ns":"ns0.dns.com",
"ip4":"",
"ip6":""
},
{
"ns":"ns1.dns.com",
"ip4":"",
"ip6":""
},
{
"ns":"ns2.dns.com",
"ip4":"",
"ip6":""
},
{
"ns":"ns3.dns.com",
"ip4":"",
"ip6":""
}
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Transfer Domain
requires authentication
Transfer a domain from another registrar to Affordable Domains
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/Transfer';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'domainDetails' => [
'eppcode' => 'architecto',
'years' => 2,
'nameservers' => [
'ns1' => 'architecto',
'ns2' => 'architecto',
],
'contacts' => [
'registrant' => [
'email' => 'zbailey@example.net',
'phone' => 'iyvdljnikhwaykcmyuwpwlvqwrsitcpscq',
'fax' => 'ldzsnrwtujwvlxjklqppwqbewtnnoqitpx',
'address1' => 'architecto',
'city' => 'architecto',
'state' => 'architecto',
'postcode' => 'architecto',
'country' => 'architecto',
],
'admin' => [
'email' => 'zbailey@example.net',
'phone' => 'iyvdljnikhwaykcmyuwpwlvqwrsitcpscq',
'fax' => 'ldzsnrwtujwvlxjklqppwqbewtnnoqitpx',
'address1' => 'architecto',
'city' => 'architecto',
'state' => 'architecto',
'postcode' => 'architecto',
'country' => 'architecto',
],
'tech' => [
'email' => 'zbailey@example.net',
'phone' => 'iyvdljnikhwaykcmyuwpwlvqwrsitcpscq',
'fax' => 'ldzsnrwtujwvlxjklqppwqbewtnnoqitpx',
'address1' => 'architecto',
'city' => 'architecto',
'state' => 'architecto',
'postcode' => 'architecto',
'country' => 'architecto',
],
'billing' => [
'email' => 'zbailey@example.net',
'phone' => 'iyvdljnikhwaykcmyuwpwlvqwrsitcpscq',
'fax' => 'ldzsnrwtujwvlxjklqppwqbewtnnoqitpx',
],
],
'additionalFields' => [
'dns' => [
[],
],
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/Transfer"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"domainDetails": {
"eppcode": "architecto",
"years": 2,
"nameservers": {
"ns1": "architecto",
"ns2": "architecto"
},
"contacts": {
"registrant": {
"email": "zbailey@example.net",
"phone": "iyvdljnikhwaykcmyuwpwlvqwrsitcpscq",
"fax": "ldzsnrwtujwvlxjklqppwqbewtnnoqitpx",
"address1": "architecto",
"city": "architecto",
"state": "architecto",
"postcode": "architecto",
"country": "architecto"
},
"admin": {
"email": "zbailey@example.net",
"phone": "iyvdljnikhwaykcmyuwpwlvqwrsitcpscq",
"fax": "ldzsnrwtujwvlxjklqppwqbewtnnoqitpx",
"address1": "architecto",
"city": "architecto",
"state": "architecto",
"postcode": "architecto",
"country": "architecto"
},
"tech": {
"email": "zbailey@example.net",
"phone": "iyvdljnikhwaykcmyuwpwlvqwrsitcpscq",
"fax": "ldzsnrwtujwvlxjklqppwqbewtnnoqitpx",
"address1": "architecto",
"city": "architecto",
"state": "architecto",
"postcode": "architecto",
"country": "architecto"
},
"billing": {
"email": "zbailey@example.net",
"phone": "iyvdljnikhwaykcmyuwpwlvqwrsitcpscq",
"fax": "ldzsnrwtujwvlxjklqppwqbewtnnoqitpx"
}
},
"additionalFields": {
"dns": [
[]
]
}
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/Transfer" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"domainDetails\": {
\"eppcode\": \"architecto\",
\"years\": 2,
\"nameservers\": {
\"ns1\": \"architecto\",
\"ns2\": \"architecto\"
},
\"contacts\": {
\"registrant\": {
\"email\": \"zbailey@example.net\",
\"phone\": \"iyvdljnikhwaykcmyuwpwlvqwrsitcpscq\",
\"fax\": \"ldzsnrwtujwvlxjklqppwqbewtnnoqitpx\",
\"address1\": \"architecto\",
\"city\": \"architecto\",
\"state\": \"architecto\",
\"postcode\": \"architecto\",
\"country\": \"architecto\"
},
\"admin\": {
\"email\": \"zbailey@example.net\",
\"phone\": \"iyvdljnikhwaykcmyuwpwlvqwrsitcpscq\",
\"fax\": \"ldzsnrwtujwvlxjklqppwqbewtnnoqitpx\",
\"address1\": \"architecto\",
\"city\": \"architecto\",
\"state\": \"architecto\",
\"postcode\": \"architecto\",
\"country\": \"architecto\"
},
\"tech\": {
\"email\": \"zbailey@example.net\",
\"phone\": \"iyvdljnikhwaykcmyuwpwlvqwrsitcpscq\",
\"fax\": \"ldzsnrwtujwvlxjklqppwqbewtnnoqitpx\",
\"address1\": \"architecto\",
\"city\": \"architecto\",
\"state\": \"architecto\",
\"postcode\": \"architecto\",
\"country\": \"architecto\"
},
\"billing\": {
\"email\": \"zbailey@example.net\",
\"phone\": \"iyvdljnikhwaykcmyuwpwlvqwrsitcpscq\",
\"fax\": \"ldzsnrwtujwvlxjklqppwqbewtnnoqitpx\"
}
},
\"additionalFields\": {
\"dns\": [
[]
]
}
}
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully transferred yourdomain.co.nz",
"whois": {
"domain":"yourdomain.co.nz",
"status":"Active",
"registerDate":"2016-09-16 00:45:22",
"expiryDate": "2026-11-16 00:45:22",
"cancelDate":"",
"renewDate":"",
"contacts":{
"registrant":{
"name":"Joe Soap",
"email":"joe@soap.co,nz",
"phone":"+64 212345678",
"fax":null,
"address1":"123 Queen Street",
"address2":"Auckland CBD",
"city":"Auckland",
"country":"NZ",
"state":"Auckland",
"postcode":"1010",
"privacy":false
},
"tech":{
"name":"Joe Soap",
"email":"joe@soap.co,nz",
"phone":"+64 212345678",
"fax":null,
"address1":"123 Queen Street",
"address2":"Auckland CBD",
"city":"Auckland",
"country":"NZ",
"state":"Auckland",
"postcode":"1010",
"privacy":false
},
"admin":{
"name":"Joe Soap",
"email":"joe@soap.co,nz",
"phone":"+64 212345678",
"fax":null,
"address1":"123 Queen Street",
"address2":"Auckland CBD",
"city":"Auckland",
"country":"NZ",
"state":"Auckland",
"postcode":"1010",
"privacy":false
},
"billing":{
"name":"Joe Soap",
"email":"joe@soap.co,nz",
"phone":"+64 212345678",
"fax":null,
"address1":"123 Queen Street",
"address2":"Auckland CBD",
"city":"Auckland",
"country":"NZ",
"state":"Auckland",
"postcode":"1010",
"privacy":false
}
},
"nameservers":{
{
"ns":"ns0.dns.com",
"ip4":"",
"ip6":""
},
{
"ns":"ns1.dns.com",
"ip4":"",
"ip6":""
},
{
"ns":"ns2.dns.com",
"ip4":"",
"ip6":""
},
{
"ns":"ns3.dns.com",
"ip4":"",
"ip6":""
}
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Cancel
requires authentication
Cancel a domain name
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/Delete';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/Delete"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/Delete" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully deleted yourdomain.co.nz",
"domainStatus": "Pending Release",
"cancelDate": "2018-05-22 00:45:22",
"expiryDate": "2026-11-16 00:45:22"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
WHOIS
requires authentication
Get the WHOIS details for a domain name.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/Whois';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/Whois"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/Whois" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "",
"whois": {
"domainName": "yourdomain.co.nz",
"status": "Active",
"registerDate": "2016-09-16 00:45:22",
"expiryDate": "2026-11-16 00:45:22",
"nameservers": {
"ns0": {
"FQDN": "ns0.dns.com",
"IPv4": "",
"IPv6": ""
},
"ns1": {
"FQDN": "ns1.dns.com",
"IPv4": "",
"IPv6": ""
},
"ns2": {
"FQDN": "ns2.dns.com",
"IPv4": "",
"IPv6": ""
},
"ns3": {
"FQDN": "ns3.dns.com",
"IPv4": "",
"IPv6": ""
}
},
"registrant": {
"name": "Joe Soap",
"email": "joe@soap.co,nz",
"phone": "+64 212345678",
"fax": null,
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": false
},
"tech": {
"name": "Joe Soap",
"email": "joe@soap.co,nz",
"phone": "+64 212345678",
"fax": null,
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": false
},
"admin": {
"name": "Joe Soap",
"email": "joe@soap.co,nz",
"phone": "+64 212345678",
"fax": null,
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": false
},
"tld": ".co.nz"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
PublicWHOIS
requires authentication
Get the WHOIS details for a domain name.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/PublicWhois';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
'domain' => 'yourdomain.co.nz',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/PublicWhois"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on",
"domain": "yourdomain.co.nz"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/PublicWhois" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"domain\": \"yourdomain.co.nz\"
}"
Example response (200):
{
"status":"success",
"statusMsg":"",
"whois":{
"tos":"Terms of Service Text",
"domain":"yourdomain.co.nz",
"status":"200 Active",
"registerDate":"2016-09-16 00:45:22",
"expiryDate":"2026-11-16 00:45:22",
"updateDate":"2026-11-16 00:45:22",
"delegaterequested":"yes",
"dnssec":"no",
"nameservers":[
{
"name":"ns0.dns.com",
"ip4":"",
"ip6":""
},
{
"name":"ns1.dns.com",
"ip4":"",
"ip6":""
},
{
"name":"ns2.dns.com",
"ip4":"",
"ip6":""
},
{
"name":"ns3.dns.com",
"ip4":"",
"ip6":""
},
},
"registrar":{
"name":"Joe Soap",
"email":"joe@soap.co,nz",
"phone":"+64 212345678",
"fax":null,
"address1":"123 Queen Street",
"address2":"Auckland CBD",
"city":"Auckland",
"country":"NZ",
"state":"Auckland",
"postcode":"1010",
},
"registrant":{
"name":"Joe Soap",
"email":"joe@soap.co,nz",
"phone":"+64 212345678",
"fax":null,
"address1":"123 Queen Street",
"address2":"Auckland CBD",
"city":"Auckland",
"country":"NZ",
"state":"Auckland",
"postcode":"1010",
},
"tech":{
"name":"Joe Soap",
"email":"joe@soap.co,nz",
"phone":"+64 212345678",
"fax":null,
"address1":"123 Queen Street",
"address2":"Auckland CBD",
"city":"Auckland",
"country":"NZ",
"state":"Auckland",
"postcode":"1010",
},
"admin":{
"name":"Joe Soap",
"email":"joe@soap.co,nz",
"phone":"+64 212345678",
"fax":null,
"address1":"123 Queen Street",
"address2":"Auckland CBD",
"city":"Auckland",
"country":"NZ",
"state":"Auckland",
"postcode":"1010",
},
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Set DNS Record
requires authentication
Add DNS Records to a domain
Popular types include, A, TXT, MX, SOA, CNAME
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/SetDNSRecord';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'dnsrecords' => [
[],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/SetDNSRecord"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"dnsrecords": [
[]
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/SetDNSRecord" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"dnsrecords\": [
[]
]
}"
Example response (200):
{
"status":"success",
"statusMsg":"Successfully added zone A record recordname.yourdomain.co.nz for domain yourdomain.co.nz"
}
{
"status":"success",
"statusMsg":"Successfully added zone MX record mail.yourdomain.co.nz for domain yourdomain.co.nz"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Save DNS Record
requires authentication
Multi Functional API Call to Add/Edit/Delete DNS Records on a domain
Call with id = null & content set -> Create Record
Call with id set & content null -> Delete Record
Call with id set & content set -> Update Record
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/SaveDNSRecord';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'dnsrecords' => [
[],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/SaveDNSRecord"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"dnsrecords": [
[]
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/SaveDNSRecord" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"dnsrecords\": [
[]
]
}"
Example response (200):
{
"status":"success"
}
{
"status":"success",
"statusMsg":"Successfully updated zone A record recordname.yourdomain.co.nz for domain yourdomain.co.nz"
}
{
"status":"success",
"statusMsg":"Successfully deleted zone record id 111111 for domain yourdomain.co.nz"
}*
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get DNS Records List DNS records for a particular domain
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GetDNSRecords';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GetDNSRecords"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GetDNSRecords" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"dnsRecords": [
{
"name": "yourdomain.co.nz",
"type": "SOA",
"content": "SOA Record Content",
"ttl": 86400,
"prio": 0,
"id": 123456
},
{
"name": "recordname.yourdomain.co.nz",
"type": "NS",
"content": "10.0.0.1",
"ttl": 86400,
"prio": 0,
"id": 123456
},
{
"name": "mxrecordname.yourdomain.co.nz",
"type": "MX",
"content": "mail.somemailserver.com",
"ttl": 3600,
"prio": 0,
"id": 123456
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete DNS Record
requires authentication
Delete DNS Records from a domain
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/DeleteDNSRecords';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'dnsrecords' => [
[
'id' => 'architecto',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/DeleteDNSRecords"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"dnsrecords": [
{
"id": "architecto"
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/DeleteDNSRecords" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"dnsrecords\": [
{
\"id\": \"architecto\"
}
]
}"
Example response (200):
{
"status":"success",
"statusMsg":"Successfully deleted zone record id 12345 for domain yourdomain.co.nz"
}
{
"status":"success",
"statusMsg":"Successfully deleted zone record id 54321 for domain yourdomain.co.nz"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update DNS Record
requires authentication
Update DNS Record for a domain
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/UpdateDNSRecord';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'dnsrecord' => [
[
'old' => [],
'new' => [],
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/UpdateDNSRecord"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"dnsrecord": [
{
"old": [],
"new": []
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/UpdateDNSRecord" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"dnsrecord\": [
{
\"old\": [],
\"new\": []
}
]
}"
Example response (200):
{
"status":"success",
"statusMsg":"Successfully updated zone record recordname.yourdomain.co.nz for domain yourdomain.co.nz"
}
{
"status":"success",
"statusMsg":"Successfully updated zone record recordname.yourdomain.co.nz for domain yourdomain.co.nz"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Redirects Get redirects for a particular domain
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GetRedirects';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GetRedirects"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GetRedirects" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"redirects": [
{
"from": "redirect.yourdomain.co.nz",
"to": "home.otherdomain.net",
"uri": "index.html",
"permanent": 0,
"id": 123456
},
{
"from": "www.yourdomain.co.nz",
"to": "yourdomain.co.nz",
"uri": "",
"permanent": 1,
"id": 123456
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Save Redirects Multi Functional API Call to Add/Edit/Delete Redirects on a domain<br> Call with id = null & from set & to set -> Create Redirect<br> Call with id set & from null or to null -> Delete Redirect<br> Call with id set & from set & to set -> Update Redirect<br>
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/SaveRedirects';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'redirects' => [
[],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/SaveRedirects"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"redirects": [
[]
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/SaveRedirects" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"redirects\": [
[]
]
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully created redirect from redirect.yourdomain.co.nz to home.otherdomain.com for domain yourdomain.co.nz"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Check Availability
requires authentication
Check to see if a domain is available to register
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/CheckAvaliability';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/CheckAvaliability"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/CheckAvaliability" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "",
"query_status": "available"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Domain List
requires authentication
Get a list of domains with their contact details, nameservers, registration dates, expiry dates, cancel dates, and last renew dates in your account
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/DomainList';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/DomainList"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/DomainList" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully queried domain list",
"domainList": [
{
"domain": "yourdomain.co.nz",
"status": "Active",
"registerDate": "2016-09-16 00:45:22",
"expiryDate": "2026-11-16 00:45:22",
"cancelDate": "",
"renewDate": "",
"contacts": {
"registrant": {
"name": "Joe Soap",
"email": "joe@soap.co,nz",
"phone": "+64 212345678",
"fax": null,
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": false
},
"tech": {
"name": "Joe Soap",
"email": "joe@soap.co,nz",
"phone": "+64 212345678",
"fax": null,
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": false
},
"admin": {
"name": "Joe Soap",
"email": "joe@soap.co,nz",
"phone": "+64 212345678",
"fax": null,
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": false
},
"billing": {
"name": "Joe Soap",
"email": "joe@soap.co,nz",
"phone": "+64 212345678",
"fax": null,
"address1": "123 Queen Street",
"address2": "Auckland CBD",
"city": "Auckland",
"country": "NZ",
"state": "Auckland",
"postcode": "1010",
"privacy": false
}
},
"nameservers": [
{
"ns": "ns0.dns.com",
"ip4": "",
"ip6": ""
},
{
"ns": "ns1.dns.com",
"ip4": "",
"ip6": ""
},
{
"ns": "ns2.dns.com",
"ip4": "",
"ip6": ""
},
{
"ns": "ns3.dns.com",
"ip4": "",
"ip6": ""
}
]
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Privacy
requires authentication
Enable or disable privacy for a domain.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/Privacy';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'idProtection' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/Privacy"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"idProtection": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/Privacy" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"idProtection\": true
}"
Example response (200):
{
"status":"success",
"statusMsg":"Successfully enabled privacy.",
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Domain Pricing
requires authentication
Get Domain Pricing for a client.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GetDomainPricing';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GetDomainPricing"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GetDomainPricing" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully queried domain pricing for '.co.nz'.",
"currency": {
"prefix": "$",
"suffix": "NZD"
},
"pricing": [
{
"period": 1,
"register": "1.75",
"register_discount": "0.00",
"renew": "1.75",
"renew_discount": "0.00",
"transfer": "0.00",
"trnasfer_discount": null,
"restore": "0.00",
"restore_discount": "0.00",
"tldName": ".co.nz",
"privacyPrice": "4.00"
},
{
"period": 12,
"register": "21.00",
"register_discount": "0.00",
"renew": "21.00",
"renew_discount": "0.00",
"transfer": "0.00",
"trnasfer_discount": null,
"restore": "0.00",
"restore_discount": "0.00",
"tldName": ".co.nz",
"privacyPrice": "4.00"
},
{
"period": 24,
"register": "42.00",
"register_discount": "0.00",
"renew": "42.00",
"renew_discount": "0.00",
"transfer": "0.00",
"trnasfer_discount": null,
"restore": "0.00",
"restore_discount": "0.00",
"tldName": ".co.nz",
"privacyPrice": "4.00"
},
{
"period": 36,
"register": "63.00",
"register_discount": "0.00",
"renew": "63.00",
"renew_discount": "0.00",
"transfer": "0.00",
"trnasfer_discount": null,
"restore": "0.00",
"restore_discount": "0.00",
"tldName": ".co.nz",
"privacyPrice": "4.00"
},
{
"period": 48,
"register": "84.00",
"register_discount": "0.00",
"renew": "84.00",
"renew_discount": "0.00",
"transfer": "0.00",
"trnasfer_discount": null,
"restore": "0.00",
"restore_discount": "0.00",
"tldName": ".co.nz",
"privacyPrice": "4.00"
},
{
"period": 60,
"register": "105.00",
"register_discount": "0.00",
"renew": "105.00",
"renew_discount": "0.00",
"transfer": "0.00",
"trnasfer_discount": null,
"restore": "0.00",
"restore_discount": "0.00",
"tldName": ".co.nz",
"privacyPrice": "4.00"
},
{
"period": 72,
"register": "126.00",
"register_discount": "0.00",
"renew": "126.00",
"renew_discount": "0.00",
"transfer": "0.00",
"trnasfer_discount": null,
"restore": "0.00",
"restore_discount": "0.00",
"tldName": ".co.nz",
"privacyPrice": "4.00",
},
{
"period": 84,
"register": "147.00",
"register_discount": "0.00",
"renew": "147.00",
"renew_discount": "0.00",
"transfer": "0.00",
"trnasfer_discount": null,
"restore": "0.00",
"restore_discount": "0.00",
"tldName": ".co.nz",
"privacyPrice": "4.00"
},
{
"period": 96,
"register": "168.00",
"register_discount": "0.00",
"renew": "168.00",
"renew_discount": "0.00",
"transfer": "0.00",
"trnasfer_discount": null,
"restore": "0.00",
"restore_discount": "0.00",
"tldName": ".co.nz",
"privacyPrice": "4.00"
},
{
"period": 108,
"register": "189.00",
"register_discount": "0.00",
"renew": "189.00",
"renew_discount": "0.00",
"transfer": "0.00",
"trnasfer_discount": null,
"restore": "0.00",
"restore_discount": "0.00",
"tldName": ".co.nz",
"privacyPrice": "4.00"
},
{
"period": 120,
"register": "210.00",
"register_discount": "0.00",
"renew": "210.00",
"renew_discount": "0.00",
"transfer": "0.00",
"trnasfer_discount": null,
"restore": "0.00",
"restore_discount": "0.00",
"tldName": ".co.nz",
"privacyPrice": "4.00"
}
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Domain Information
requires authentication
Get Domain Information
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GetDomainInformation';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GetDomainInformation"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GetDomainInformation" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"domainInformation": {
"domain": "yourdomain.co.nz",
"nameservers": {
"ns1": "ns0.dns.com",
"ns2": "ns1.dns.com"
},
"status": {
"contactpending": 0,
"pendingsuspend": 1
},
"transferlock": 1,
"expirydate": "2020-06-01",
"addons": {
"hasidprotect": 0,
"hasdnsmanagement": 1,
"hasemailforwarding": 1
},
"tld": ".co.nz",
"irtp": {
"enabled": 1,
"endDate": "2020-06-01",
"optoutstatus": "",
"lockstatus": ""
},
"registrant": {
"name": "Affordable Domains",
"company": "Affordable Domains",
"email": "affordable@domains.co.nz"
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get TLD Pricing
requires authentication
Get TLD Pricing
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GetTldPricing';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GetTldPricing"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GetTldPricing" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
{
"tld" => ".com",
"minPeriod" => 1,
"maxPeriod" => 10,
"registrationPrice" => 25.00,
"renewalPrice" => 25.00,
"transferPrice" => 25.00,
"redemptionDays" => 40,
"redemptionFee" => 50.00,
"currencyCode" => "NZD",
"transferSecretRequired" => 0
},
{
"tld" => ".co.nz",
"minPeriod" => 1,
"maxPeriod" => 10,
"registrationPrice" => 21.00,
"renewalPrice" => 21.00,
"transferPrice" => 21.00,
"redemptionDays" => 90,
"redemptionFee" => 60.00,
"currencyCode" => "NZD",
"transferSecretRequired" => 1
},
{
"tld" => ".com.au",
"minPeriod" => 1,
"maxPeriod" => 10,
"registrationPrice" => 29.00,
"renewalPrice" => 29.00,
"transferPrice" => 29.00,
"redemptionDays" => 30,
"redemptionFee" => 80.00,
"currencyCode" => "NZD",
"transferSecretRequired" => 0
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Check Multiple Availability
requires authentication
Check availability for multiple domains
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/CheckMultipleAvailability';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
'searchTerm' => 'architecto',
'tldsToSearch' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/CheckMultipleAvailability"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on",
"searchTerm": "architecto",
"tldsToSearch": []
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/CheckMultipleAvailability" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"searchTerm\": \"architecto\",
\"tldsToSearch\": []
}"
Example response (200):
{
"status": "success",
"domains": {
"test.com": {
"sld": "test",
"tld": ".com",
"status": "Active",
"isPremiumName": 1,
"premiumRegistrationPrice": 89,
"premiumRenewPrice": 89
},
"test.co.nz": {
"sld": "test",
"tld": ".co.nz",
"status": "Active",
"isPremiumName": 0,
"premiumRegistrationPrice": 0,
"premiumRenewPrice": 0
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Resend IRTP Verification Email
requires authentication
Resend IRTP Verification Email
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/ResendIRTPVerificationEmail';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/ResendIRTPVerificationEmail"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/ResendIRTPVerificationEmail" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully sent verification email"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Domain Suggestions
requires authentication
Get Domain Suggestions
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GetDomainSuggestions';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
'searchTerm' => 'architecto',
'tldsToSearch' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GetDomainSuggestions"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on",
"searchTerm": "architecto",
"tldsToSearch": []
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GetDomainSuggestions" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"searchTerm\": \"architecto\",
\"tldsToSearch\": []
}"
Example response (200):
{
"status": "success",
"suggestions": {
"alldomainsuggestion.com": {
"status": "available",
"in_ga": "true",
"score": "1.0",
"spin": "no"
},
"publicdomainsuggestions.com": {
"status": "available",
"in_ga": "true",
"score": "0.8",
"spin": "no"
},
"topdomainsuggestions.com": {
"status": "available",
"in_ga": "true",
"score": "0.7",
"spin": "no"
},
"domainservingsuggestions.com": {
"status": "available",
"in_ga": "true",
"score": "0.64",
"spin": "no"
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/new/whmcs/MultipleDomainWhois
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/MultipleDomainWhois';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
'domains' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/MultipleDomainWhois"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on",
"domains": []
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/MultipleDomainWhois" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"domains\": []
}"
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Hosting Actions
Get Hosting
requires authentication
Get Hosting details for a domain.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GetHosting';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GetHosting"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GetHosting" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"hosting": {
"id": 1,
"period": 1,
"ip": "100.0.100.100",
"username": "username",
"disk": 1234567890,
"bandwidth": -1,
"email": 1,
"ftp": 1,
"sql": 1,
"sub_domains": -1,
"parked_domains": 0,
"addon_domains": 0,
"reseller": 0,
"cgi": 0,
"shell": 0,
"auto_ssl": 0,
"dedicated_ip": 0,
"enabled": 1,
"status": "Active",
"next_due_date": "2019-05-01",
"disable_date": null,
"first_payment": "10.00",
"recurring": 0,
"discount": 0,
"suspended_by": null,
"suspend_reason": null,
"domain": "yourdomain.co.nz",
"package": "Package Name",
"module": "cPanel",
"server": "SV",
"host_server": "host.server.co.nz"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Hosting Packages
requires authentication
Get available hosting packages.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GetHostingPackages';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GetHostingPackages"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GetHostingPackages" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"packages": [
{
"id": 1,
"name": "Starter",
"disk": 1073741824,
"bandwidth": -1,
"email": 1,
"ftp": 1,
"sql": 1,
"sub_domains": -1,
"parked_domains": 0,
"addon_domains": 0,
"reseller": 0,
"cgi": 0,
"shell": 0,
"dedicated_ip": 0,
"auto_ssl": 0,
"enabled": 1,
"dedicated_ip_price": "5.00",
"auto_ssl_price": "0.50",
"reseller_price": "0.00",
"features": {
"SSD Disk Space": "1.00 GB",
"Bandwidth": "Unlimited",
"Websites": "1 Website",
"cPanel": "Yes",
"Email Accounts": "1",
"Databases": "1",
"FTP Accounts": "1",
"Sub Domains": "Unlimited",
"Dedicated IP": "$5.00",
"Auto SSL": "$0.50",
"Server Location": "NZ",
"PHP7 Support": "Yes",
"Webmail": "Yes",
"SMTP, POP3, IMAP": "Yes",
"JetBackup": "30 Days Retention",
"Softaculous - 1 Click Installer": "Yes",
"Statistics": "Yes",
"Uptime": "99.9%",
"CPU": "1 CPU",
"Virtual Memory": "1 GB",
"I/O Allowance": "1 MB/s",
"Entry Processes": "20",
"24/7 Support": "Yes",
"Instant Setup": "Yes"
},
"billing": {
"1": {
"id": 1,
"package_id": 1,
"count_id": 1,
"period": 1,
"setup": "0.00",
"setup_discount": "0.00",
"recurring": "5.50",
"recurring_discount": "0",
"enabled": 1
},
"12": {
"id": 2,
"package_id": 1,
"count_id": 1,
"period": 12,
"setup": "0.00",
"setup_discount": "0.00",
"recurring": "60.00",
"recurring_discount": "0",
"enabled": 1
}
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Set Hosting
requires authentication
Set a hosting package on a domain.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/SetHosting';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'package_id' => 'architecto',
'enabled' => 'architecto',
'period' => 'architecto',
'hosting_username' => 'architecto',
'hosting_password' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/SetHosting"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"package_id": "architecto",
"enabled": "architecto",
"period": "architecto",
"hosting_username": "architecto",
"hosting_password": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/SetHosting" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"package_id\": \"architecto\",
\"enabled\": \"architecto\",
\"period\": \"architecto\",
\"hosting_username\": \"architecto\",
\"hosting_password\": \"architecto\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully added hosting for yourdomain.co.nz"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Set Hosting Auto SSL
requires authentication
Enable Auto SSL on a domain's hosting.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/SetHostingAutoSSL';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'enabled' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/SetHostingAutoSSL"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"enabled": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/SetHostingAutoSSL" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"enabled\": \"architecto\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully enabled Auto SSL"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Set Hosting CGI
requires authentication
Enable CGI for a domain's hosting.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/SetHostingCGI';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'domain' => 'yourdomain.co.nz',
'password' => 'yourpassword',
'testmode' => 'on',
'enabled' => 'architecto',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/SetHostingCGI"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"domain": "yourdomain.co.nz",
"password": "yourpassword",
"testmode": "on",
"enabled": "architecto"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/SetHostingCGI" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"domain\": \"yourdomain.co.nz\",
\"password\": \"yourpassword\",
\"testmode\": \"on\",
\"enabled\": \"architecto\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully enabled CGI"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Terminate Hosting
requires authentication
Terminate hosting on a domain.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/TerminateHosting';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/TerminateHosting"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/TerminateHosting" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully terminated hosting for yourdomain.co.nz"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Suspend Hosting
requires authentication
Suspend hosting on a domain.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/SuspendHosting';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/SuspendHosting"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/SuspendHosting" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully suspended hosting for yourdomain.co.nz"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Unsuspend Hosting
requires authentication
Unsuspend hosting on a domain.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/UnsuspendHosting';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/UnsuspendHosting"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/UnsuspendHosting" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully unsuspended hosting for yourdomain.co.nz"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Login to CPanel
requires authentication
Generate CPanel Login URL.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/LoginToCPanel';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/LoginToCPanel"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/LoginToCPanel" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"statusMsg": "Successfully be able to log in to CPanel with url",
"url": "https://servername/cpsess0000000000/login/?session=username%3aencrypted_password%3acreate_user_session%2cencrypted_session_value"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Generate Hosting Username
requires authentication
Generate a username for a hosting account
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GenerateHostingUsername';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GenerateHostingUsername"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GenerateHostingUsername" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Client Actions
Get Credit Balance
requires authentication
Get Credit Balance
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://www.affordabledomains.co.nz/api/new/whmcs/GetCreditBalance';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'name@example.com',
'password' => 'yourpassword',
'testmode' => 'on',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));const url = new URL(
"https://www.affordabledomains.co.nz/api/new/whmcs/GetCreditBalance"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "name@example.com",
"password": "yourpassword",
"testmode": "on"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());curl --request POST \
"https://www.affordabledomains.co.nz/api/new/whmcs/GetCreditBalance" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"name@example.com\",
\"password\": \"yourpassword\",
\"testmode\": \"on\"
}"
Example response (200):
{
"status": "success",
"creditBalance": "1000.00"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.