WHMCS Module
Introduction
This feature allows you to create a CDN product by selecting Aflexi module. Therefore, you may create, suspend, and terminate CDN accounts directly through WHMCS.
Creating Aflexi Product

- Navigate to [Setup] -> [Product/Services] -> [Create New Product].
- Select your Product Type and Group, then fill in your Product Name and save the changes.
- Now, scroll to [Modul Settings] and select "Aflexi", as graph above explained.
- [Automatically setup the product as soon as an order is placed] - CDN account will be created upon client placing an order. Note that CDN account will not be created if admin placing the order in admin WHMCS portal. This is the behaviour of WHMCS.
- [Automatically setup the product as soon as the first payment is received] - CDN account will be created upon first payment received.
- [Automatically setup the product when you manually accept a pending order] - CDN account will be created after a pending order is activated.
- Save changes.
Putting Email Template

An Aflexi email template is created along with the installation of plugin. You may use this email template for sending username/password to your clients.
- You may modify the Aflexi email template at [Setup] -> [Email Template]
- Simply navigate to [Setup] -> [Product/Service]
- Click the Aflexi product.
- Select "Aflexi CDN Welcome Mail", as graph above shown.
Placing An/Multiple Aflexi Order(s)

- Operator may now create an/multiple Aflexi order(s) to your clients.
- Navigate to [Order] -> [Add New Order]
- Select your client and choose the CDN product.
- Save changes and an order is created.
- CDN account will be created following the configuration on the "Module Setting" on Product page(Shown In "Creating Aflexi Product" help section)
- After the payment is remit, Aflexi will create a CDN account. If welcome email is congifured as above, an email notifcation with username/password will be sent to the respective client's email address. Kindly do remember that email address is required in WHMCS client's account.
- Operator may see the created account with respective package in Aflexi portal.
Automated Synchronization (Per CDN User/Publisher)
- If a client signs up, and insert a domain along with the order, whmcs should automatically generate a username on behalf.
- If a client signs up without inserting a domain along with the order, Aflexi will automatically generate a username based on registrant email. The Aflexi CDN username would look like: user_domain.com_[Product/HostingId]
Multiple orders with respective username is allowed under the same WHMCS user.
| Creation of CDN accounts |
It depends on the configuration on the product. There are 4 available options in Product's Module Settings. |
| When a user account is closed or deleted | User account in Aflexi is suspended |
Manual Synchronization

In WHMCS, Aflexi works exactly similar to cPanel hosting. You may use the Module Commands(as graph above) to trigger the events to Aflexi account.
- Navigate to [Clients] -> [View/Search Clients]
- Click on one of your client.
- Browse to [Products/Services] and there are few options for synchronization:
- Create - Creating/Recreating of Aflexi CDN account.
- Suspend - Suspend an Aflexi user account.
- Unsuspend - Activate an Aflexi user account from suspendion.
- Terminate - Terminate/Delete Aflexi user account.
- Change Package - Upgrade/Downgrade Aflexi package.
- Change Password - Update the password of Aflexi user account.
Deleting/Suspending CDN account

Beside terminate Aflexi CDN account using Manual Synchronization as above, the CDN account will be deleted/suspended when you closing the WHMCS account.
- Navigate to [Clients] -> [View/Search Clients]
- Click on the client that you are closing/deleting.
- As screenshot shown, you may either choose
- Close Clients Account - It will suspend Aflexi CDN account by clicking "Close Clients Account"
- Delete Clients Account - It will trigger to delete Aflexi CDN account.
