Linking to WHMCS

Linking to WHMCS is one of the first things to do after you set up WHMCS. You can create login or product links for the Client Area, a shortcut to a ticket submission form, or an order form purchase link.

  • For code to add a domain availability check, login form, or domain purchase link to your website, go to Utilities > Integration Code in the Admin Area.
  • You may also want to use data feeds.
The examples below use a WHMCS installation at

You can use the following URLs to link to WHMCS:

AreaExample LinkDescription
Client Area link to the Client Area Homepage, allowing the user to manage their client accounts. If the user has not already authenticated, this link will direct them to a login prompt.
Shopping Cart link to the active shopping cart.
Individual Products direct link to a specific product or to load the product into the cart and take the user directly to configure it.
For more information, see Product Links and Constructing Links below.

You can find the links for each product in the Links tab when you edit the product at Configuration () > System Settings > Products/Services:

The Links tab in Products/Services

You can copy the following direct links for the product and its associated group:

Direct Shopping Cart LinkAdd the product to the shopping cart and direct the visitor to the configuration page.
Direct Shopping Cart Link Specifying TemplateAdd the product to the shopping cart and direct the visitor to the configuration page using the specified order form template.
Direct Shopping Cart Link Including DomainAdd the product to the shopping cart and direct the visitor to the domain selection page.
Product Group Cart LinkDirect the visitor to the product group page.
Product URLsDirect the visitor to the Direct Shopping Cart Link URL and track the number of visits for that URL. Each time that a visitor clicks on one of these URLs, the Visits count will increase.
To delete a Product URL, click the corresponding red delete icon.
  • You cannot delete the active URL.
  • After you delete a product URL, the link will become nonfunctional.
The examples below use the Direct Shopping Cart Link URL for a product.

You can append additional variables and values onto links to customize them:

Variable or ValueDescriptionExample Link
billingcycleLink to a preselected product with an annual billing cycle.
sld and tldLink to a preselected product with a selected domain name (sld) and extension (tld).
domainoption and sldLink to a preselected product with a subdomain.
promocodeLink to the shopping cart and automatically apply a promotion code.
gidLink to a product group using the product group ID (gid).
carttplLink to the shopping cart and specify an order form template to use.
bidLink to a product bundle using the bundle ID (bid).

Configurable Options

You can also create your own configurable options.

To create a configurable option URL:

  1. Step through the order process normally until you reach the product configuration step.
  2. Right click and select View Source.
  3. Retrieve the field names and value IDs. You can use these in your direct link URLs.

For example:

<p class="cartsubheading">Configurable Options</p>
<p>This product or service has some options that you can choose 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[1]=100 as the link URL, setting the value of the first configurable option to 100.

Custom Fields

You can also create your own custom fields using a similar method to creating configurable options.

For example, the following link would prefill the custom field option, the day of the week, with the value Friday:

You can skip the configuration page entirely if you have defined all of the configuration values in the URL by adding &skipconfig=1 to your order URL. If there is missing configuration data, this would generate an error and force the client to edit the configuration. For example:

Custom field names must not contain any special characters other than underscores in order to prefill custom fields within a URL. For example, daté-óf-bírth becomes dateofbirth.


You can link to the order form with preselected addons using a URL like this:[1]

The number is the ID of the addon that you specified.

You can add multiple addons in this format:[1]&addons[2]

Setting the Language or Template via the URL

You can set the language or template to display to the user with the link you use. For example:

You can combine these, use them on any page, and use them with the direct order links.

You can link to the order form with a preselected currency (and, optionally, a language) using a URL like this:

Selecting currency ID 1.
Selecting currency ID 2 and setting the language to Spanish

The ID of a currency is the unique ID for it within the tblcurrencies database table. You can find this within the database or by examing the number at the end of the URL when editing the currency within the Admin Area.

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

Define the ticket subject.
Define a name and email address.

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 method:


    use WHMCS\Database\Capsule;

    require_once 'members/init.php';

    $data = Capsule::table('tblannouncements')
                ->where('published', '!=', '0')
                ->where('published', '!=', '')
                ->orderBy('date', 'DESC')

    foreach ($data as $announcement) {
        $id = $announcement->id;
        $date = $announcement->date;
        $title = $announcement->title;
        $body = $announcement->announcement;

        $date = fromMySQLDate($date);

        echo "<strong>{$title}</strong><br />"
            . "Posted on {$date}<br /><br />"
            . $body . "<br /><br />";

This code assumes that you store WHMCS in the members subdirectory. Update the file include path for your setup.

Last modified: May 28, 2024