NAV
php javascript bash

Affordable Domains

Welcome to Affordable Domains API reference.

Our sandbox environment is located at: https://sandbox.affordabledomains.co.nz. Please send all test requests to this url.

Our production environment is locted 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 required it to 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

Please note: This API has been optimised for WHMCS and therefore does not offer all the functionality our client portal does. We will be writing a full API in the near future which will allow you to use all the same functionalities as our client portal.

Domain Actions

Get Nameservers

Gets the nameservers for a domain.

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/GetNameservers" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/GetNameservers",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/GetNameservers");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"status": "success",
"nameservers": [
"ns1": "ns1.yourdomain.co.nz",
"ns2": "ns1.yourdomain.co.nz",
"ns3": "ns1.yourdomain.co.nz",
"ns4": "ns1.yourdomain.co.nz"
]
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/GetNameservers Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/GetNameservers

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional

Set Nameservers

Updates the nameservers for a domain.

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/SetNameservers" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true,"nameservers":["dolores","dolores","dolores","dolores"]}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/SetNameservers",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true,
    "nameservers": [
        "dolores",
        "dolores",
        "dolores",
        "dolores"
    ]
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
  'nameservers' => 
  array (
    0 => 'dolores',
    1 => 'dolores',
    2 => 'dolores',
    3 => 'dolores',
  ),
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/SetNameservers");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"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"
]
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/SetNameservers Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/SetNameservers

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional
nameservers.0 string required
nameservers.1 string required
nameservers.2 string optional
nameservers.3 string optional

Register a Child Nameserver

Set a child nameserver for a domain.

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/RegisterNameserver" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true,"nameserver":"id","ipaddress":"id"}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/RegisterNameserver",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true,
    "nameserver": "id",
    "ipaddress": "id"
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
  'nameserver' => 'id',
  'ipaddress' => 'id',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/RegisterNameserver");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"status": "success",
"statusMsg" : "Successfully set a nameserver for yourdomain.co.nz.",
"nameserver": "ns.yourdomain.co.nz",
"ip": "",
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/RegisterNameserver Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/RegisterNameserver

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional
nameserver string required
ipaddress string required

Modify a Child Nameserver

Modifies the IP of a child nameserver.

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/ModifyNameserver" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true,"nameserver":"illo","newip":"illo"}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/ModifyNameserver",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true,
    "nameserver": "illo",
    "newip": "illo"
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
  'nameserver' => 'illo',
  'newip' => 'illo',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/ModifyNameserver");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"status": "success",
"statusMsg": "Successfully updated ip address of a nameserver for yourdomain.co.nz",
"nameserver": "ns.yourdomain.co.nz",
"newip": "",
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/ModifyNameserver Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/ModifyNameserver

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional
nameserver string required
newip string required

Delete a Child Nameserver

Delete a child nameserver for a domain.

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/DeleteNameserver" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true,"nameserver":"numquam"}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/DeleteNameserver",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true,
    "nameserver": "numquam"
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
  'nameserver' => 'numquam',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/DeleteNameserver");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"status": "success",
"statusMsg": "Successfully deleted a nameserver for yourdomain.co.nz",
"nameserver": "ns.yourdomain.co.nz",
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/DeleteNameserver Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/DeleteNameserver

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional
nameserver string required

Get Contact Details

Get the registrant, admin, technical and billing contact details for a domain.

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/GetContactDetails" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/GetContactDetails",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/GetContactDetails");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"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
]
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/GetContactDetails Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/GetContactDetails

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional

Set Contact Details

Update the registrant, admin, technical and billing contact details for a domain.

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/SetContactDetails" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true,"contacts":{"registrant":{"name":"unde","firstname":"unde","lastname":"unde","email":"harley48@example.com","phone":"unde","fax":"unde","address1":"unde","address2":"unde","city":"unde","state":"unde","postcode":"unde","country":"unde"},"admin":{"name":"unde","firstname":"unde","lastname":"unde","email":"harley48@example.com","phone":"unde","fax":"unde","address1":"unde","address2":"unde","city":"unde","state":"unde","postcode":"unde","country":"unde"},"tech":{"name":"unde","firstname":"unde","lastname":"unde","email":"harley48@example.com","phone":"unde","fax":"unde","address1":"unde","address2":"unde","city":"unde","state":"unde","postcode":"unde","country":"unde"}}}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/SetContactDetails",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true,
    "contacts": {
        "registrant": {
            "name": "unde",
            "firstname": "unde",
            "lastname": "unde",
            "email": "harley48@example.com",
            "phone": "unde",
            "fax": "unde",
            "address1": "unde",
            "address2": "unde",
            "city": "unde",
            "state": "unde",
            "postcode": "unde",
            "country": "unde"
        },
        "admin": {
            "name": "unde",
            "firstname": "unde",
            "lastname": "unde",
            "email": "harley48@example.com",
            "phone": "unde",
            "fax": "unde",
            "address1": "unde",
            "address2": "unde",
            "city": "unde",
            "state": "unde",
            "postcode": "unde",
            "country": "unde"
        },
        "tech": {
            "name": "unde",
            "firstname": "unde",
            "lastname": "unde",
            "email": "harley48@example.com",
            "phone": "unde",
            "fax": "unde",
            "address1": "unde",
            "address2": "unde",
            "city": "unde",
            "state": "unde",
            "postcode": "unde",
            "country": "unde"
        }
    }
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
  'contacts' => 
  array (
    'registrant' => 
    array (
      'name' => 'unde',
      'firstname' => 'unde',
      'lastname' => 'unde',
      'email' => 'harley48@example.com',
      'phone' => 'unde',
      'fax' => 'unde',
      'address1' => 'unde',
      'address2' => 'unde',
      'city' => 'unde',
      'state' => 'unde',
      'postcode' => 'unde',
      'country' => 'unde',
    ),
    'admin' => 
    array (
      'name' => 'unde',
      'firstname' => 'unde',
      'lastname' => 'unde',
      'email' => 'harley48@example.com',
      'phone' => 'unde',
      'fax' => 'unde',
      'address1' => 'unde',
      'address2' => 'unde',
      'city' => 'unde',
      'state' => 'unde',
      'postcode' => 'unde',
      'country' => 'unde',
    ),
    'tech' => 
    array (
      'name' => 'unde',
      'firstname' => 'unde',
      'lastname' => 'unde',
      'email' => 'harley48@example.com',
      'phone' => 'unde',
      'fax' => 'unde',
      'address1' => 'unde',
      'address2' => 'unde',
      'city' => 'unde',
      'state' => 'unde',
      'postcode' => 'unde',
      'country' => 'unde',
    ),
  ),
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/SetContactDetails");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"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
]
]
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/SetContactDetails Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/SetContactDetails

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional
contacts.registrant.name string optional Required if the parameters contacts.registrant.firstname or contacts.registrant.lastname are not present.
contacts.registrant.firstname string optional Required if the parameters contacts.registrant.name are not present.
contacts.registrant.lastname string optional
contacts.registrant.email email required
contacts.registrant.phone string required Minimum: 7
contacts.registrant.fax string optional
contacts.registrant.address1 string required
contacts.registrant.address2 string optional
contacts.registrant.city string required
contacts.registrant.state string optional
contacts.registrant.postcode string required
contacts.registrant.country string required
contacts.admin.name string optional Required if the parameters contacts.admin.firstname or contacts.admin.lastname are not present.
contacts.admin.firstname string optional Required if the parameters contacts.admin.name are not present.
contacts.admin.lastname string optional
contacts.admin.email email required
contacts.admin.phone string required Minimum: 7
contacts.admin.fax string optional
contacts.admin.address1 string required
contacts.admin.address2 string optional
contacts.admin.city string required
contacts.admin.state string optional
contacts.admin.postcode string required
contacts.admin.country string required
contacts.tech.name string optional Required if the parameters contacts.tech.firstname or contacts.tech.lastname are not present.
contacts.tech.firstname string optional Required if the parameters contacts.tech.name are not present.
contacts.tech.lastname string optional
contacts.tech.email email required
contacts.tech.phone string required Minimum: 7
contacts.tech.fax string optional
contacts.tech.address1 string required
contacts.tech.address2 string optional
contacts.tech.city string required
contacts.tech.state string optional
contacts.tech.postcode string required
contacts.tech.country string required

Get Lock Status

Gets the transfer lock status on a domain

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/GetLockStatus" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/GetLockStatus",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/GetLockStatus");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"status": "success",
"statusMsg": "Successfully queried lock status for yourdomain.co.nz.",
"lockstatus": "locked"
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/GetLockStatus Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/GetLockStatus

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional

Set Lock Status

Sets the transfer lock status on a domain

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/SetLockStatus" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true,"registrarlock":true}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/SetLockStatus",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true,
    "registrarlock": true
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
  'registrarlock' => true,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/SetLockStatus");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"status": "success",
"lockstatus": "unlocked",
"statusMsg": "Successfully updated lock status for yourdomain.co.nz to unlocked"
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/SetLockStatus Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/SetLockStatus

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional
registrarlock boolean required

Get EPP/UDAI Code

Get the EPP/UDAI transfer code for a domain name

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/RequestEPPCode" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/RequestEPPCode",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/RequestEPPCode");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"status": "success",
"eppcode": "qSweS2D4"
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/RequestEPPCode Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/RequestEPPCode

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional

Validate EPP/UDAI Code

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:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/ValidateEPPCode" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"username":"name@example.com","password":"yourpassword","testmode":true,"authCodes":{"domainname.co.nz":"authcode","domainname.nz":"authcode","domainname.com":"authcode"}}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/ValidateEPPCode",
"method": "POST",
"data": {
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true,
    "authCodes": {
        "domainname.co.nz": "authcode",
        "domainname.nz": "authcode",
        "domainname.com": "authcode"
    }
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
  'authCodes' => 
  array (
    'domainname.co.nz' => 'authcode',
    'domainname.nz' => 'authcode',
    'domainname.com' => 'authcode',
  ),
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/ValidateEPPCode");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"domainname.co.nz": true,
"domainname.nz": false,
"domainname.com": "validateAuthCode is not supported for this domain"
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/ValidateEPPCode Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/ValidateEPPCode

Parameters

Parameter Type Status Description
username string required
password string required
testmode string optional
authCodes array required

Renew

Renew a domain for the given term

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/Renew" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true,"years":2,"idProtection":true}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/Renew",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true,
    "years": 2,
    "idProtection": true
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
  'years' => 2,
  'idProtection' => true,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/Renew");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"status": "success",
"statusMsg": "Successfully renewed yourdomain.co.nz for 1 year(s).",
"expiryDate": "2026-11-16 00:45:22"
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/Renew Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/Renew

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional
years integer required Minimum: 1 Maximum: 10
idProtection boolean optional

Register Domain

Register a domain with Affordable Domains

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/Register" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true,"domainDetails":{"years":7,"nameservers":{"ns1":"quidem","ns2":"quidem","ns3":"quidem","ns4":"quidem","ns5":"quidem"},"contacts":{"registrant":{"name":"quidem","firstname":"quidem","lastname":"quidem","email":"isobel45@example.net","phone":"quidem","fax":"quidem","address1":"quidem","address2":"quidem","city":"quidem","state":"quidem","postcode":"quidem","country":"quidem"},"admin":{"name":"quidem","firstname":"quidem","lastname":"quidem","email":"isobel45@example.net","phone":"quidem","fax":"quidem","address1":"quidem","address2":"quidem","city":"quidem","state":"quidem","postcode":"quidem","country":"quidem"},"tech":{"name":"quidem","firstname":"quidem","lastname":"quidem","email":"isobel45@example.net","phone":"quidem","fax":"quidem","address1":"quidem","address2":"quidem","city":"quidem","state":"quidem","postcode":"quidem","country":"quidem"},"billing":{"name":"quidem","firstname":"quidem","lastname":"quidem","email":"isobel45@example.net","phone":"quidem","fax":"quidem","address1":"quidem","address2":"quidem","city":"quidem","state":"quidem","postcode":"quidem","country":"quidem"}},"idProtection":true,"additionalFields":[]}}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/Register",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true,
    "domainDetails": {
        "years": 7,
        "nameservers": {
            "ns1": "quidem",
            "ns2": "quidem",
            "ns3": "quidem",
            "ns4": "quidem",
            "ns5": "quidem"
        },
        "contacts": {
            "registrant": {
                "name": "quidem",
                "firstname": "quidem",
                "lastname": "quidem",
                "email": "isobel45@example.net",
                "phone": "quidem",
                "fax": "quidem",
                "address1": "quidem",
                "address2": "quidem",
                "city": "quidem",
                "state": "quidem",
                "postcode": "quidem",
                "country": "quidem"
            },
            "admin": {
                "name": "quidem",
                "firstname": "quidem",
                "lastname": "quidem",
                "email": "isobel45@example.net",
                "phone": "quidem",
                "fax": "quidem",
                "address1": "quidem",
                "address2": "quidem",
                "city": "quidem",
                "state": "quidem",
                "postcode": "quidem",
                "country": "quidem"
            },
            "tech": {
                "name": "quidem",
                "firstname": "quidem",
                "lastname": "quidem",
                "email": "isobel45@example.net",
                "phone": "quidem",
                "fax": "quidem",
                "address1": "quidem",
                "address2": "quidem",
                "city": "quidem",
                "state": "quidem",
                "postcode": "quidem",
                "country": "quidem"
            },
            "billing": {
                "name": "quidem",
                "firstname": "quidem",
                "lastname": "quidem",
                "email": "isobel45@example.net",
                "phone": "quidem",
                "fax": "quidem",
                "address1": "quidem",
                "address2": "quidem",
                "city": "quidem",
                "state": "quidem",
                "postcode": "quidem",
                "country": "quidem"
            }
        },
        "idProtection": true,
        "additionalFields": []
    }
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
  'domainDetails' => 
  array (
    'years' => 7,
    'nameservers' => 
    array (
      'ns1' => 'quidem',
      'ns2' => 'quidem',
      'ns3' => 'quidem',
      'ns4' => 'quidem',
      'ns5' => 'quidem',
    ),
    'contacts' => 
    array (
      'registrant' => 
      array (
        'name' => 'quidem',
        'firstname' => 'quidem',
        'lastname' => 'quidem',
        'email' => 'isobel45@example.net',
        'phone' => 'quidem',
        'fax' => 'quidem',
        'address1' => 'quidem',
        'address2' => 'quidem',
        'city' => 'quidem',
        'state' => 'quidem',
        'postcode' => 'quidem',
        'country' => 'quidem',
      ),
      'admin' => 
      array (
        'name' => 'quidem',
        'firstname' => 'quidem',
        'lastname' => 'quidem',
        'email' => 'isobel45@example.net',
        'phone' => 'quidem',
        'fax' => 'quidem',
        'address1' => 'quidem',
        'address2' => 'quidem',
        'city' => 'quidem',
        'state' => 'quidem',
        'postcode' => 'quidem',
        'country' => 'quidem',
      ),
      'tech' => 
      array (
        'name' => 'quidem',
        'firstname' => 'quidem',
        'lastname' => 'quidem',
        'email' => 'isobel45@example.net',
        'phone' => 'quidem',
        'fax' => 'quidem',
        'address1' => 'quidem',
        'address2' => 'quidem',
        'city' => 'quidem',
        'state' => 'quidem',
        'postcode' => 'quidem',
        'country' => 'quidem',
      ),
      'billing' => 
      array (
        'name' => 'quidem',
        'firstname' => 'quidem',
        'lastname' => 'quidem',
        'email' => 'isobel45@example.net',
        'phone' => 'quidem',
        'fax' => 'quidem',
        'address1' => 'quidem',
        'address2' => 'quidem',
        'city' => 'quidem',
        'state' => 'quidem',
        'postcode' => 'quidem',
        'country' => 'quidem',
      ),
    ),
    'idProtection' => true,
    'additionalFields' => 
    array (
    ),
  ),
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/Register");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"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":""
}
}
}
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/Register Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/Register

Parameters

Parameter Type Status Description
domain string required
username string required
password string required
testmode string optional
domainDetails.years integer required Minimum: 1 Maximum: 10
domainDetails.nameservers.ns1 string required
domainDetails.nameservers.ns2 string required
domainDetails.nameservers.ns3 string optional
domainDetails.nameservers.ns4 string optional
domainDetails.nameservers.ns5 string optional
domainDetails.contacts.registrant.name string optional Required if the parameters domainDetails.contacts.registrant.firstname or domainDetails.contacts.registrant.lastname are not present.
domainDetails.contacts.registrant.firstname string optional Required if the parameters domainDetails.contacts.registrant.name are not present.
domainDetails.contacts.registrant.lastname string optional
domainDetails.contacts.registrant.email email required
domainDetails.contacts.registrant.phone string required Minimum: 7
domainDetails.contacts.registrant.fax string optional Minimum: 7
domainDetails.contacts.registrant.address1 string required
domainDetails.contacts.registrant.address2 string optional
domainDetails.contacts.registrant.city string required
domainDetails.contacts.registrant.state string optional
domainDetails.contacts.registrant.postcode string required
domainDetails.contacts.registrant.country string required
domainDetails.contacts.admin.name string optional Required if the parameters domainDetails.contacts.admin.firstname or domainDetails.contacts.admin.lastname are not present.
domainDetails.contacts.admin.firstname string optional Required if the parameters domainDetails.contacts.admin.name are not present.
domainDetails.contacts.admin.lastname string optional
domainDetails.contacts.admin.email email required
domainDetails.contacts.admin.phone string required Minimum: 7
domainDetails.contacts.admin.fax string optional Minimum: 7
domainDetails.contacts.admin.address1 string required
domainDetails.contacts.admin.address2 string optional
domainDetails.contacts.admin.city string required
domainDetails.contacts.admin.state string optional
domainDetails.contacts.admin.postcode string required
domainDetails.contacts.admin.country string required
domainDetails.contacts.tech.name string optional Required if the parameters domainDetails.contacts.tech.firstname or domainDetails.contacts.tech.lastname are not present.
domainDetails.contacts.tech.firstname string optional Required if the parameters domainDetails.contacts.tech.name are not present.
domainDetails.contacts.tech.lastname string optional
domainDetails.contacts.tech.email email required
domainDetails.contacts.tech.phone string required Minimum: 7
domainDetails.contacts.tech.fax string optional Minimum: 7
domainDetails.contacts.tech.address1 string required
domainDetails.contacts.tech.address2 string optional
domainDetails.contacts.tech.city string required
domainDetails.contacts.tech.state string optional
domainDetails.contacts.tech.postcode string required
domainDetails.contacts.tech.country string required
domainDetails.contacts.billing.name string optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.contacts.billing.firstname string optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.contacts.billing.lastname string optional
domainDetails.contacts.billing.email email optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.contacts.billing.phone string optional Required if the parameters domainDetails.contacts.billing are present. Minimum: 7
domainDetails.contacts.billing.fax string optional Minimum: 7
domainDetails.contacts.billing.address1 string optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.contacts.billing.address2 string optional
domainDetails.contacts.billing.city string optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.contacts.billing.state string optional
domainDetails.contacts.billing.postcode string optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.contacts.billing.country string optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.idProtection boolean optional
domainDetails.additionalFields array optional

Transfer Domain

Transfer a domain from another registrar to Affordable Domains

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/Transfer" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true,"domainDetails":{"eppcode":"cum","years":7,"nameservers":{"ns1":"cum","ns2":"cum","ns3":"cum","ns4":"cum","ns5":"cum"},"contacts":{"registrant":{"name":"cum","firstname":"cum","lastname":"cum","email":"brett12@example.net","phone":"cum","fax":"cum","address1":"cum","address2":"cum","city":"cum","state":"cum","postcode":"cum","country":"cum"},"admin":{"name":"cum","firstname":"cum","lastname":"cum","email":"brett12@example.net","phone":"cum","fax":"cum","address1":"cum","address2":"cum","city":"cum","state":"cum","postcode":"cum","country":"cum"},"tech":{"name":"cum","firstname":"cum","lastname":"cum","email":"brett12@example.net","phone":"cum","fax":"cum","address1":"cum","address2":"cum","city":"cum","state":"cum","postcode":"cum","country":"cum"},"billing":{"name":"cum","firstname":"cum","lastname":"cum","email":"brett12@example.net","phone":"cum","fax":"cum","address1":"cum","address2":"cum","city":"cum","state":"cum","postcode":"cum","country":"cum"}}}}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/Transfer",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true,
    "domainDetails": {
        "eppcode": "cum",
        "years": 7,
        "nameservers": {
            "ns1": "cum",
            "ns2": "cum",
            "ns3": "cum",
            "ns4": "cum",
            "ns5": "cum"
        },
        "contacts": {
            "registrant": {
                "name": "cum",
                "firstname": "cum",
                "lastname": "cum",
                "email": "brett12@example.net",
                "phone": "cum",
                "fax": "cum",
                "address1": "cum",
                "address2": "cum",
                "city": "cum",
                "state": "cum",
                "postcode": "cum",
                "country": "cum"
            },
            "admin": {
                "name": "cum",
                "firstname": "cum",
                "lastname": "cum",
                "email": "brett12@example.net",
                "phone": "cum",
                "fax": "cum",
                "address1": "cum",
                "address2": "cum",
                "city": "cum",
                "state": "cum",
                "postcode": "cum",
                "country": "cum"
            },
            "tech": {
                "name": "cum",
                "firstname": "cum",
                "lastname": "cum",
                "email": "brett12@example.net",
                "phone": "cum",
                "fax": "cum",
                "address1": "cum",
                "address2": "cum",
                "city": "cum",
                "state": "cum",
                "postcode": "cum",
                "country": "cum"
            },
            "billing": {
                "name": "cum",
                "firstname": "cum",
                "lastname": "cum",
                "email": "brett12@example.net",
                "phone": "cum",
                "fax": "cum",
                "address1": "cum",
                "address2": "cum",
                "city": "cum",
                "state": "cum",
                "postcode": "cum",
                "country": "cum"
            }
        }
    }
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
  'domainDetails' => 
  array (
    'eppcode' => 'cum',
    'years' => 7,
    'nameservers' => 
    array (
      'ns1' => 'cum',
      'ns2' => 'cum',
      'ns3' => 'cum',
      'ns4' => 'cum',
      'ns5' => 'cum',
    ),
    'contacts' => 
    array (
      'registrant' => 
      array (
        'name' => 'cum',
        'firstname' => 'cum',
        'lastname' => 'cum',
        'email' => 'brett12@example.net',
        'phone' => 'cum',
        'fax' => 'cum',
        'address1' => 'cum',
        'address2' => 'cum',
        'city' => 'cum',
        'state' => 'cum',
        'postcode' => 'cum',
        'country' => 'cum',
      ),
      'admin' => 
      array (
        'name' => 'cum',
        'firstname' => 'cum',
        'lastname' => 'cum',
        'email' => 'brett12@example.net',
        'phone' => 'cum',
        'fax' => 'cum',
        'address1' => 'cum',
        'address2' => 'cum',
        'city' => 'cum',
        'state' => 'cum',
        'postcode' => 'cum',
        'country' => 'cum',
      ),
      'tech' => 
      array (
        'name' => 'cum',
        'firstname' => 'cum',
        'lastname' => 'cum',
        'email' => 'brett12@example.net',
        'phone' => 'cum',
        'fax' => 'cum',
        'address1' => 'cum',
        'address2' => 'cum',
        'city' => 'cum',
        'state' => 'cum',
        'postcode' => 'cum',
        'country' => 'cum',
      ),
      'billing' => 
      array (
        'name' => 'cum',
        'firstname' => 'cum',
        'lastname' => 'cum',
        'email' => 'brett12@example.net',
        'phone' => 'cum',
        'fax' => 'cum',
        'address1' => 'cum',
        'address2' => 'cum',
        'city' => 'cum',
        'state' => 'cum',
        'postcode' => 'cum',
        'country' => 'cum',
      ),
    ),
  ),
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/Transfer");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"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":""
}
}
}
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/Transfer Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/Transfer

Parameters

Parameter Type Status Description
domain string required
username string required
password string required
testmode string optional
domainDetails.eppcode string required
domainDetails.years integer required Minimum: 1 Maximum: 10
domainDetails.nameservers.ns1 string required
domainDetails.nameservers.ns2 string required
domainDetails.nameservers.ns3 string optional
domainDetails.nameservers.ns4 string optional
domainDetails.nameservers.ns5 string optional
domainDetails.contacts.registrant.name string optional Required if the parameters domainDetails.contacts.registrant.firstname or domainDetails.contacts.registrant.lastname are not present.
domainDetails.contacts.registrant.firstname string optional Required if the parameters domainDetails.contacts.registrant.name are not present.
domainDetails.contacts.registrant.lastname string optional
domainDetails.contacts.registrant.email email required
domainDetails.contacts.registrant.phone string required Minimum: 7
domainDetails.contacts.registrant.fax string optional Minimum: 7
domainDetails.contacts.registrant.address1 string required
domainDetails.contacts.registrant.address2 string optional
domainDetails.contacts.registrant.city string required
domainDetails.contacts.registrant.state string optional
domainDetails.contacts.registrant.postcode string required
domainDetails.contacts.registrant.country string required
domainDetails.contacts.admin.name string optional Required if the parameters domainDetails.contacts.admin.firstname or domainDetails.contacts.admin.lastname are not present.
domainDetails.contacts.admin.firstname string optional Required if the parameters domainDetails.contacts.admin.name are not present.
domainDetails.contacts.admin.lastname string optional
domainDetails.contacts.admin.email email required
domainDetails.contacts.admin.phone string required Minimum: 7
domainDetails.contacts.admin.fax string optional Minimum: 7
domainDetails.contacts.admin.address1 string required
domainDetails.contacts.admin.address2 string optional
domainDetails.contacts.admin.city string required
domainDetails.contacts.admin.state string optional
domainDetails.contacts.admin.postcode string required
domainDetails.contacts.admin.country string required
domainDetails.contacts.tech.name string optional Required if the parameters domainDetails.contacts.tech.firstname or domainDetails.contacts.tech.lastname are not present.
domainDetails.contacts.tech.firstname string optional Required if the parameters domainDetails.contacts.tech.name are not present.
domainDetails.contacts.tech.lastname string optional
domainDetails.contacts.tech.email email required
domainDetails.contacts.tech.phone string required Minimum: 7
domainDetails.contacts.tech.fax string optional Minimum: 7
domainDetails.contacts.tech.address1 string required
domainDetails.contacts.tech.address2 string optional
domainDetails.contacts.tech.city string required
domainDetails.contacts.tech.state string optional
domainDetails.contacts.tech.postcode string required
domainDetails.contacts.tech.country string required
domainDetails.contacts.billing.name string optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.contacts.billing.firstname string optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.contacts.billing.lastname string optional
domainDetails.contacts.billing.email email optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.contacts.billing.phone string optional Required if the parameters domainDetails.contacts.billing are present. Minimum: 7
domainDetails.contacts.billing.fax string optional Minimum: 7
domainDetails.contacts.billing.address1 string optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.contacts.billing.address2 string optional
domainDetails.contacts.billing.city string optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.contacts.billing.state string optional
domainDetails.contacts.billing.postcode string optional Required if the parameters domainDetails.contacts.billing are present.
domainDetails.contacts.billing.country string optional Required if the parameters domainDetails.contacts.billing are present.

Cancel

Cancel a domain name

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/Delete" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/Delete",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/Delete");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"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"
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/Delete Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/Delete

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional

WHOIS

Get the WHOIS details for a domain name.

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/Whois" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/Whois",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/Whois");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"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"
}
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/Whois Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/Whois

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional

PublicWHOIS

Get the WHOIS details for a domain name.

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/PublicWhois" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"username":"name@example.com","password":"yourpassword","testmode":true,"domain":"yourdomain.co.nz"}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/PublicWhois",
"method": "POST",
"data": {
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true,
    "domain": "yourdomain.co.nz"
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
  'domain' => 'yourdomain.co.nz',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/PublicWhois");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"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",
},
}
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/PublicWhois Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/PublicWhois

Parameters

Parameter Type Status Description
username string required
password string required
testmode string optional
domain string required

Check Availability

Check to see if a domain is available to register

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/CheckAvaliability" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/CheckAvaliability",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/CheckAvaliability");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"status": "success",
"statusMsg": "",
"query_status": "available"
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/CheckAvaliability Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/CheckAvaliability

Parameters

Parameter Type Status Description
domain string required
username string required
password string required
testmode string optional

Domain List

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:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/DomainList" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"username":"name@example.com","password":"yourpassword","testmode":true}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/DomainList",
"method": "POST",
"data": {
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/DomainList");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"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":""
}
]
}]
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/DomainList Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/DomainList

Parameters

Parameter Type Status Description
username string required
password string required
testmode string optional

Privacy

Enable or disable privacy for a domain.

Example request:

curl -X POST "https://www.affordabledomains.co.nz/api/new/whmcs/Privacy" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"domain":"yourdomain.co.nz","username":"name@example.com","password":"yourpassword","testmode":true,"idProtection":true}' \
var settings = {
"async": true,
"crossDomain": true,
"url": "https://www.affordabledomains.co.nz/api/new/whmcs/Privacy",
"method": "POST",
"data": {
    "domain": "yourdomain.co.nz",
    "username": "name@example.com",
    "password": "yourpassword",
    "testmode": true,
    "idProtection": true
},
"headers": {
"accept": "application/json"
}
}

$.ajax(settings).done(function (response) {
console.log(response);
});
$postfields = array (
  'domain' => 'yourdomain.co.nz',
  'username' => 'name@example.com',
  'password' => 'yourpassword',
  'testmode' => true,
  'idProtection' => true,
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.affordabledomains.co.nz/api/new/whmcs/Privacy");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$response = curl_exec($ch);
curl_close($ch);

Example response:

{
"status":"success",
"statusMsg":"Successfully enabled privacy.",
}

HTTP Request

Sandbox - POST https://sandbox.affordabledomains.co.nz/api/new/whmcs/Privacy Production - POST https://www.affordabledomains.co.nz/api/new/whmcs/Privacy

Parameters

Parameter Type Status Description
domain string required Valid domain
username string required
password string required
testmode string optional
idProtection boolean required