Base URL
All Account API requests use HTTPS and JSON. Production base:
https://www.bavinhost.com/account/api/v1/Partner Gateway base:
https://www.bavinhost.com/partner-gateway/api/v1/Authentication
Create an API key in Client area → API Keys. Send it on every request using either:
X-API-Key: YOUR_API_KEY
Authorization: Bearer YOUR_API_KEYAPI key only — you do not send the API secret on requests. The secret is shown once when you create a key (for your records). Query string ?api_key= also works, but headers are preferred. No browser login session is required for API calls.
Charging rules
Read-only endpoints never charge. Paid actions debit account balance (Account API) or partner wallet (Partner Gateway) before work runs. If provision/register fails after debit, the amount is refunded automatically.
- Charges balance:
POST /domains,POST /domains/{id}/renew,POST /hosting,POST /hosting/{id}/renew - No charge: list/get, support tickets, profile updates, nameservers, suspend/unsuspend, auto-renew toggles
- Insufficient funds: HTTP
402with messageInsufficient account balance
Endpoint map
Account API routes under https://www.bavinhost.com/account/api/v1/. Items marked Bill charge balance.
/domainsCore/domains/{id}Core/domainsBill/domains/{id}/renewBill/domains/{id}/auto-renewCore/domains/{id}Core/hostingCore/hosting/{id}Core/hostingBill/hosting/{id}/renewBill/hosting/{id}Core/ordersCore/orders/{id}Core/accountCore/accountCore/supportCore/supportCore/billing/balanceCore/billing/transactionsCoreDomains Live
POST https://www.bavinhost.com/account/api/v1/domains Charges
Body:
{
"domain": "example.com",
"years": 1,
"contacts": {}
}Renew:
POST https://www.bavinhost.com/account/api/v1/domains/{id}/renew
{ "years": 1 }Auto-renew toggle (no charge):
{ "enabled": true }Hosting Live
POST https://www.bavinhost.com/account/api/v1/hosting Charges
{
"domain": "example.com",
"package": "starter",
"username": "exuser",
"password": "strong-password",
"years": 1
}Renew:
POST https://www.bavinhost.com/account/api/v1/hosting/{id}/renew
{ "years": 1 }Suspend / unsuspend with PUT /hosting/{id} and body {"status":"suspended"} or {"status":"active"}.
Billing
GET https://www.bavinhost.com/account/api/v1/billing/balance
curl "https://www.bavinhost.com/account/api/v1/billing/balance" \
-H "X-API-Key: YOUR_API_KEY"Also available: GET /billing/transactions.
Support
POST https://www.bavinhost.com/account/api/v1/support
{
"title": "Issue title",
"description": "Help needed",
"department": "IT"
}Partner Gateway Live
For resellers and agencies. Auth headers:
X-Api-Key: your_api_key
X-Timestamp: unix_timestamp
X-Nonce: unique_nonceWallet is required for provisioning, domain register/transfer, and renewals.
Partner sites
/sitesCore/sitesBill/sites/{id}/renewBill/sites/{id}/auto-renewCore/sites/{id}/suspendCorePartner domains
/domainsCore/domainsBill/domains/{id}/renewBill/domains/{id}/auto-renewCoreQuick start & code examples
Replace YOUR_API_KEY with a real key from API Keys.
Check balance (cURL)
curl "https://www.bavinhost.com/account/api/v1/billing/balance" \
-H "X-API-Key: YOUR_API_KEY"Renew a domain (cURL)
curl -X POST "https://www.bavinhost.com/account/api/v1/domains/DOM_SECRET_ID/renew" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"years":1}'Purchase hosting (PHP)
$ch = curl_init('https://www.bavinhost.com/account/api/v1/hosting');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-Key: YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode([
'domain' => 'example.com',
'package' => 'starter',
'username' => 'exuser',
'password' => 'strong-password',
'years' => 1,
]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);Register domain (JavaScript)
const res = await fetch('https://www.bavinhost.com/account/api/v1/domains', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'YOUR_API_KEY',
},
body: JSON.stringify({
domain: 'example.com',
years: 1,
contacts: {}
}),
});
const data = await res.json();List domains (Python)
import requests
r = requests.get(
'https://www.bavinhost.com/account/api/v1/domains',
headers={'X-API-Key': 'YOUR_API_KEY'},
timeout=30,
)
print(r.status_code, r.json())Success response shape
{
"success": true,
"message": "Hosting account created successfully",
"timestamp": "2026-08-14T19:00:00+00:00",
"code": 200,
"data": {
"secretid": "HOST_...",
"domain": "example.com",
"amount_charged": 48.00,
"currency": "USD",
"balance": 152.00,
"new_expiry": "2027-08-14 19:00:00"
}
}HTTP status codes
200— Success401— Missing/invalid API key402— Insufficient account balance / wallet404— Resource not found405— Method not allowed429— Rate limit (default 100 req/hour per key)500— Server / provider error (purchase refunds if already charged)
Get API access
- Log in to your client area
- Open API Keys and create a key
- Fund account balance before purchase/renew calls
- Call
https://www.bavinhost.com/account/api/v1/…with your key
Partners: use the partner dashboard for keys and wallet. Need help? Contact us.