Difference between revisions of "Data Feeds"

From WHMCS Documentation

Line 9: Line 9:
 
===Product Names===
 
===Product Names===
  
<script language="javascript" src="feeds/productsinfo.php?pid=1&get=name"></script>
+
<source lang="php">
 +
<script language="javascript" src="feeds/productsinfo.php?pid=1&get=name"></script>
 +
</source>
  
 
===Product Descriptions===
 
===Product Descriptions===
  
<script language="javascript" src="feeds/productsinfo.php?pid=1&get=description"></script>
+
<source lang="php">
 +
<script language="javascript" src="feeds/productsinfo.php?pid=1&get=description"></script>
 +
</source>
  
 
===Product Pricing===
 
===Product Pricing===
  
<script language="javascript" src="feeds/productsinfo.php?pid=1&get=price
+
<source lang="php">
&billingcycle=monthly"></script>
+
<script language="javascript" src="feeds/productsinfo.php?pid=1&get=price&billingcycle=monthly"></script>
 +
</source>
 +
 
 +
===Product Pricing and Currency===
 +
 
 +
<source lang="php">
 +
<script language="javascript" src="feeds/productsinfo.php?pid=1&get=price&billingcycle=monthly&currency=2"></script>
 +
</source>
  
 
===Domain Pricing Table===
 
===Domain Pricing Table===
  
<style type="text/css">
+
<source lang="php">
table.domainpricing {
+
<style type="text/css">
    width: 600px;
+
table.domainpricing {
    background-color: #ccc;
+
    width: 600px;
}
+
    background-color: #ccc;
table.domainpricing th {
+
}
    padding: 3px;
+
table.domainpricing th {
    background-color: #efefef;
+
    padding: 3px;
    font-weight: bold;
+
    background-color: #efefef;
}
+
    font-weight: bold;
table.domainpricing td {
+
}
    padding: 3px;
+
table.domainpricing td {
    background-color: #fff;
+
    padding: 3px;
    text-align: center;
+
    background-color: #fff;
}
+
    text-align: center;
</style>
+
}
<script language="javascript" src="feeds/domainpricing.php"></script>
+
</style>
 +
<script language="javascript" src="feeds/domainpricing.php"></script>
 +
</source>
  
 
===Individual TLD Pricing===
 
===Individual TLD Pricing===
  
<script language="javascript" src="feeds/domainprice.php?tld=.com&type=register
+
<source lang="php">
&regperiod=1&format=1"></script>
+
<script language="javascript" src="feeds/domainprice.php?tld=.com&type=register &regperiod=1&format=1"></script>
 +
</source>
  
 
===Domain Checker Form===
 
===Domain Checker Form===
  
<script language="javascript" src="feeds/domainchecker.php"></script>
+
<source lang="php">
 +
<script language="javascript" src="feeds/domainchecker.php"></script>
 +
</source>

Revision as of 15:12, 19 September 2014

The Data Feeds in WHMCS are a dynamic way for extracting data from WHMCS for use on the pages of your website.

They allow you to get information out of WHMCS such as product names, descriptions and pricing in real-time, onto the static pages of your site, so that if ever make a change inside WHMCS it will auto update on your website.

Examples

The below code samples are ready to be simply copy & pasted into your webpage. The variables in the requests such as the product IDs and TLDs can be set as required.

Product Names

<script language="javascript" src="feeds/productsinfo.php?pid=1&get=name"></script>

Product Descriptions

<script language="javascript" src="feeds/productsinfo.php?pid=1&get=description"></script>

Product Pricing

<script language="javascript" src="feeds/productsinfo.php?pid=1&get=price&billingcycle=monthly"></script>

Product Pricing and Currency

<script language="javascript" src="feeds/productsinfo.php?pid=1&get=price&billingcycle=monthly&currency=2"></script>

Domain Pricing Table

<style type="text/css">
table.domainpricing {
    width: 600px;
    background-color: #ccc;
}
table.domainpricing th {
    padding: 3px;
    background-color: #efefef;
    font-weight: bold;
}
table.domainpricing td {
    padding: 3px;
    background-color: #fff;
    text-align: center;
}
</style>
<script language="javascript" src="feeds/domainpricing.php"></script>

Individual TLD Pricing

<script language="javascript" src="feeds/domainprice.php?tld=.com&type=register &regperiod=1&format=1"></script>

Domain Checker Form

<script language="javascript" src="feeds/domainchecker.php"></script>