Backward-Compatible API

Public Domain API documentation for resellers

This API keeps the original action-based contract in place so existing reseller integrations can continue working while the backend runs on Laravel. Requests can be sent as JSON or regular form posts, and the same API key can be passed in the header or body.

Single endpoint: /api
Auth: X-API-KEY or api_key
Methods: GET and POST

Contents

Use these links to jump to the exact part your developers need.

Quick start Authentication Request format Supported actions cURL examples Responses and errors

Quick start

Every request hits one public endpoint. The action you want to run is sent inside the request body or query string.

Base Endpoint
https://www.staging.reseller.co.tz/api
Accepted Methods
GET POST
Body Type
JSON body or normal form fields
Response Type
JSON object with status, message, and data
{
  "action": "getBalance"
}

Authentication

The reseller API key is required on every request. For backward compatibility, the key can be passed using the same old patterns.

  • HTTP header: X-API-KEY: your_api_key
  • Request field: api_key: your_api_key

Request format

The API uses one route and switches behavior based on the action field. Older clients do not need separate REST endpoints.

{
  "action": "checkDomain",
  "domainName": "example.co.tz"
}
  • action tells the API which operation to run.
  • domainName should be the full domain, for example example.co.tz.
  • Use arrays for fields like nameservers.
  • Use nested objects for contact updates like registrantInfo and adminInfo.

Supported actions

These actions are currently supported by the Laravel compatibility layer.

Account getBalance

Returns the reseller account balance and currency.

{
  "action": "getBalance"
}
Domain checkDomain

Checks if a domain is available and returns the current registration price when available in pricing data.

{
  "action": "checkDomain",
  "domainName": "example.co.tz"
}
Domain getDomainInfo

Returns normalized domain data such as status, creation date, expiry date, nameservers, and the raw provider payload.

{
  "action": "getDomainInfo",
  "domainName": "example.co.tz"
}
Domain syncDomain

Pulls the latest provider data, updates the saved local status and expiry date when those fields are available, and returns the refreshed compatibility payload.

{
  "action": "syncDomain",
  "domainName": "example.co.tz"
}
Domain registerDomain

Registers a new domain using the reseller's account balance. If no nameservers are sent, the system can fall back to defaults.

{
  "action": "registerDomain",
  "domainName": "example.co.tz",
  "period": 1,
  "registrantInfo": {
    "name": "John Doe",
    "organization": "Example Limited",
    "address": "123 Sam Nujoma Road",
    "city": "Dar es Salaam",
    "state": "Dar es Salaam",
    "postcode": "11101",
    "country": "TZ",
    "email": "john@example.com",
    "phone": "+255700000000"
  },
  "adminInfo": {
    "name": "John Doe",
    "organization": "Example Limited",
    "address": "123 Sam Nujoma Road",
    "city": "Dar es Salaam",
    "state": "Dar es Salaam",
    "postcode": "11101",
    "country": "TZ",
    "email": "john@example.com",
    "phone": "+255700000000"
  },
  "nameservers": [
    "ns1.example.com",
    "ns2.example.com"
  ]
}
Domain getNameservers

Returns the current nameserver set for a domain the reseller owns.

{
  "action": "getNameservers",
  "domainName": "example.co.tz"
}
Domain updateNameservers

Updates nameservers. At least two non-empty nameservers are required.

{
  "action": "updateNameservers",
  "domainName": "example.co.tz",
  "nameservers": [
    "ns1.example.com",
    "ns2.example.com"
  ]
}
WHOIS getContactDetails / getWhois

Returns contact information in both the older nested structure and a flatter compatibility shape.

{
  "action": "getContactDetails",
  "domainName": "example.co.tz"
}
WHOIS updateContactDetails / updateWhois

Updates WHOIS contact details. Both registrantInfo and adminInfo are required for compatibility.

{
  "action": "updateContactDetails",
  "domainName": "example.co.tz",
  "registrantInfo": {
    "name": "John Doe",
    "organization": "Example Limited",
    "address": "123 Sam Nujoma Road",
    "city": "Dar es Salaam",
    "state": "Dar es Salaam",
    "postcode": "11101",
    "country": "TZ",
    "email": "john@example.com",
    "phone": "+255700000000"
  },
  "adminInfo": {
    "name": "John Doe",
    "organization": "Example Limited",
    "address": "123 Sam Nujoma Road",
    "city": "Dar es Salaam",
    "state": "Dar es Salaam",
    "postcode": "11101",
    "country": "TZ",
    "email": "john@example.com",
    "phone": "+255700000000"
  }
}
Renewal renewDomain

Renews a domain for one or more years and returns the new expiry date plus the amount charged.

{
  "action": "renewDomain",
  "domainName": "example.co.tz",
  "period": 1
}
Transfer getEPPCode

Returns the transfer code using both eppCode and epp_code keys for compatibility.

{
  "action": "getEPPCode",
  "domainName": "example.co.tz"
}
Transfer transferDomain

Starts an inbound transfer using the authorization code from the current registrar.

{
  "action": "transferDomain",
  "domainName": "example.co.tz",
  "authCode": "AUTH-CODE-HERE",
  "period": 1
}

cURL examples

These examples use the public endpoint and the same request contract old integrations already know.

curl -X POST "https://www.staging.reseller.co.tz/api" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -d '{
    "action": "getBalance"
  }'
curl -X POST "https://www.staging.reseller.co.tz/api" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -d '{
    "action": "checkDomain",
    "domainName": "example.co.tz"
  }'
curl -X POST "https://www.staging.reseller.co.tz/api" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -d '{
    "action": "syncDomain",
    "domainName": "example.co.tz"
  }'
curl -X POST "https://www.staging.reseller.co.tz/api" \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "your_api_key",
    "action": "updateNameservers",
    "domainName": "example.co.tz",
    "nameservers": ["ns1.example.com", "ns2.example.com"]
  }'

Responses and errors

Successful and failed requests return JSON. Successful requests use status: success. Failed requests use status: error.

{
  "status": "success",
  "message": "",
  "data": {
    "balance": 56000,
    "currency": "TZS"
  },
  "meta": {
    "balance_before": 56000,
    "balance_after": 56000
  }
}
Status Meaning Typical reason
400 Bad request Missing action, missing domain name, invalid parameters, or unsupported action.
401 Unauthorized Invalid or inactive reseller API key.
403 Forbidden The authenticated reseller is not allowed to perform this request.