<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ClickBank Blog &#187; programming</title>
	<atom:link href="http://www.clickbank.com/blog/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.clickbank.com/blog</link>
	<description>Affiliate Powered E-Commerce, Worldwide</description>
	<lastBuildDate>Tue, 16 Mar 2010 17:40:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using ClickBank Instant Notification</title>
		<link>http://www.clickbank.com/blog/2008/10/02/using-clickbank-instant-notification/</link>
		<comments>http://www.clickbank.com/blog/2008/10/02/using-clickbank-instant-notification/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 22:47:49 +0000</pubDate>
		<dc:creator>Beau Blackwell, ClickBank</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Clickbank Instant Notifications]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.clickbank.com/blog/?p=85</guid>
		<description><![CDATA[
			
				
			
		
Posted by: Greg Lems, Director of Application Development
Please note: This post is intended for readers with some experience in programming and Internet servers.

I read once that in the very early days of Amazon.com, Jeff Bezos and his engineers had wired up their server to make a cash-register &#8220;ka-ching!&#8221; sound every time they made a sale.  [...]


Take a look at these related posts:<ol><li><a href='http://www.clickbank.com/blog/2008/08/08/operate-in-real-time-with-the-clickbank-api/' rel='bookmark' title='Permanent Link: Operate in Real Time with the ClickBank API'>Operate in Real Time with the ClickBank API</a></li>
<li><a href='http://www.clickbank.com/blog/2010/02/03/important-changes-to-product-test-process-for-vendors/' rel='bookmark' title='Permanent Link: Important Changes to Product Test Process for Vendors'>Important Changes to Product Test Process for Vendors</a></li>
<li><a href='http://www.clickbank.com/blog/2008/04/24/the-power-of-data/' rel='bookmark' title='Permanent Link: The Power of Data'>The Power of Data</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.clickbank.com%2Fblog%2F2008%2F10%2F02%2Fusing-clickbank-instant-notification%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.clickbank.com%2Fblog%2F2008%2F10%2F02%2Fusing-clickbank-instant-notification%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Posted by: Greg Lems, Director of Application Development</p>
<p><em>Please note: This post is intended for readers with some experience in programming and Internet servers.</em><!--[if gte mso 9]><xml> Normal   0         false   false   false                             MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><xml> </xml><![endif]--><!--[if gte mso 10]></p>
<p><mce:style><!  &nbsp;/* Style Definitions */ &nbsp;table.MsoNormalTable &nbsp;{mso-style-name:"Table Normal"; &nbsp;mso-tstyle-rowband-size:0; &nbsp;mso-tstyle-colband-size:0; &nbsp;mso-style-noshow:yes; &nbsp;mso-style-parent:""; &nbsp;mso-padding-alt:0in 5.4pt 0in 5.4pt; &nbsp;mso-para-margin:0in; &nbsp;mso-para-margin-bottom:.0001pt; &nbsp;mso-pagination:widow-orphan; &nbsp;font-size:10.0pt; &nbsp;font-family:"Times New Roman"; &nbsp;mso-ansi-language:#0400; &nbsp;mso-fareast-language:#0400; &nbsp;mso-bidi-language:#0400;} --></p>
<p><!--[endif]--></p>
<p>I read once that in the very early days of Amazon.com, Jeff Bezos and his engineers had wired up their server to make a cash-register &#8220;ka-ching!&#8221; sound every time they made a sale.  As business picked up, they had to turn it off because it was going off all the time!  It got me thinking whether a fun little widget like this might be something that ClickBank publishers and affiliates are interested in.</p>
<p>To build something that performs an action with each sale, you can use ClickBank Instant Notifications, a feature we enabled earlier this year.  This post is about using this ClickBank feature.  It assumes that the reader has experience with programming and Internet servers.</p>
<p><span id="more-85"></span><strong>How ClickBank Instant Notification Works</strong></p>
<p>ClickBank Instant Notification works like this:</p>
<ol>
<li>A customer purchases a product for which you are the affiliate or publisher</li>
<li>ClickBank posts a notification to a URL you specify in your account</li>
<li>You respond with an HTTP 200 response code (&#8221;OK&#8221;) to acknowledge receipt of the information.</li>
</ol>
<p>This occurs not only for sales, but other actions that can occur on a transaction, such as refunds, chargebacks, cancellations of subscriptions, etc.</p>
<p>Assuming you have an Internet server that can listen to these requests, you can install code to respond to these requests and perform actions.</p>
<p><strong>Security is Important to ClickBank</strong></p>
<p>To ensure security of your ClickBank Instant Notifications, you can choose to have your requests sent by https.  Also, with every ClickBank Instant Notification we send along an encrypted string called &#8220;cverify&#8221; which only you (the account holder) can decrypt to ensure that someone isn&#8217;t sending you false ClickBank Instant Notifications.</p>
<p><strong>Enabling Instant Notification</strong></p>
<p>The first step to enabling Instant Notification is to log into your ClickBank account, go to your &#8220;My Site&#8221; page, and click &#8220;Edit&#8221; in the &#8220;Advanced Tools&#8221; box.  A link to request access to Instant Notification will appear. Click that link and follow the instructions. You will enter a URL where you&#8217;d like ClickBank to send your instant notifications.</p>
<p><strong>Writing Code to Process Instant Notifications</strong></p>
<p>Now that notifications are enabled, you need to create a script that can process the ClickBank notifications.  This particular snippet is in PHP; however, we also have a Java example in our documentation (see &#8220;Resources&#8221; below).</p>
<p>function cbProcess() {</p>
<p style="padding-left: 30px;">$key=&#8217;YOUR SECRET KEY&#8217;;<br />
$ccustname = $_REQUEST['ccustname'];<br />
$ccustemail = $_REQUEST['ccustemail'];<br />
$ccustcc = $_REQUEST['ccustcc'];<br />
$ccuststate = $_REQUEST['ccuststate'];<br />
$ctransreceipt = $_REQUEST['ctransreceipt'];<br />
$cproditem = $_REQUEST['cproditem'];<br />
$ctransaction = $_REQUEST['ctransaction'];<br />
$ctransaffiliate = $_REQUEST['ctransaffiliate'];<br />
$ctranspublisher = $_REQUEST['ctranspublisher'];<br />
$cprodtype = $_REQUEST['cprodtype'];<br />
$cprodtitle = $_REQUEST['cprodtitle'];<br />
$ctranspaymentmethod = $_REQUEST['ctranspaymentmethod'];<br />
$ctransamount = $_REQUEST['ctransamount'];<br />
$caffitid = $_REQUEST['caffitid'];<br />
$cvendthru = $_REQUEST['cvendthru'];<br />
$cbpop = $_REQUEST['cverify'];</p>
<p style="padding-left: 30px;">//first, calculate whether cverify is properly encrypted</p>
<p style="padding-left: 30px;">$xxpop = sha1(&#8221;$ccustname|$ccustemail|$ccustcc|$ccuststate|$ctransreceipt|&#8221;<br />
.&#8221;$cproditem|$ctransaction|$ctransaffiliate|$ctranspublisher|$cprodtype|&#8221;<br />
.&#8221;$cprodtitle|$ctranspaymentmethod|$ctransamount|&#8221;<br />
.&#8221;$caffitid|$cvendthru|$key&#8221;);</p>
<p style="padding-left: 30px;">$xxpop=strtoupper(substr($xxpop,0,8));</p>
<p style="padding-left: 30px;">if ($cbpop==$xxpop)<br />
{</p>
<p style="padding-left: 60px;">// cbverify was properly encrypted, proceed<br />
if ($ctransaction == &#8216;SALE&#8217;)<br />
{</p>
<p style="padding-left: 90px;">// Make a “CHA-CHING” Sound or perform some action.<br />
// Specific code will be dependent on operating system<br />
return 1;</p>
<p style="padding-left: 60px;">}</p>
<p style="padding-left: 30px;">}<br />
else<br />
{<br />
// cbverify was not properly encrypted, fail<br />
return 0;<br />
}</p>
<p>}</p>
<p><strong>Resources</strong></p>
<p>The best resource available to you to learn more about ClickBank Instant Notifications is the release notes for this feature which are here:</p>
<p><a href="http://www.clickbank.com/help/account-help/account-tools/instant-notification-service/" target="_blank">Instant Notification Service</a></p>
<p>Additionally, if you don&#8217;t want to write your own code, there are products available that do it for you already. Try searching on &#8220;ClickBank Instant Notification&#8221;.</p>


<p>Take a look at these related posts:<ol><li><a href='http://www.clickbank.com/blog/2008/08/08/operate-in-real-time-with-the-clickbank-api/' rel='bookmark' title='Permanent Link: Operate in Real Time with the ClickBank API'>Operate in Real Time with the ClickBank API</a></li>
<li><a href='http://www.clickbank.com/blog/2010/02/03/important-changes-to-product-test-process-for-vendors/' rel='bookmark' title='Permanent Link: Important Changes to Product Test Process for Vendors'>Important Changes to Product Test Process for Vendors</a></li>
<li><a href='http://www.clickbank.com/blog/2008/04/24/the-power-of-data/' rel='bookmark' title='Permanent Link: The Power of Data'>The Power of Data</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.clickbank.com/blog/2008/10/02/using-clickbank-instant-notification/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Operate in Real Time with the ClickBank API</title>
		<link>http://www.clickbank.com/blog/2008/08/08/operate-in-real-time-with-the-clickbank-api/</link>
		<comments>http://www.clickbank.com/blog/2008/08/08/operate-in-real-time-with-the-clickbank-api/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 22:36:51 +0000</pubDate>
		<dc:creator>Beau Blackwell, ClickBank</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[affiliates]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[clickbank]]></category>
		<category><![CDATA[data collection]]></category>
		<category><![CDATA[instant notification]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[publishers]]></category>
		<category><![CDATA[real time]]></category>

		<guid isPermaLink="false">http://www.clickbank.com/blog/?p=66</guid>
		<description><![CDATA[
			
				
			
		
Posted by: Dush Ramachandran, VP of Business Development
 
If you sell or promote digital products through ClickBank, wouldn&#8217;t you like to know where your customers are, and what days of the week and times of day they buy your products? With ClickBank&#8217;s introduction of the Instant Notification API, whether you&#8217;re a publisher or an affiliate [...]


Take a look at these related posts:<ol><li><a href='http://www.clickbank.com/blog/2008/10/02/using-clickbank-instant-notification/' rel='bookmark' title='Permanent Link: Using ClickBank Instant Notification'>Using ClickBank Instant Notification</a></li>
<li><a href='http://www.clickbank.com/blog/2008/04/24/the-power-of-data/' rel='bookmark' title='Permanent Link: The Power of Data'>The Power of Data</a></li>
<li><a href='http://www.clickbank.com/blog/2008/09/11/save-more-sales/' rel='bookmark' title='Permanent Link: Save More Sales'>Save More Sales</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.clickbank.com%2Fblog%2F2008%2F08%2F08%2Foperate-in-real-time-with-the-clickbank-api%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.clickbank.com%2Fblog%2F2008%2F08%2F08%2Foperate-in-real-time-with-the-clickbank-api%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Posted by: Dush Ramachandran, VP of Business Development</p>
<p><!--[if gte mso 9]><xml> Normal   0         false   false   false                             </p>
<p>MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><xml> </xml><![endif]--> <!--[if </p>
<p>gte mso 10]></p>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<p><![endif]--></p>
<p>If you sell or promote digital products through ClickBank, wouldn&#8217;t you like to know where your customers are, and what days of the week and times of day they buy your products? With ClickBank&#8217;s introduction of the Instant Notification API, whether you&#8217;re a publisher or an affiliate you can do all that and more.</p>
<p>The Instant Notification API, or application program interface, provides a way by which information captured at the time of purchase can be provided by the ClickBank system to another computer. If you are signed up to receive instant notifications, you can set up a program on your computer to receive the information that ClickBank sends as soon as a transaction takes place.</p>
<p>Ordinarily, this transaction information is sent to publishers by means of a notification email, which needs to be parsed in order to collect this data. With the API, all of this same information can be collected instantaneously, as each transaction occurs. Additionally, now affiliates can also gather this transaction data as the sale occurs, which was previously only possible for publishers.</p>
<p>With the API and a corresponding data collection program in place on your computer, you can easily determine from which country or zip code most of your sales originate and direct your advertising efforts to media in those markets. You can analyze the times of day that are most popular with your customers and use day part bidding, or Ad Scheduling as Google refers to it (covered in an earlier <a href="http://www.clickbank.com/blog/2008/07/28/advertising-strategy-daypart-bidding/" target="_blank">post by Beau Blackwell</a>), to show your ads at the times when your customers are most likely to see them and make a purchase.</p>
<p>Publishers with multiple accounts can take instant notifications from all their accounts and have the day&#8217;s sales aggregated and displayed, showing sales for all of their products across various geographical locations and time zones. Since the API will output information on all transactions, including sales, refunds and chargebacks, this capability can give you a minute-to-minute update on the status of your business through ClickBank.</p>
<p>Please be aware that this service is intended for use by experienced programmers. If you don&#8217;t have extensive programming skills, you should consider enlisting the services of a programmer to help you take advantage of the Instant Notification API.</p>
<p>Be sure to <a href="http://www.clickbank.com/20080219_release_summary.html" target="_blank">check out details on the Instant Notification API </a>and explore how it can give you a better handle on your business.</p>


<p>Take a look at these related posts:<ol><li><a href='http://www.clickbank.com/blog/2008/10/02/using-clickbank-instant-notification/' rel='bookmark' title='Permanent Link: Using ClickBank Instant Notification'>Using ClickBank Instant Notification</a></li>
<li><a href='http://www.clickbank.com/blog/2008/04/24/the-power-of-data/' rel='bookmark' title='Permanent Link: The Power of Data'>The Power of Data</a></li>
<li><a href='http://www.clickbank.com/blog/2008/09/11/save-more-sales/' rel='bookmark' title='Permanent Link: Save More Sales'>Save More Sales</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.clickbank.com/blog/2008/08/08/operate-in-real-time-with-the-clickbank-api/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
