Jump to: navigation, search

Linking to your WHMCS system, be it a login link for the client area, a shortcut to a ticket submission form or an order form purchase link, is probably one of the first things you'll want to do. And it's both very easy, and very flexible with WHMCS. In this article we demonstrate some of the common links & techniques you might want to make use of.

For integrating a domain availability check, login form or domain purchase link, please refer to Utilities > Integration Code within your WHMCS admin area for "copy & paste" ready code. You may also want to refer to the Data Feeds functionality.

Order Links

You can obtain direct order links for products from the product configuration screen under Setup > Products/Services > Products/Services > Edit > Links tab. A direct order link takes the user straight into step two of the order process with the product or service preselected. This is used for order links on your site for specific products. The link looks something like this:


To link to the order process with a given product and annual billing cycle preselected, you can use a link like this:


To link to the order process with a domain preselected, you can use a link like this:


To link to the order process with a subdomain preselected, you can use a link like this:


To automatically apply a promotion code to the order, you can append &promocode=xxxx to any of the cart links, but on it's own the link would look like this:


You can also link directly to an individual product group like this where the gid is the ID of the group to show:


To link to the cart and specify a specific order form template to use, the link would be like this where boxes is the template to display:


To link to a Product Bundle where bid is the ID of the bundle use:


Configurable Options

There are many further options you can use, such as your own configurable options. The simplest way of formulating a url is to step through the order process as normal to the product configuration step, then right click > view source and get the field names and value IDS. These can then be used in your direct link URLs.

For example:

<p class="cartsubheading">Configurable Options</p>
<p>This product/service has some options which you can choose from below to customise your

<div class="cartbox">
<table cellspacing="0" cellpadding="0">
<tr><td>Disk Space:</td><td width="5"></td><td>
<input type="text" name="configoption[1]" value="100" size="5"> x 1MB $0.00USD

You would then use the URL:


This would set the value of the first configurable option to 100.

Custom Fields

Custom product fields are almost exactly the same, the following would pre-fill the custom field option named "Day of Week" with the value "Friday":


It's possible to skip the configuration page entirely provided you have defined all the configuration values in the URL by adding &skipconfig=1 to your order URL. If there is any configuration missing, then this would generate an error and force the client to edit the configuration. eg:


Setting the Language/Template via the URL

You can set the language or template to be displayed to the user with the link you use to WHMCS. Here are some examples:


These can be combined, used on any page and used with the direct order links

Specifying Currency in a link

You can link to the order form pre-selecting a specific currency (and optionally also a language) using a url format as follows:

Selecting Currency ID 1


Selecting Currency ID 2 and the Spanish language


Support Ticket Links

You can link to the create ticket page with a number of predefined settings. All of which are interchangeable:

To define the ticket subject, use a link like this:


You can also go even further and define a name and email address too if you want:

http://demo.whmcs.com/submitticket.php?step=2&deptid=1&name=Jeff&email=[email protected]

Integrating The Login Form into your Website

Please refer to Utilities > Integration Code within your WHMCS admin area for "copy & paste" ready code for adding a clients login form to any page of your site.

Integrating a Domain Availability Check into your Website

Please refer to Utilities > Integration Code within your WHMCS admin area for "copy & paste" ready code for adding a domain lookup form to any page of your site.

It is also possible to link to the domain checker specifying the domain:


Displaying Announcements on your Site

Announcements are available in RSS feed format. This is the recommended way of retrieving and displaying announcements in an external system or page.

For convenience, on a local site, you may wish to retrieve announcements directly from the database. The following code sample demonstrates one possible way of doing this.

require_once 'members/init.php';
$query = "SELECT * FROM tblannouncements WHERE published != '0' AND published != '' ORDER BY date DESC LIMIT 0,3"; 
$result = mysql_query($query);
while ($data = mysql_fetch_array($result)) {
    $id = $data['id'];
    $date = $data['date'];
    $title = $data['title'];
    $announcement = $data['announcement'];
    $date = fromMySQLDate($date);
    echo '<strong>' . $title . '</strong><br />'
        . 'Posted on ' . $date . '<br /><br />'
        . $announcement . '<br /><br />';

This code assumes WHMCS is located in a sub-directory named "members". You should update the file include path for your setup.