One of the benefits of having your own merchant account is the level of integration that it provides.

A payment gateway enables your customers to pay without leaving your website, and there is almost no limit to the ways that you can build specific functionality related to payments that makes business easier for customers and your business.

Fortunately, even if you don't have a merchant account, you can automate a number of things using PayPal's Instant Payment Notification (IPN) system.

PayPal IPN enables PayPal merchants' applications to receive automated notifications about payment status so that these applications can perform whatever functions are desired when specific payment events occur.

Want your website to perform some function once a payment has cleared? Does your application need to know when a PayPal subscription has expired? If so, PayPal IPN is a simple yet powerful solution.

Setting Up IPN

Getting started with IPN is easy thanks to the fact that PayPal provides sample code for, Cold Fusion, Java, Perl and PHP.

The code is extremely straightforward and with minimal modification can serve as a working script.

The PayPal IPN documentation lists the various variables that are sent with IPN notifications as well as the most important variable - the payment events that it provides notification for.

For instance, if you want your script to do something when a payment has been cleared, you will look for the payment_status variable to be "Completed".

If you want to know that a subscription has expired, you will look for the txn_type variable to be "subscr_eot."

By building a script that deals with all of the possible events that are used with the type of payments that you're accepting and the type of business logic you want to have performed automatically when payment events occur, you can build scripts that significantly reduce the amount of manual work that some merchants have in managing PayPal payments.


In addition to its sample code, PayPal links to a number of tutorials showing how to implement IPN-based applications. These are worthwhile to look through.

There is also no shortage of PayPal IPN scripts that can be purchased or commercial solutions that use PayPal IPN. However, the sample code provided by PayPal is satisfactory and unless you have a significantly complex application, should suffice.

Telling PayPal to Use IPN

Once your script is set up, you need to tell PayPal where it's located so that it can send the notifications to it.

The easiest place to do this is in your PayPal order form code.

For instance, if your PayPal IPN script is called ipn.php, add the following hidden form field to your PayPal code:

<input name="notify_url" size="20" type="hidden" value="" />


Implementing PayPal IPN is a great way to automate many activities that PayPal merchants often handle manually and is a decent compromise for merchants not ready to move up to their own merchant accounts.

For merchants looking for a more integrated solution with a complete API similar in nature to those offered by payment gateways and which allows merchants to keep users on their websites throughout the entire order process, PayPal's Website Payments Pro offering is another intermediary solution.


Published 5 September, 2008 by Patrick Oak

82 more posts from this author

You might be interested in

Comments (3)

Andrew Nesbitt

Andrew Nesbitt, Developer at Forward Internet Group

Active Merchant is a great plugin for Ruby on Rails for doing paypal integration too, as created and used by Shopify

almost 10 years ago


Andy Geldman

I like PayPal IPN for its simplicity but you do get more flexibility and functionality with the "proper" API

almost 10 years ago



Paypal IPN has been successfully using as alternative payment method by many Internet merchants. It helps to increase sales at no extra cost & many ecommerce systems are shipped with it. Just enter relevant Paypal parameters in back office (gateway configuration) and start using it on the Web.

about 9 years ago

Save or Cancel

Enjoying this article?

Get more just like this, delivered to your inbox.

Keep up to date with the latest analysis, inspiration and learning from the Econsultancy blog with our free Digital Pulse newsletter. You will receive a hand-picked digest of the latest and greatest articles, as well as snippets of new market data, best practice guides and trends research.