Difference between revisions of "Affiliates"

From WHMCS Documentation

(Added Multi Currency)
 
(87 intermediate revisions by 10 users not shown)
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. So 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 stats/info 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.  
  
==Configuration==
+
You can access this feature at '''Clients > [[Manage Affiliates]]'''.
  
To configure the affiliates system, go to Configuration > General Settings and then click the Affiliates tab.  From here you can set the initial bonus deposit amount, the minimum withdrawal level, the payout delay and the percentage to payout.
+
== Commissions ==
  
==Commission Settings==
+
Affiliates earn commission for products and services (including configurable options) only. They can't earn commission on:
 +
 +
* Domain names.
 +
* [[Product Addons]].
 +
* Upgrade orders. <div class="docs-alert-info">Any recurring commissions will increase with new renewal prices.</div>
 +
* Manually-created invoices.
 +
* [[Usage_Billing|Usage billing]], invoiced in a arrears. 
 +
 +
== Affiliate System Configuration ==
  
In the General Config you can set the default commission percentage that applies to all products & services.  You can however overide this on a per product basis in the product configuration area setting.  You can then overide the commission settings furthur on a per client basis and set a specific commission rate for an individual affiliate, useful for rewarding your best affiliates.
+
Before you can use the affiliate system, you must:
  
==Payout Delays==
+
* Configure the settings in the '''[[Affiliates_Tab|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'''.
 +
* Activate affiliate status for the desired clients in the [[Clients:Summary_Tab|client profile '''Summary''' tab]].
  
With the payout delay setting you can set a period of time to delay paying commission to an affiliate.  This is an advanced feature and the idea behind this is to reduce losing money paying commissions for fraudulent orders.  The way it works is that instead of paying commission instantly when you are paid, it waits for a period of days and then only pays the commission should the product or service still be active after that period of time has passed.
+
=== Setting Overrides ===
 +
 +
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 in the '''Other''' tab 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'''.
  
==Affiliate Linking Code==
+
=== Setting Commission Per-Product ===
  
You can specify affiliate link code in the config area. Below is an example:
+
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|Products/Services]]''' or, prior to WHMCS 8.0, '''Setup > Product/Services'''.
  
<nowiki>
+
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.
<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>
 
</nowiki>
 
  
The above code entered 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.
+
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 Payout, that setting will override this.
  
==Affiliates Cookie ==
+
=== Setting Commission Per-Client ===
  
The affiliates cookie by default is set to last for 90 days on the users computer. You can change the number of days it lasts for in the aff.php file.
+
To offer a unique commission, click the "'View Affiliate Details'" link on the "client's [[Clients:Summary_Tab|'''Summary''']] tab" and you can set the commission as above. This setting will take priority over all others. However, if you have set either the client or the product commission to One Time Payout, that setting will override this.
 +
 +
=== 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 (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[General Settings]]''' or, prior to WHMCS 8.0, '''Setup > 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">
 +
If you paid a commission before upgrading to WHMCS 8.3, WHMCS will not present the option to reverse commissions.
 +
</div>
  
==Managing Affiliates==
+
== 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 [[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.
 +
 +
=== Managing Affiliates ===
 +
 +
To view and manage affiliates and create manual commission payments and withdrawals, go to '''Clients > [[Manage Affiliates]]'''.
 +
 +
<div class="docs-alert-info">
 +
You '''must''' also configure the settings in the [[#Affiliate System Configuration|Affiliate System Configuration]] section above. Otherwise, affiliate information will ''not'' display in the Client Area and the affiliate system will not function.
 +
</div>
  
To manage affiliates and view their referrals and earning balance, go to Clients > Manage Affiliates. This is the one central location that allows you to manage and view everything affiliate related.
+
=== Assigning an Affiliate to an Existing Order ===
 +
 +
To assign an affiliate to an existing referral-free order that contains a service:
 +
 +
# Go to '''Orders > List'''.
 +
# Locate the order you want to assign to the affiliate.
 +
# Click the '''Order ID''' number to open the details for that order.
 +
# Click '''Manual Assign''' in the '''Affiliate''' section.
 +
# From the menu that appears, select the affiliate to assign to the order. Alternately, start typing the name of the desired affiliate.
 +
# Click '''Save'''.
  
==Assigning an Affiliate to an Existing Order==
+
=== Unassigning an Affiliate from an Order ===
 +
 +
To unassign an affiliate from an order:
 +
 +
# Visit '''Clients > Manage Affiliates'''.
 +
# Select the order's assigned affiliate.
 +
# Select the '''Referred Signups''' tab.
 +
# Delete the relevant signup using the red button on the right hand side.
 +
You can now assign the order to another affiliate using the [[#Assigning_an_Affiliate_to_an_Existing_Order|Assigning an Affiliate to an Existing Order]] section above.
 +
 +
=== 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:
 +
 +
# 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>
  
To assign an affiliate to an order which has already been placed and shows no referral, go to Orders > List and locate the order you want to assign to the affiliate.  Once located, click on the Order ID number to open the details for that order.  Scroll down to the Affiliate Referral section at the bottom of the page and then choose the Affiliate you want to assign the order to and click Submit to apply it.
+
Affiliates can obtain their unique link via the Client Area. To view the link, they can log in to the Client Area and click '''Affiliates''' in the main menu.  
  
==Paying Commission for an already paid order==
+
When a visitor follows an affiliate link, the system will redirect them to the URL that you specified for '''Domain''' in the '''[[General_Tab|General]]''' 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''', and will save a cookie in their browser. If the 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|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">
 +
<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>
 +
</source>
 +
 +
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.
 +
 +
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.
 +
 +
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 <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">
 +
<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>
 +
 +
=== Linking to a Product ===
 +
 +
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">
 +
<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>
 +
 +
=== Linking to the Cart ===
 +
 +
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">
 +
<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>
 +
 +
=== Linking to the Registration Form ===
 +
 +
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">
 +
<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>
  
There may be some instances where you apply an affiliate to an order after it has been paid for and that would mean the affiliate has then missed out on the initial commission for that orderTo 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 affilate, click the "Manual Payout" button next to the new account. That will perform the equivalent action of an invoice being paid by the end user for a referred order in terms of crediting the affiliate.
+
== 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 <tt>aff.php</tt> file.
 +
   
 +
Line 24 controls the creation of the cookie and how long it lasts:
 +
 +
<source lang="php">
 +
Cookie::set('AffiliateID',$aff,'3m');
 +
</source>
 +
 +
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 following examples are commonly-used lifetimes:
 +
 +
===== One Day =====
 +
 +
<source lang="php">
 +
Cookie::set('AffiliateID', $aff, time() + (24*60*60));
 +
</source>
 +
 +
===== Seven Days =====
 +
 +
<source lang="php">
 +
Cookie::set('AffiliateID', $aff, time() + (7*24*60*60));
 +
</source>
 +
 +
===== Fourteen Days =====
 +
 +
<source lang="php">
 +
Cookie::set('AffiliateID', $aff, time() + (14*24*60*60));
 +
</source>
 +
 +
===== One Month =====
 +
 +
<source lang="php">
 +
Cookie::set('AffiliateID', $aff, '1m');
 +
</source>
 +
 
 +
== 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 '''[[Products_and_Services#Pricing Recurring Amount|pricing recurring amount]]'''.
  
==Multi Currency==
+
=== Promotions ===
When you select the %age it will pay x% of whatever currency the user pays you in and convert it to the affiliates' currency using the current exchange rate. If you select to pay a fixed amount that will be paid the same amount in any currency.
+
 +
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.

Latest revision as of 17:02, 7 April 2023

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.

You can access this feature at Clients > Manage Affiliates.

Commissions

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

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

Affiliate System Configuration

Before you can use the affiliate system, you must:

Setting Overrides

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 in the Other tab at Configuration () > System Settings > Products/Services or, prior to WHMCS 8.0, Setup > Product/Services.

Setting Commission Per-Product

To offer a higher commission on a certain product, edit the product and go to the Other tab at Configuration () > System Settings > Products/Services or, prior to WHMCS 8.0, Setup > Product/Services.

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.

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 Payout, that setting will override this.

Setting Commission Per-Client

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. This setting will take priority over all others. However, if you have set either the client or the product commission to One Time Payout, that setting will override this.

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 or, prior to WHMCS 8.0, Setup > 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.

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.

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.

Unassigning an Affiliate from an Order

To unassign an affiliate from an order:

  1. Visit Clients > Manage Affiliates.
  2. Select the order's assigned affiliate.
  3. Select the Referred Signups tab.
  4. Delete the relevant signup using the red button on the right hand side.

You can now assign the order to another affiliate using the Assigning an Affiliate to an Existing Order section above.

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

Affiliates can obtain their unique link via the Client Area. To view the link, they can log in to the Client Area and click Affiliates in the main menu.

When a visitor follows an affiliate link, the system will redirect them to the URL that you specified for Domain in the General tab at Configuration () > System Settings > General Settings or, prior to WHMCS 8.0, Setup > General Settings, and will save a cookie in their browser. If the 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 pricing 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.