Difference between revisions of "Affiliates"

From WHMCS Documentation

(Configuration)
Line 1: Line 1:
WHMCS comes with a built in affiliates system.  Affiliates are often key to a business in order to generate revenue by having others refer customers. With that in mind, WHMCS has a comprehensive affiliate system featuring support for one time and recurring commissions, both percentage or fixed money values, payout delays, minimum withdrawal limits and live statistics and information for affiliates from the client area.
+
Affiliates help generate revenue by referring customers to your business. WHMCS includes a comprehensive affiliate system with support for one-time and recurring commissions, either in percentages or fixed values. It also includes payout delays, minimum withdrawal limits, and live statistics and information for affiliates in the Client Area. See the [[#Configuration]] section below for steps to enable affiliate status for a client.
 
+
Your WHMCS installation generates a unique code for each client to use on their website. For example:
 
 
 
<nowiki>https://www.example.com/aff.php?aff=001</nowiki>
 
 
 
Clicking this link takes customers to your site and saves a cookie on their computers. If a visitor then places an order for a product or service with the cookie present (it lasts for three months by default), the client will earn a commission.
 
 
 
==Configuration==
 
 
 
To configure the affiliates system, go to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[General Settings]]''' or, prior to WHMCS 8.0, '''Setup > General Settings''' and then select the '''Affiliates''' tab.  From here you can set the initial bonus deposit amount, the minimum withdrawal level, the payout delay, and the percentage to pay out.
 
 
 
*'''Affiliate Earning Percentage''' — The default percentage to pay as commission on all products and services. You can override this on a per-product basis when configuring a product.  You can then overide the commission settings further on a per-client basis and set a specific commission rate for an individual affiliate. This is ideal for rewarding your best affiliates.
 
*'''Affiliate Bonus Deposit''' — The amount to default any new affiliate's balance to. This is a way of offering an incentive to new affiliates so they'll reach their first withdrawal level quicker.
 
*'''Affiliate Payout Amount''' — The amount at which you allow affiliates to withdraw their commission balance (for example, $50 or more).
 
*'''Affiliate Commission Delay''' — The number of days to delay commission payments so that you aren't paying commissions as soon as you receive the order. See the '''Commission Delay''' section below for more information.
 
 
 
If there is a setup fee, the initial commission will include it. Then, the system bases recurring commissions on the product's Recurring Amount.
 
 
 
 
Affiliates earn commission for products and services (including configurable options) only. They can't earn commission on:
 
Affiliates earn commission for products and services (including configurable options) only. They can't earn commission on:
 +
 
* Domain names.
 
* Domain names.
* Product Addons.
+
* [[Product Addons]].
* Upgrade Orders (however, any recurring commissions will increase with the new renewal price).
+
* Upgrade orders. <div class="docs-alert-info"><span class="title">Note:</span><br />Any recurring commissions will increase with new renewal prices.</div>
 
* Manually-created invoices.
 
* Manually-created invoices.
* [[Usage Billing]] (invoiced in a arrears)
+
* [[Usage billing]], invoiced in a arrears
 
+
=== Setting Commission Per-Product===
+
== Affiliate System Configuration ==
To offer a higher commission on a certain product, edit the product and go to the '''Other''' tab at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Products and Services]]''' or, prior to WHMCS 8.0, '''Setup > Product/Services'''.   
+
 
+
To configure the affiliates system, go to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[General Settings]]''' or, prior to WHMCS 8.0, '''Setup > General Settings'''. Then, select the '''Affiliates''' tab.
From here you can choose a percentage or fixed amount commission. Selecting the '''One Time Payout''' checkbox will give the commission only once. The default commission setting for WHMCS is recurring.
+
* These settings allow you to configure how commission is earned, whether to offer bonuses, payout amounts, and whether to apply delay periods or allow commission reversals.
 
+
* For recommendations and descriptions of each setting, see [[Affiliate Tab]].
It is possible to disable commission entirely for an individual product from this page by selecting the ''No Commission'' option.
+
This setting takes priority over the default commission. However, if you have set either the client or the product commission to one time, that setting will override this.
+
=== Overriding Configuration Settings ===
 
+
===Setting Commission Per-Client===
+
You can overide these settings on a ''per-client'' basis and set a specific commission rate for an individual affiliate at '''Clients > [[Manage Affiliates]]'''.
To offer a unique commission, click the "'View Affiliate Details'" link on the '''Client's Summary Tab''' and you can set the commission as above. 
+
 
+
You can override these settings on a ''per-product'' basis when you configure a product at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Products_and_Services|Products/Services]]''' or, prior to WHMCS 8.0, '''Setup > Product/Services''' in the '''Other''' tab.
This setting will take priority over all others. However, if you have set either the client or the product commission to one time, that setting will override this.
+
   
 
+
=== Delays and Reversals ===
===Promotion Behaviour===
+
 +
WHMCS includes tools to help you prevent losses due to disputes, cancellations, or refunds on transactions for which you pay commissions.
 +
 +
The '''Affiliate Commission Delay''' setting at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[General Settings]]''' helps you avoid this by delaying commission payment for a set number of days after the transaction.
 +
* This setting applies to commissions for both initial orders and renewals.
 +
* At the time of payment, the affiliate's '''Pending Commissions Balance''' will increase by the amount of commission for the order but their '''Available to Withdraw Balance''' will not.
 +
* WHMCS only awards commission if the product or service is in the '''Active''' status when payout would occur according to your settings.
 +
** This is either at the end of the delay period or, if you did not set a delay period, immediately.
 +
** If it is in another status, the commission will be removed and can only be awarded manually.
 +
 +
In WHMCS 8.3 and later, you can also perform reversals on commission.
 +
* WHMCS can reverse commissions when you refund the invoice that incurred the affiliate commission.
 +
** When you perform a full refund, WHMCS automatically reverses all of the associated commissions.
 +
** When you perform a partial refund, you can choose whether to also reverse the commission. You cannot, however, choose an amount of the commission to reverse. Reversing the commission must reverse the entire amount.
 +
* If you choose '''not''' to perform a commission reversal, the commission payment will not be affected.
 +
 
<div class="docs-alert-info">
 
<div class="docs-alert-info">
 
<span class="title">Note:</span><br />
 
<span class="title">Note:</span><br />
The "Referred Signups" tab shows the normal commission paid on renewals. If a one time promotion code is used, the discounted amount will not be reflected on that tab. However it will be reflected on the commission for it on the Pending Commission or Commission History tabs as applicable.
+
If you paid a commission before upgrading to WHMCS 8.3, WHMCS will not present the option to reverse commissions.
 
</div>
 
</div>
If the referred client uses a promotional code to receive a discount when signing up and you have configured the affiliate to receive a percentage commission, the system will reduce the value of the commission. If you have configured a fixed amount commission, they will still receive the full value.
+
 
+
== Working with Affiliates ==
For example, if someone uses an affiliate's ''three months free'' promotional code, the affiliate gets the commission based on the first payment amount and then receives recurring amounts according to the product's settings. So, the user would get a percentage of zero and therefore zero for the first three months.
+
 
+
Before a client can receive commissions, they must become an activated affiliate.
===Upgrade Behaviour===
+
If a referred client upgrades or downgrades their product, the system will adjust commissions the affiliate receives in the future to match the price of the new product. This won't affect commission payments that the affiliate has already earned. There is no commission on the upgrade or downgrade order itself. This does not apply to one-time commissions.
+
* You can activate affiliates in their client profile's '''Summary''' tab. To do this, navigate to the [[Clients:Summary_Tab|client profile '''Summary''' tab]] and click '''Activate as Affiliate''' under '''Other Actions'''.
 
+
* After you have enabled the affiliate system as described above, clients can also activate affiliate status for themselves in the Client Area.
==Commission Delay==
+
 
+
=== Managing Affiliates ===
 +
 +
To view and manage affiliates and create manual commission payments and withdrawals, go to '''Clients > Manage Affiliates'''. For more information, see [[Managing Affiliates]].  
 +
 
<div class="docs-alert-info">
 
<div class="docs-alert-info">
 
<span class="title">Note:</span><br />
 
<span class="title">Note:</span><br />
We recommend a minimum Commission Delay value of 1. Typical values would be 30 or 60 days. Setting this value to 0 will cause commissions to remain "Pending" and never clear.
+
You '''must''' also configure the settings in the [[#Affiliate System Configuration]] section above. Otherwise, affiliate information will ''not'' display in the Client Area and the affiliate system will not function.
 
</div>
 
</div>
 
+
This option allows you to set the number of days to delay commission payments so that you aren't paying affiliates as soon as you receive a payment. This helps avoid paying commission on transactions which are later disputed or cancelled/refunded within a few days of payment, as the commission is only paid if the product or service is still active at the end of the delay period.
+
=== Assigning an Affiliate to an Existing Order ===
 
+
Rather than paying commission instantly when you receive payment, Commission Delay waits for a period of days and then only pays the commission if the product or service is still Active after that period of time has passed. If the service has any other status (eg. Pending, Cancelled, Suspended, Terminated) after the Commission Delay has passed, the pending commission is not paid out and removed.
+
To assign an affiliate to an existing referral-free order that contains a service:
 
+
The Commission Delay logic applies to all payments; the initial sign-up order and all subsequent renewal payments.
+
# Go to '''Orders > List'''.
 
+
# Locate the order you want to assign to the affiliate.
For example, you could set the Commission Delay to wait 60 days before paying the commission for a sale on the basis that most fraudulent transactions will have been reported to you within that time. At the time of payment, the affiliates '''Pending Commissions Balance''' will increase by the amount of commission for the order, but not their '''Available to Withdraw Balance'''.
+
# Click the '''Order ID''' number to open the details for that order.
 
+
# Click '''Manual Assign''' in the '''Affiliate''' section.
You can view and delete pending commissions from the affiliates management area anytime from the '''Pending Commissions''' tab under Clients > Manage Affiliates when viewing an individual affiliates details.
+
# From the menu that appears, select the affiliate to assign to the order. Alternately, start typing the name of the desired affiliate.
 
+
# Click '''Save'''.
==Affiliate Linking Code==
+
 
+
=== Paying Commission for a Paid Order ===
You can specify affiliate link code in the configuration area. For example:
+
 
+
You may wish to apply an affiliate to an order after it is paid, in which case the affiliate has missed the initial commission for that order.
 +
 +
To correct this:
 +
 +
# Use the steps above to assign the affiliate to the order.
 +
# Go to '''Clients > Manage Affiliates'''.
 +
# In the '''Referrals''' tab, click '''Manual Payout''' for that order.
 +
 +
WHMCS will perform the necessary steps to credit the affiliate.
 +
 +
== Affiliate Codes and Links ==
 +
 +
WHMCS generates a unique code for each affiliate to use on their website. For example:
 +
 +
<nowiki>https://www.example.com/aff.php?aff=001</nowiki>
 +
 +
Clicking this link takes customers to your site and saves a cookie on their computers. If a visitor places an order for a product or service with the cookie present, the affiliate will earn a commission. By default, the cookie persists for three months.  
 +
 +
=== Affiliate Linking Code ===
 +
 +
You can specify '''Affiliate Link''' code in the '''Affiliates''' tab at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[General Settings]]''' or, prior to WHMCS 8.0, '''Setup > General Settings'''. For example:
 +
 
<source lang="html4strict">
 
<source lang="html4strict">
 
  <a href="[AffiliateLinkCode]"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br>
 
  <a href="[AffiliateLinkCode]"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br>
Line 77: Line 100:
 
  <(a href="[AffiliateLinkCode]")><(img src="http://www.yourcompany.com/banners/120x60banner.gif" width="120" height="60" border="0")><(/a)><br><br>
 
  <(a href="[AffiliateLinkCode]")><(img src="http://www.yourcompany.com/banners/120x60banner.gif" width="120" height="60" border="0")><(/a)><br><br>
 
</source>
 
</source>
 
+
The above code in the Affiliates Link section will display the image preview of the banner first and then the code below it for the affiliate to use. The '''<(''' and ''')>''' is special syntax which you must use so the code is '''not executed''' as true HTML. WHMCS modifies this when displaying it to the client so it will appear as normal HTML.
+
If you enter this code, it will display the image preview of the banner first and then the code below it for the affiliate to use. The <tt><(</tt> and <tt>)></tt> are parts of a special syntax that you '''must''' use to ensure that the code is '''not''' executed as HTML. WHMCS modifies this during display to cause it to appear as normal HTML.
 
+
For more advanced link code, you can add it directly to the affiliates.tpl template file of your active template folder using the template field '''{$referrallink}''' wherever you want to include the affiliates unique referral URL.
+
You can add advanced link code directly to the <tt>affiliates.tpl</tt> template file in your active template folder using the <tt>{$referrallink}</tt> template field wherever you want to include the affiliate's unique referral URL.
 
+
===Linking to a Product Group===
+
For more information about linking to WHMCS, see [[Linking to WHMCS]].
 
+
It is possible to link directly to the order form for a specific product group. To do this, append <tt>&gid=x</tt> to the end of the <tt>[AffiliateLinkCode]</tt>, where <tt>x</tt> is the ID of the product group. For example:
+
=== Linking to a Product Group ===
 
+
 +
You can link directly to the order form for a specific product group. To do this, append <tt>&gid=x</tt> to the end of the <tt>[AffiliateLinkCode]</tt>, where <tt>x</tt> is the ID of the product group. For example:
 +
 
<source lang="html4strict">
 
<source lang="html4strict">
 
<a href="[AffiliateLinkCode]&gid=2"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br> <(a href="[AffiliateLinkCode]&gid=2")><(img src=http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)>
 
<a href="[AffiliateLinkCode]&gid=2"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br> <(a href="[AffiliateLinkCode]&gid=2")><(img src=http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)>
 
</source>
 
</source>
 
+
===Linking to a Product===
+
=== Linking to a Product ===
 
+
It is possible to link directly to the order form for a specific product. To do this, simply append <tt>&pid=x</tt> to the end of the <tt>[AffiliateLinkCode]</tt> where <tt>x</tt> is the ID of the product. For example:
+
You can link directly to the order form for a specific product. To do this, append <tt>&pid=x</tt> to the end of the <tt>[AffiliateLinkCode]</tt>, where <tt>x</tt> is the product ID. For example:
 
+
 
<source lang="html4strict">
 
<source lang="html4strict">
<a href="[AffiliateLinkCode]&pid=2"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br> <(a href="[AffiliateLinkCode]&pid=2")><(img src=http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)>
+
<a href="[AffiliateLinkCode]&pid=2"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br> <(a href="[AffiliateLinkCode]&pid=2")><(img src=http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)>
 
</source>
 
</source>
 
+
===Linking to the Cart===
+
=== Linking to the Cart ===
 
+
It is possible to link directly to the cart. To do this, simply append <tt>&gocart=true</tt> to the end of the <tt>[AffiliateLinkCode]</tt>. For example:
+
You can link directly to the cart. To do this, append <tt>&gocart=true</tt> to the end of the <tt>[AffiliateLinkCode]</tt>. For example:
 
+
 
<source lang="html4strict">
 
<source lang="html4strict">
<a href="[AffiliateLinkCode]&gocart=true"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br> <(a href="[AffiliateLinkCode]&gocart=true")><(img src=http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)>
+
<a href="[AffiliateLinkCode]&gocart=true"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br> <(a href="[AffiliateLinkCode]&gocart=true")><(img src=http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)>
 
</source>
 
</source>
 
+
===Linking to the Registration Form===
+
=== Linking to the Registration Form ===
It is possible to link directly to the registration form. To do this, append <tt>&register=true</tt> to the end of the <tt>[AffiliateLinkCode]</tt>. For example:
+
 
+
You can link directly to the registration form. To do this, append <tt>&register=true</tt> to the end of the <tt>[AffiliateLinkCode]</tt>. For example:
 +
 
<source lang="html4strict">
 
<source lang="html4strict">
 
<a href="[AffiliateLinkCode]&register=true"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br> <(a href="[AffiliateLinkCode]&register=true")><(img src=http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)>
 
<a href="[AffiliateLinkCode]&register=true"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br> <(a href="[AffiliateLinkCode]&register=true")><(img src=http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)>
 
</source>
 
</source>
 
+
==Activating an Affiliate==
+
== Affiliate Cookies ==
 
+
   
Clients can activate their affiliate account from the client area but you, as an admin, can do it from the client summary page too. To do that, locate the client you want to activate using the search or client list and then, in the '''Actions''' panel, click the '''Activate as Affiliate''' link.
+
The affiliate link cookie lasts for three months on the user's computer by default. You can change the cookie duration by editing the <tt>aff.php</tt> file.
 
+
==Deactivating an Affiliate==
 
To remove a client from the affiliate program, navigate to '''Clients > Manage Affiliates''' and click the red X icon next to their name.
 
 
 
==Managing Affiliates==
 
 
 
*To view and manage affiliates, go to '''Clients > Manage Affiliates'''.
 
*To view the affiliate statistics for a specific client, search for that client as normal and from the '''Client Summary" page, click the '''View Affiliate Details''' link in the '''Actions''' panel.
 
*To view your best-performing affiliates, click the '''Balance''' column heading to sort the affiliates into order of their balances.
 
 
 
===Referral Tracking===
 
 
 
In WHMCS 7.5 and later, the system logs and records referral traffic to allow you to see where referrals are coming from and trends in the volume of referrals over time.
 
 
 
The logged data includes the referrer URL where possible, and the number of hits for each unique referral URL.
 
 
 
You can choose between a range of time periods: 30 Days, 60 Days, 90 Days, and 120 Days.
 
 
 
The referral tracking displays as the first tab within the affiliate profile view.
 
 
 
[[File:Affiliate-referral-tracking.png]]
 
 
 
==Manual Operations==
 
===Assigning an Affiliate to an Existing Order===
 
 
 
To assign an affiliate to an already-placed, referal-free order, go to '''Orders > List''' and locate the order you want to assign to the affiliate. Click on the '''Order ID''' number to open the details for that order.  Then, click the '''Manual Assign''' link in the Affiliate section. A popup will appear, with a menu to choose the affiliate you want to assign it to. Click '''Save''' to apply it.
 
 
 
===Paying Commission for an already paid order===
 
 
 
There may be some instances where you apply an affiliate to an order after it is paid for, in which case the affiliate has missed out on the initial commission for that order.  To correct that, after assigning the affiliate with the steps above, open the affiliates page (see Managing Affiliates, above) and then on the Referrals list for the affiliate, click the '''Manual Payout''' button next to the new account.  That will perform the equivalent action of an end user paying for an invoice for a referred order in terms of crediting the affiliate.
 
 
 
===Manually Adding a Commission===
 
 
 
Sometimes it might be necessary to give commission to an affiliate without any order. For example, this could be a special commission bonus, or an import of a commission balance from another affiliate system. To do this, open the affiliates page (see Managing Affiliates, above) and click the '''Commissions History tab'''. You can then enter the details of the commission under the '''Add Manual Commission Entry'''' heading. If the commission relates to an existing referral, you may select it from the 'Related Referral' menu. Otherwise, leave it as 'None'.
 
 
 
==Affiliates Cookie ==
 
 
 
The affiliates cookie lasts for 3 Months on the user's computer by default. You can change the cookie duration by editing the aff.php file.
 
 
 
 
Line 24 controls the creation of the cookie and how long it lasts:
 
Line 24 controls the creation of the cookie and how long it lasts:
 +
 
<source lang="php">
 
<source lang="php">
 
Cookie::set('AffiliateID',$aff,'3m');
 
Cookie::set('AffiliateID',$aff,'3m');
 
</source>
 
</source>
 
+
When editing this line, only alter the final argument. (<tt>3m</tt>)
+
When editing this line, only alter the final argument (<tt>3m</tt>).
 
+
The final argument defines the lifetime of the cookie using [http://php.net/manual/en/function.time.php PHP Timestamps]. For convenience, we offer a helper when defining months. When you require months, specify the number of months and append "<tt>m</tt>" as in the example above.
+
The final argument defines the lifetime of the cookie using [http://php.net/manual/en/function.time.php PHP Timestamps]. For convenience, we offer a helper when defining months. When you require months, specify the number of months and append <tt>m</tt> as in the example above.
 
+
We have provided some common examples of commonly-used lifetimes below:
+
The following examples are commonly-used lifetimes:
 
+
1 Day:
+
===== One Day =====
 +
 
<source lang="php">
 
<source lang="php">
 
Cookie::set('AffiliateID', $aff, time() + (24*60*60));
 
Cookie::set('AffiliateID', $aff, time() + (24*60*60));
 
</source>
 
</source>
 
+
7 Days:
+
===== Seven Days =====
 +
 
<source lang="php">
 
<source lang="php">
 
Cookie::set('AffiliateID', $aff, time() + (7*24*60*60));
 
Cookie::set('AffiliateID', $aff, time() + (7*24*60*60));
 
</source>
 
</source>
 
+
14 Days:
+
===== Fourteen Days =====
 +
 
<source lang="php">
 
<source lang="php">
 
Cookie::set('AffiliateID', $aff, time() + (14*24*60*60));
 
Cookie::set('AffiliateID', $aff, time() + (14*24*60*60));
 
</source>
 
</source>
 
+
1 Month:
+
===== One Month =====
 +
 
<source lang="php">
 
<source lang="php">
 
Cookie::set('AffiliateID', $aff, '1m');
 
Cookie::set('AffiliateID', $aff, '1m');
 
</source>
 
</source>
 
+
 
==Multi Currency==
+
== Affiliate System Commission Logic ==
 
+
When you select the %age it will pay x% of whatever currency the user pays you in and convert it to the affiliates' currency, it will use the current exchange rate. If you select to pay a fixed amount, it pays the same amount in any currency.
+
The affiliate system uses the following logic when processing commissions:
 
+
The system converts the Affiliate Bonus Deposit amount and Affiliate Payout Amount into the client's currency.
+
=== Setup Fees ===
 
+
==Making a Withdrawal (Paying Commission)==
+
If there is a setup fee, the initial commission will include it. Then, the system bases recurring commissions on the product's '''[[Payments_and_Services#Pricing|Recurring Amount]]'''.
 
+
When an affiliate's balance reaches the affiliate payout amount a request withdrawal button appears on the client's affiliate page. If they click that to submit a request, it will open a ticket notifying you of their request.
+
=== Promotions ===
 
+
To process the withdrawal request, navigate to the affiliates management page for the affiliate in question and select the '''Withdrawals History''' tab. There you will see a form for making a withdrawal payout. This allows you to enter the withdrawal onto the system, automatically deducting the specified amount from the users affiliate balance, and performing some additional actions for the Payout Type selection from the options below:
+
If a referred client uses a promotional code when signing up and you have configured a percentage commission, the system will reduce the value of the commission. If you have configured a fixed amount commission, they will still receive the full commission.
 
+
*'''Create Transaction to Client''' — This will automatically create an expenditure transaction on the clients account in WHMCS to reduce your profit figures for the client (you must still actually make the payment manually - Cheque, PayPal, etc...)
+
For example, if someone uses an affiliate's ''three months free'' promotional code, the affiliate gets the commission based on the first payment amount. Then, they receive recurring amounts according to the product's settings. In this example, the affiliate would receive a percentage of ''zero'' for the first three months.
*'''Add Amount to Credit Balance''' — This will automatically create a credit on the clients account equal to the value of the withdrawal amount to be applied to the future invoices they receive from you
+
 
*'''Record in Withdrawals Only''' — This just makes a record of the withdrawal in the affiliates area and doesn't create any transaction or credit.
+
=== Product Upgrades and Downgrades ===
 
+
There may be occasions when it is necessary to manually give a client commission (for example, if you handled an order outside of WHMCS or you've imported data from another billing system and want to transfer their affiliate balance across). This is when you use the '''Add Manual Commission Entry''' section on the Commissions History tab. You can also select a ''Related Referral'' if the commission relates to a specific referral; leave the field as "None" if you are adding a general commission.
+
If a referred client upgrades or downgrades their product, the system will adjust the affiliate's future commissions to match the price of the new product.
 +
 +
* This won't affect commission payments that the affiliate has already earned.
 +
* There is no commission on the upgrade or downgrade order itself.
 +
* This does not apply to one-time commissions.
 +
 +
=== Multi Currency ===
 +
 +
When you pay percentage commissions, WHMCS will convert the value in the purchaser's currency to the affiliate's currency using the current exchange rate. If you select to pay a fixed amount, it pays the same amount in any currency.
 +
 +
The system converts the '''Affiliate Bonus Deposit''' amount and '''Affiliate Payout Amount''' into the affiliate's currency.

Revision as of 18:21, 13 September 2021

Affiliates help generate revenue by referring customers to your business. WHMCS includes a comprehensive affiliate system with support for one-time and recurring commissions, either in percentages or fixed values. It also includes payout delays, minimum withdrawal limits, and live statistics and information for affiliates in the Client Area. See the #Configuration section below for steps to enable affiliate status for a client.

Affiliates earn commission for products and services (including configurable options) only. They can't earn commission on:

  • Domain names.
  • Product Addons.
  • Upgrade orders.
    Note:
    Any recurring commissions will increase with new renewal prices.
  • Manually-created invoices.
  • Usage billing, invoiced in a arrears.

Affiliate System Configuration

To configure the affiliates system, go to Configuration () > System Settings > General Settings or, prior to WHMCS 8.0, Setup > General Settings. Then, select the Affiliates tab.

  • These settings allow you to configure how commission is earned, whether to offer bonuses, payout amounts, and whether to apply delay periods or allow commission reversals.
  • For recommendations and descriptions of each setting, see Affiliate Tab.

Overriding Configuration Settings

You can overide these settings on a per-client basis and set a specific commission rate for an individual affiliate at Clients > Manage Affiliates.

You can override these settings on a per-product basis when you configure a product at Configuration () > System Settings > Products/Services or, prior to WHMCS 8.0, Setup > Product/Services in the Other tab.

Delays and Reversals

WHMCS includes tools to help you prevent losses due to disputes, cancellations, or refunds on transactions for which you pay commissions.

The Affiliate Commission Delay setting at Configuration () > System Settings > General Settings helps you avoid this by delaying commission payment for a set number of days after the transaction.

  • This setting applies to commissions for both initial orders and renewals.
  • At the time of payment, the affiliate's Pending Commissions Balance will increase by the amount of commission for the order but their Available to Withdraw Balance will not.
  • WHMCS only awards commission if the product or service is in the Active status when payout would occur according to your settings.
    • This is either at the end of the delay period or, if you did not set a delay period, immediately.
    • If it is in another status, the commission will be removed and can only be awarded manually.

In WHMCS 8.3 and later, you can also perform reversals on commission.

  • WHMCS can reverse commissions when you refund the invoice that incurred the affiliate commission.
    • When you perform a full refund, WHMCS automatically reverses all of the associated commissions.
    • When you perform a partial refund, you can choose whether to also reverse the commission. You cannot, however, choose an amount of the commission to reverse. Reversing the commission must reverse the entire amount.
  • If you choose not to perform a commission reversal, the commission payment will not be affected.

Note:
If you paid a commission before upgrading to WHMCS 8.3, WHMCS will not present the option to reverse commissions.

Working with Affiliates

Before a client can receive commissions, they must become an activated affiliate.

  • You can activate affiliates in their client profile's Summary tab. To do this, navigate to the client profile Summary tab and click Activate as Affiliate under Other Actions.
  • After you have enabled the affiliate system as described above, clients can also activate affiliate status for themselves in the Client Area.

Managing Affiliates

To view and manage affiliates and create manual commission payments and withdrawals, go to Clients > Manage Affiliates. For more information, see Managing Affiliates.

Note:
You must also configure the settings in the #Affiliate System Configuration section above. Otherwise, affiliate information will not display in the Client Area and the affiliate system will not function.

Assigning an Affiliate to an Existing Order

To assign an affiliate to an existing referral-free order that contains a service:

  1. Go to Orders > List.
  2. Locate the order you want to assign to the affiliate.
  3. Click the Order ID number to open the details for that order.
  4. Click Manual Assign in the Affiliate section.
  5. From the menu that appears, select the affiliate to assign to the order. Alternately, start typing the name of the desired affiliate.
  6. Click Save.

Paying Commission for a Paid Order

You may wish to apply an affiliate to an order after it is paid, in which case the affiliate has missed the initial commission for that order.

To correct this:

  1. Use the steps above to assign the affiliate to the order.
  2. Go to Clients > Manage Affiliates.
  3. In the Referrals tab, click Manual Payout for that order.

WHMCS will perform the necessary steps to credit the affiliate.

Affiliate Codes and Links

WHMCS generates a unique code for each affiliate to use on their website. For example:

https://www.example.com/aff.php?aff=001

Clicking this link takes customers to your site and saves a cookie on their computers. If a visitor places an order for a product or service with the cookie present, the affiliate will earn a commission. By default, the cookie persists for three months.

Affiliate Linking Code

You can specify Affiliate Link code in the Affiliates tab at Configuration () > System Settings > General Settings or, prior to WHMCS 8.0, Setup > General Settings. For example:

 <a href="[AffiliateLinkCode]"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br>
 <(a href="[AffiliateLinkCode]")><(img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)><br><br>
 <a href="[AffiliateLinkCode]"><img src="http://www.yourcompany.com/banners/120x60banner.gif" width="120" height="60" border="0"></a><br>
 <(a href="[AffiliateLinkCode]")><(img src="http://www.yourcompany.com/banners/120x60banner.gif" width="120" height="60" border="0")><(/a)><br><br>

If you enter this code, it will display the image preview of the banner first and then the code below it for the affiliate to use. The <( and )> are parts of a special syntax that you must use to ensure that the code is not executed as HTML. WHMCS modifies this during display to cause it to appear as normal HTML.

You can add advanced link code directly to the affiliates.tpl template file in your active template folder using the {$referrallink} template field wherever you want to include the affiliate's unique referral URL.

For more information about linking to WHMCS, see Linking to WHMCS.

Linking to a Product Group

You can link directly to the order form for a specific product group. To do this, append &gid=x to the end of the [AffiliateLinkCode], where x is the ID of the product group. For example:

<a href="[AffiliateLinkCode]&gid=2"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br> <(a href="[AffiliateLinkCode]&gid=2")><(img src=http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)>

Linking to a Product

You can link directly to the order form for a specific product. To do this, append &pid=x to the end of the [AffiliateLinkCode], where x is the product ID. For example:

<a href="[AffiliateLinkCode]&pid=2"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br> <(a href="[AffiliateLinkCode]&pid=2")><(img src=http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)>

Linking to the Cart

You can link directly to the cart. To do this, append &gocart=true to the end of the [AffiliateLinkCode]. For example:

<a href="[AffiliateLinkCode]&gocart=true"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br> <(a href="[AffiliateLinkCode]&gocart=true")><(img src=http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)>

Linking to the Registration Form

You can link directly to the registration form. To do this, append &register=true to the end of the [AffiliateLinkCode]. For example:

<a href="[AffiliateLinkCode]&register=true"><img src="http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0"></a><br> <(a href="[AffiliateLinkCode]&register=true")><(img src=http://www.yourcompany.com/banners/468x60banner.gif" width="468" height="60" border="0")><(/a)>

Affiliate Cookies

The affiliate link cookie lasts for three months on the user's computer by default. You can change the cookie duration by editing the aff.php file.

Line 24 controls the creation of the cookie and how long it lasts:

Cookie::set('AffiliateID',$aff,'3m');

When editing this line, only alter the final argument (3m).

The final argument defines the lifetime of the cookie using PHP Timestamps. For convenience, we offer a helper when defining months. When you require months, specify the number of months and append m as in the example above.

The following examples are commonly-used lifetimes:

One Day
Cookie::set('AffiliateID', $aff, time() + (24*60*60));
Seven Days
Cookie::set('AffiliateID', $aff, time() + (7*24*60*60));
Fourteen Days
Cookie::set('AffiliateID', $aff, time() + (14*24*60*60));
One Month
Cookie::set('AffiliateID', $aff, '1m');

Affiliate System Commission Logic

The affiliate system uses the following logic when processing commissions:

Setup Fees

If there is a setup fee, the initial commission will include it. Then, the system bases recurring commissions on the product's Recurring Amount.

Promotions

If a referred client uses a promotional code when signing up and you have configured a percentage commission, the system will reduce the value of the commission. If you have configured a fixed amount commission, they will still receive the full commission.

For example, if someone uses an affiliate's three months free promotional code, the affiliate gets the commission based on the first payment amount. Then, they receive recurring amounts according to the product's settings. In this example, the affiliate would receive a percentage of zero for the first three months.

Product Upgrades and Downgrades

If a referred client upgrades or downgrades their product, the system will adjust the affiliate's future commissions to match the price of the new product.

  • This won't affect commission payments that the affiliate has already earned.
  • There is no commission on the upgrade or downgrade order itself.
  • This does not apply to one-time commissions.

Multi Currency

When you pay percentage commissions, WHMCS will convert the value in the purchaser's currency to the affiliate's currency using the current exchange rate. If you select to pay a fixed amount, it pays the same amount in any currency.

The system converts the Affiliate Bonus Deposit amount and Affiliate Payout Amount into the affiliate's currency.