Configuration
After installing and activating the WHMCS Integration module, you need to configure the connection to your WHMCS instance and define how data flows into Perfex CRM. This page covers API setup, sync preferences, field mapping, and automated scheduling.
Connecting to WHMCSโ
The module communicates with WHMCS through its official API. You will need valid API credentials before proceeding.
Generating WHMCS API Credentialsโ
- Log in to your WHMCS Admin Area.
- Navigate to Setup > Staff Management > Manage API Credentials.
- Click Generate New API Credential.
- Enter a description (e.g., "Perfex CRM Integration").
- Copy the API Identifier and API Secret โ you will need both in the next step.
Store your API credentials securely. The API Secret is only displayed once during creation. If lost, you will need to generate new credentials.
Entering Credentials in Perfex CRMโ
- In Perfex CRM, navigate to the WHMCS Integration module settings.
- Enter the following details:
- WHMCS URL โ the full URL to your WHMCS installation (e.g.,
https://billing.example.com) - API Identifier โ the identifier generated in the previous step
- API Secret โ the secret key generated in the previous step
- WHMCS URL โ the full URL to your WHMCS installation (e.g.,
- Click Test Connection to verify that Perfex CRM can successfully communicate with your WHMCS instance.
- Click Save Settings once the connection test passes.
If the connection test fails, ensure that your Perfex CRM server's IP address is whitelisted in WHMCS under Setup > General Settings > Security > API IP Access Restriction. Also verify that HTTPS is configured and the WHMCS URL is correct.
Sync Settingsโ
The sync settings panel lets you control which data is imported and how it is handled within Perfex CRM.
Data Typesโ
| Data Type | Description |
|---|---|
| Clients | Sync client profiles including name, email, phone, address, and company details |
| Invoices | Sync invoices with line items, totals, tax, payment status, and due dates |
| Contacts | Sync additional contacts associated with each WHMCS client account |
Toggle each data type on or off depending on your needs. At minimum, Clients should be enabled since invoices and contacts are linked to client records.
Duplicate Handlingโ
When a synced record matches an existing Perfex CRM customer (matched by email address), you can choose how to handle the conflict:
- Skip โ do not import the record if a match already exists
- Update โ overwrite the existing Perfex CRM record with WHMCS data
- Create New โ create a separate record regardless of duplicates
The recommended setting is Update, which keeps your Perfex CRM data in sync with WHMCS while avoiding duplicate customer entries.
Field Mappingโ
The field mapping section lets you define how WHMCS fields correspond to Perfex CRM fields. The module ships with sensible defaults, but you can customize mappings for:
- Standard fields โ name, email, phone, address, company, city, state, zip, country
- Custom fields โ map WHMCS custom fields to Perfex CRM custom fields
To edit field mappings:
- Go to WHMCS Integration > Settings > Field Mapping.
- For each WHMCS field, select the corresponding Perfex CRM field from the dropdown.
- Click Save Mapping.
Automated Sync Scheduleโ
Rather than running syncs manually, you can configure an automated schedule using a server-side cron job.
Setting Up the Cron Jobโ
Add the following entry to your server's crontab to run the sync at your desired interval:
# Run WHMCS sync every 6 hours
0 */6 * * * php /path/to/perfex/index.php whmcs_integration sync >/dev/null 2>&1
Adjust the cron timing based on how frequently your WHMCS data changes. Common intervals include:
| Interval | Cron Expression | Use Case |
|---|---|---|
| Every hour | 0 * * * * | High-volume billing environments |
| Every 6 hours | 0 */6 * * * | Standard usage (recommended) |
| Once daily | 0 2 * * * | Low-volume environments |
Running the sync too frequently on large datasets may increase server load. Monitor your server resources after enabling automated sync and adjust the interval accordingly.
What's Next?โ
- Usage Guide โ learn how to run manual syncs, manage imported clients and invoices, and use bots, templates, and bulk contacts