Learn how to integrate domain and hosting provider APIs with TurboHostPro
TurboHostPro allows you to integrate with multiple domain and hosting providers through their APIs. This documentation will guide you through the process of setting up these integrations, authenticating with the providers, and performing common operations.
TurboHostPro uses a secure vault to store your API credentials. Your credentials are encrypted and never exposed to end users. You'll need to provide your API keys in the TurboHostPro admin panel under Settings > API Integrations.
Used by ResellerClub, Namecheap
Used by GoDaddy, some cPanel instances
Used by some WHM/cPanel instances
Used by Plesk, DirectAdmin
To obtain API keys from your providers, follow these general steps:
ResellerClub offers a comprehensive reseller platform for domains and hosting. Their API allows you to perform domain registrations, transfers, renewals, and DNS management.
{ "provider": "resellerclub", "credentials": { "resellerId": "YOUR_RESELLER_ID", "apiKey": "YOUR_API_KEY" }, "environment": "production", "settings": { "defaultNameServers": [ "ns1.yourdomain.com", "ns2.yourdomain.com" ], "defaultContactId": "12345678", "autoRenew": true } }
// Server-side code (Next.js API route) import { checkDomainAvailability } from '@/lib/providers/resellerclub'; export async function POST(req) { const { domain, tlds } = await req.json(); try { const results = await checkDomainAvailability(domain, tlds); return Response.json({ success: true, results }); } catch (error) { console.error('Error checking domain availability:', error); return Response.json({ success: false, error: error.message }, { status: 500 }); } }
SiteGround offers a comprehensive hosting platform with AI-driven optimizations and world-class performance. Their API allows you to manage hosting accounts, WordPress installations, and website deployments.
{ "provider": "siteground", "credentials": { "apiEndpoint": "https://api.siteground.com/v1", "apiToken": "YOUR_API_TOKEN" }, "environment": "production", "settings": { "defaultDataCenter": "us-east", "defaultPHPVersion": "8.1", "autoSSL": true, "backupRetention": 30 } }
// Server-side code (Next.js API route) import { createSiteGroundAccount } from '@/lib/providers/siteground'; export async function POST(req) { const { domain, plan, customerEmail, phpVersion } = await req.json(); try { const result = await createSiteGroundAccount({ domain, plan, customerEmail, phpVersion: phpVersion || '8.1', features: { ssl: true, backup: true, staging: true } }); return Response.json({ success: true, accountId: result.accountId, loginUrl: result.loginUrl, credentials: result.credentials }); } catch (error) { console.error('Error creating SiteGround account:', error); return Response.json({ success: false, error: error.message }, { status: 500 }); } }
TurboHostPro provides a unified API that abstracts away the differences between providers. This allows you to use a consistent interface regardless of which providers you've integrated.
Check domain availability across multiple TLDs
Register a new domain
Transfer a domain from another registrar
Renew an existing domain
Update domain nameservers
Create a new hosting account
Suspend a hosting account
Unsuspend a hosting account
Change a hosting account's package
TurboHostPro supports webhooks to notify your application of important events such as domain registrations, renewals, and hosting account changes.
{ "event": "domain.registered", "timestamp": "2023-06-08T12:34:56Z", "data": { "domain": "example.com", "registrationDate": "2023-06-08T12:34:56Z", "expiryDate": "2024-06-08T12:34:56Z", "registrantEmail": "customer@example.com", "provider": "resellerclub" } }
// Server-side code (Next.js API route) import { createHmac } from 'crypto'; export async function POST(req) { const payload = await req.json(); const signature = req.headers.get('x-turbohostpro-signature'); const webhookSecret = process.env.WEBHOOK_SECRET; // Verify signature const expectedSignature = createHmac('sha256', webhookSecret) .update(JSON.stringify(payload)) .digest('hex'); if (signature !== expectedSignature) { return Response.json({ error: 'Invalid signature' }, { status: 401 }); } // Process the webhook const { event, data } = payload; // Handle different event types switch (event) { case 'domain.registered': // Handle domain registration break; case 'hosting.created': // Handle hosting account creation break; // ...other events } return Response.json({ success: true }); }
Common issues and solutions when integrating with domain and hosting provider APIs.
Most providers implement rate limiting to prevent abuse. If you're making too many requests in a short period, you may be temporarily blocked.
TurboHostPro provides several tools to help you debug API integrations: