CloudFlare Hosting Partner API WHMCS Module

From WHMCS Global Services Module Documentation
Jump to: navigation, search

Getting Started


  • WHMCS 6/7
  • WHMCS DB User must have all permissions of the DB before installation and activation of this Module GRANT ALL PRIVILEGES ON db_base.* TO db_user @'localhost' IDENTIFIED BY 'db_passwd';
  • Approve your hosting partner account on Cloudflare
  • CloudFlare Host API Key

How to get Hosting partner API key

  1. Login to your CloudFlare account.
  2. Go to "My Settings".
  3. Scroll down to "API Key".
  4. Click on the "View API Key" button to see your API identifier.

How to download the module files?

Please follow the link to download the module


How to upload the module files?

  1. Extract the downloaded module folder.
  2. Under Modules folder, you will find two folder i.e. modules and includes.
  3. You need to upload that module and includes folder to WHMCS directory (whmcs_root/). It will copy the required module files and nothing will be over written.

How to configure the module?

Go to Setup >>>> Products/Services >>>> Products/Services

alt text

1. Click on Create new product >>> and put the required values and click on continue

alt text

2. Select Module Name from Drop Down as WGS CF Partner API

3. Enter the required information to configure the module.

  • Lecense key
  • Cloudflare Host API Key
  • Tab Access Management (which clientarea tabs users can access)
  • Email Address (Cloudflare Email Address)
  • Password (Cloudflare Password)
  • Username (Cloudflare Username)
  • User Key (Cloudflare User Key)
  • User API Key (Cloudflare User API Key)
  • Zone Setup (Full zone setup "DNS" or Partial zone setup "CNAME")
  • Cloudflare Plan (select specific plan with this plan)
  • Create A DNS record (create A type DNS record with CF when newly domain will be added with CF)
  • Enable Product Addon (Optional, but enable if you want to forcefully add domain with CF, when user pruchase any another hosting service)
  • Products Group Name (Optional, but if you've enabled "Enable Product Addon" option then it's required. put hosting products group name with new line)
  • Product Name (Optional, If you want to add forcefully product addon with hosting product then you've to create a new free product with WHMCS and then put this * created product name in this field)

4. Now you need to give permissions on Tab Access Management as which permissions your customer will going to have for Cloudflare.

5. After you select all the permissions as stated above click on save changes.

alt text

How to upgrade the CF (Cloud Flare) plan?

1. Add a new product/service for the upgrade Cloudflare service with WHMCS. Select Product Type as Hosting Account and enter any applicable pricing and term information.

alt text

2. Edit existing Cloudflare products and then go to "Upgrades" tab. Select specific products from "Packages Upgrades" and then save the setting.

alt text

How to sell product addon instead of product?

When you will configure the module with any product then module will create the required product addons with WHMCS. You have to need assign the hosting products with these product addons.

alt text
alt text
alt text

How to add domain with CF (Cloud Flare) by forcefully

If you don't want to show any CF product addons on order form and want when user purchase any hosting then user domain should be added in CF.

For forcefully add domain with CF, you have to hide the CF product addons from order form and need to make some setting with module under product setting.

alt text

How to test the module?

  • User will be presented below mentioned screen in client area and there he needs to put all the required Cloudflare account details.
  • Click on checkout
  • Once order is approved you are good to go with Hosting partner module.
alt text

After the order process completed

  • User will go to Services in client area
  • Click on My Services
  • There he will see the purchased services
  • On clicking that services, he will be redirected to product detail page from where he can Manage Cloudflare services