API Documentation v1.0
DSites Domain Reseller Module API
Base Endpoint
https://my.dsites.pk/modules/addons/DomainsReseller/api/index.php
All requests should be sent to this base URL with the specific action path appended. This documentation covers the v1.0 release of the API.
Authentication
The API uses custom header-based authentication. Every request must include the following headers:
| Header | Description |
|---|---|
username |
The email address of the reseller's client registered in WHMCS. |
token |
Base64 encoded SHA256 HMAC hash. (See logic below) |
Generating the Token
The token is generated using your API Key and a timestamp formatted as y-m-d H (Greenwich Mean Time).
base64_encode(
hash_hmac("sha256", "<api-key>", "<email>:<gmdate('y-m-d H')>")
)
PHP Implementation Example
$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, "https://my.dsites.pk/modules/addons/DomainsReseller/api/index.php/order/domains/register");
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// ... rest of curl setup
Domain Operations
POST
Register Domain
/order/domains/register
| Parameter | Type | Validators |
|---|---|---|
| domain | text | requiredtext |
| regperiod | numeric | requirednumeric |
| nameservers | nameservers | required |
| contacts | contacts | required |
| addons | addons | - |
POST
Transfer Domain
/order/domains/transfer
| domain | text | required |
| eppcode | text | - |
| regperiod | numeric | required |
POST
Renew Domain
/order/domains/renew
| domain | text | required |
| regperiod | numeric | required |
Nameserver Management
Get Nameservers
GET/domains/{domain}/nameservers
Save Nameservers
POST/domains/{domain}/nameservers
| Field | Validator |
|---|---|
| ns1 / ns2 | required |
| ns3 / ns4 / ns5 | Optional |
Child Nameservers (Registration)
POST/domains/{domain}/nameservers/register
Used for creating, modifying, or deleting private nameservers (e.g., ns1.yourdomain.com).
DNS & Email
DNS Records
GET
/domains/{domain}/dnsPOST
/domains/{domain}/dnsEmail Forwarding
GET
/domains/{domain}/emailPOST
/domains/{domain}/email| prefix | array | The source email prefix |
| forwardto | array | The destination email address |
Data Models
Contact Object
Used for Registrant, Technical, Billing, and Admin details.
| Property | Validator |
|---|---|
| firstname, lastname, fullname | required |
| companyname | required |
| required | |
| address1, city, state, postcode, country | required |
| phonenumber | required |
Addons Object
| Field | Value |
|---|---|
| dnsmanagement | 0 or 1 |
| emailforwarding | 0 or 1 |
| idprotection | 0 or 1 |
Utility Endpoints
Check Availability
POST/domains/lookup
Account Credits
GET/billing/credits
System TLDs
GET/tlds
API Version
GET/version