StarDomain

Integrating with WHMCS for Automated Billing

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

  1. Log in to WHM
  2. Go to Development > Manage API Tokens
  3. Click Generate Token and name it "WHMCS-Integration"
  4. Copy the token immediately (it will not be shown again)

Step 2: Add the Server in WHMCS

Go to Configuration > Servers > Add New Server:

FieldValue
NameFriendly name (e.g., "Reseller Server 1")
HostnameYour server hostname or IP
ModulecPanelExtended (or cPanel)
UsernameYour WHM username
API TokenThe token from Step 1
SecureChecked (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:

  1. Product Type: Shared Hosting
  2. Pricing tab: Set monthly/annual prices
  3. Module Settings: Select cPanel/WHM module, your server group, and matching WHM package
  4. 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

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

  1. Create a test product at Rs 1
  2. Place a test order as a client
  3. Complete payment
  4. Verify WHMCS automatically creates the cPanel account in WHM, sends welcome email, and shows "Active" status
  5. Test suspension automation by marking invoice unpaid
  6. 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)

Need help? Contact our support team at {{SUPPORT_URL}}/client/support.

Integrating with WHMCS for Automated Billing - Knowledge Base