API Documentation
Complete documentation for the DSites Domain Reseller Module API. All requests should be sent to the base URL with the specific action path appended.
https://my.dsites.pk/modules/addons/DomainsReseller/api/index.php
Authentication
username
The email address of the reseller's client registered in WHMCS.
token
Base64 encoded SHA256 HMAC hash using API Key, Email, and GMT Date.
Token Logic
base64_encode(
hash_hmac(
"sha256",
"<api-key>",
"<email>:<gmdate('y-m-d H')>"
)
)
Implementation Example
$endpoint = "https://my.dsites.pk/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@example.com",
"token: ". base64_encode(hash_hmac("sha256", "YOUR_API_KEY", "email@example.com:".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);
Domain Registration & Transfer
Register Domain
/order/domains/register
| Field | Type | Validators |
|---|---|---|
| domain | text | required, text |
| regperiod | numeric | required, numeric |
| domainfields | text | text |
| nameservers | nameservers | required |
| contacts | contacts | required |
| addons | addons | - |
Transfer Domain
/order/domains/transfer
| Field | Type | Validators |
|---|---|---|
| domain | text | required, text |
| eppcode | text | text |
| regperiod | numeric | required, numeric |
| domainfields | text | text |
| nameservers | nameservers | required |
| contacts | contacts | required |
Renew, Sync & Maintenance
/order/domains/renew
Renew Domain
- domain required
- regperiod required
- addons optional
/domains/{domain}/sync
Domain Sync
Synchronizes domain status and expiry from registrar.
Parameters: domain (required)
/domains/{domain}/transfersync
Transfer Sync
Synchronizes incoming domain transfer status.
/domains/{domain}/delete
Request Deletion
Submit a request to delete a domain registration.
Nameserver Management
Get Nameservers
/domains/{domain}/nameservers
Save Nameservers
Required fields: ns1, ns2. Optional: ns3, ns4, ns5.
Register
Fields
- nameserver *
- ipaddress *
Modify
Fields
- nameserver *
- currentipaddress *
- newipaddress *
Delete
Fields
- nameserver *
Contacts & Registrar Lock
Contact Management
/domains/{domain}/contact
Save Parameters
Registrar Lock
/domains/{domain}/contact
Lock Status Field
DNS & Email Forwarding
/domains/{domain}/dns
Parameter
dnsrecords (required)
/domains/{domain}/email
Save POST Fields
EPP Code & Release
Get EPP Code
/domains/{domain}/eppcode
Release Domain
GET/domains/{domain}/release
transfertag (required)
Full Data Models
Utility & Information
Domain Lookup (Availability)
POST/domains/lookup
Get Credits
GET /billing/credits
Get Version
GET /version
Available TLDs
GET /tlds