Integrating with WHMCS for Automated Billing
WHMCS is the most popular billing and automation platform for web hosting. This guide walks you through connecting WHMCS to your {{COMPANY_NAME}} reseller hosting for fully automated provisioning, suspensions, and terminations.
Prerequisites
- A working WHMCS installation
- Your {{COMPANY_NAME}} reseller WHM credentials
- At least one hosting package created in WHM
Step 1: Generate a WHM API Token
- Log in to WHM
- Go to Development > Manage API Tokens
- Click Generate Token and name it "WHMCS-Integration"
- Copy the token immediately (it will not be shown again)
Step 2: Add the Server in WHMCS
Go to Configuration > Servers > Add New Server:
| Field | Value |
|---|---|
| Name | Friendly name (e.g., "Reseller Server 1") |
| Hostname | Your server hostname or IP |
| Module | cPanelExtended (or cPanel) |
| Username | Your WHM username |
| API Token | The token from Step 1 |
| Secure | Checked (uses port 2087 with SSL) |
Click Test Connection to verify, then save.
Step 3: Create a Server Group
Go to Servers > Server Groups > Create Server Group. Name it, add your server, set fill type to "Fill", and save.
Step 4: Create Products
For each WHM package, create a matching WHMCS product:
- Product Type: Shared Hosting
- Pricing tab: Set monthly/annual prices
- Module Settings: Select cPanel/WHM module, your server group, and matching WHM package
- Automation: Check "Automatically setup when payment is received"
Step 5: Configure Automation Settings
Under Automation Settings:
- Suspend after: 3-7 days overdue
- Unsuspend on payment: Enabled
- Terminate after: 30-60 days overdue
- Invoice reminders: 7 days, 3 days, 1 day before due
- Overdue reminders: 1 day, 3 days, 7 days after due
Step 6: Set Up Payment Gateways
Razorpay (Recommended for India)
Install the Razorpay WHMCS module and enter your Key ID and Key Secret. Supports UPI, cards, net banking, wallets.
PayPal
Enter PayPal business email or API credentials. Good for international clients.
Bank Transfer
Enable for manual payments. Provide bank details on checkout.
Testing the Integration
- Create a test product at Rs 1
- Place a test order as a client
- Complete payment
- Verify WHMCS automatically creates the cPanel account in WHM, sends welcome email, and shows "Active" status
- Test suspension automation by marking invoice unpaid
- Clean up test data
Troubleshooting
"Connection Failed"
- Verify hostname/IP, ensure port 2087 is not blocked, check API token validity, try IP instead of hostname
Account Not Created Automatically
- Check Utilities > Automation Status, verify the cron job is running, check Module Log for errors
Wrong Package Assigned
- Verify package name in WHMCS matches exactly with WHM (case-sensitive)
Related Articles
Need help? Contact our support team at {{SUPPORT_URL}}/client/support.