API Endpoint:

  • Base URL:
    https://hostmenow.org/backstage/modules/addons/DomainsReseller/api/index.php

Authentication:

  • Username:
    This is the reseller client's email address registered in your WHMCS.

  • Token:
    The token is generated using an API key and is transformed into a SHA256 hash, combined with the reseller's email address and the current time, then encoded with Base64.

    Example token generation:

    base64_encode(hash_hmac("sha256", "<api-key>", "<email>:<gmdate('y-m-d H')>"))
    

Example Request:

$endpoint   = "https://hostmenow.org/backstage/modules/addons/DomainsReseller/api/index.php";
$action     = "/order/domains/renew";
$params     = [
    "domain"    => "example.com",
    "regperiod" => "3",
    "addons"    => [
        "dnsmanagement"     => 0,
        "emailforwarding"   => 1,
        "idprotection"      => 1,
    ]
];
$headers = [
    "username: [email protected]",
    "token: ". base64_encode(hash_hmac("sha256", "1234567890QWERTYUIOPASDFGHJKLZXCVBNM", "[email protected]:".gmdate("y-m-d H")))
];

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "{$endpoint}{$action}");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($curl);
curl_close($curl);

API Calls


POST - /order/domains/register

Description: Registers a new domain.

  • Parameters:
    • domain (required, text)
    • regperiod (required, numeric)
    • domainfields (text)
    • addons (array of addons)
    • nameservers (required, array)
    • contacts (required, array)

POST - /order/domains/transfer

Description: Transfers a domain to your system.

  • Parameters:
    • domain (required, text)
    • eppcode (text)
    • regperiod (required, numeric)
    • domainfields (text)
    • addons (array)
    • nameservers (required, array)
    • contacts (required, array)

POST - /order/domains/renew

Description: Renews a domain.

  • Parameters:
    • domain (required, text)
    • regperiod (required, numeric)
    • addons (array)

POST - /domains/{domain}/release

Description: Releases a domain from your control.

  • Parameters:
    • domain (required, text)
    • transfertag (required, text)

GET - /domains/{domain}/eppcode

Description: Retrieves the EPP code for a domain.

  • Parameters:
    • domain (required, text)

GET - /domains/{domain}/contact

Description: Retrieves the contact details for a domain.

  • Parameters:
    • domain (required, text)

POST - /domains/{domain}/contact

Description: Saves the contact details for a domain.

  • Parameters:
    • domain (required, text)
    • contactdetails (required, array)

GET - /domains/{domain}/lock

Description: Retrieves the registrar lock status for a domain.

  • Parameters:
    • domain (required, text)

POST - /domains/{domain}/lock

Description: Sets the registrar lock status for a domain.

  • Parameters:
    • domain (required, text)
    • lockstatus (required, text)

GET - /domains/{domain}/dns

Description: Retrieves DNS records for a domain.

  • Parameters:
    • domain (required, text)

POST - /domains/{domain}/dns

Description: Saves DNS records for a domain.

  • Parameters:
    • domain (required, text)
    • dnsrecords (required, array)

POST - /domains/{domain}/delete

Description: Requests deletion of a domain.

  • Parameters:
    • domain (required, text)

POST - /domains/{domain}/transfersync

Description: Syncs the transfer status of a domain.

  • Parameters:
    • domain (required, text)

POST - /domains/{domain}/sync

Description: Syncs the domain status.

  • Parameters:
    • domain (required, text)

GET - /domains/{domain}/email

Description: Retrieves email forwarding information for a domain.

  • Parameters:
    • domain (required, text)

POST - /domains/{domain}/email

Description: Saves email forwarding details for a domain.

  • Parameters:
    • domain (required, text)
    • prefix (required, array)
    • forwardto (required, array)

POST - /domains/{domain}/protectid

Description: Toggles ID protection for a domain.

  • Parameters:
    • domain (required, text)
    • status (required, numeric)

POST - /domains/lookup

Description: Checks domain availability.

  • Parameters:
    • searchTerm (text)
    • punyCodeSearchTerm (text)
    • tldsToInclude (array)
    • isIdnDomain (boolean)
    • premiumEnabled (boolean)

GET - /domains/{domain}/nameservers

Description: Retrieves nameserver information for a domain.

  • Parameters:
    • domain (required, text)

POST - /domains/{domain}/nameservers

Description: Saves nameserver details for a domain.

  • Parameters:
    • domain (required, text)
    • ns1 (required, text)
    • ns2 (required, text)
    • ns3 (text)
    • ns4 (text)
    • ns5 (text)

POST - /domains/{domain}/nameservers/register

Description: Registers a nameserver for a domain.

  • Parameters:
    • domain (required, text)
    • nameserver (required, text)
    • ipaddress (required, text)

POST - /domains/{domain}/nameservers/modify

Description: Modifies a nameserver for a domain.

  • Parameters:
    • nameserver (required, text)
    • currentipaddress (required, text)
    • newipaddress (required, text)

POST - /domains/{domain}/nameservers/delete

Description: Deletes a nameserver for a domain.

  • Parameters:
    • nameserver (required, text)

GET - /order/pricing/domains/{type}

Description: Retrieves pricing for domain registration, renewal, or transfer.

  • Parameters:
    • domain (required, text)

GET - /billing/credits

Description: Retrieves account credits.


GET - /version

Description: Retrieves the current API version.


GET - /tlds

Description: Retrieves the list of available TLDs.


Models

Nameservers

  • ns1 (required, text)
  • ns2 (required, text)
  • ns3 (text)
  • ns4 (text)
  • ns5 (text)

DNS Records

  • hostname (required, text)
  • type (required, text)
  • address (required, text)
  • priority (required, numeric)
  • recid (required, text)

Contacts

  • registrant (contact)
  • tech (contact)
  • billing (contact)
  • admin (contact)

Contact Details

  • Registrant (required, contact)
  • Technical (required, contact)
  • Billing (required, contact)
  • Admin (required, contact)

Contact

  • firstname (required, text)
  • lastname (required, text)
  • fullname (required, text)
  • companyname (required, text)
  • email (required, text)
  • address1 (required, text)
  • address2 (text)
  • city (required, text)
  • state (required, text)
  • postcode (required, text) -

    country (required, text)

  • phonenumber (required, text)

Addons

  • dnsmanagement (numeric)
  • emailforwarding (numeric)
  • idprotection (numeric)

This documentation covers the domain reseller API and how to interact with it using different endpoints, including how to authenticate and handle requests such as domain registration, renewal, transfer, and various other domain management operations.

Was this answer helpful? 412 Users Found This Useful (1546 Votes)