Notice of non-liability:
PayPal, Inc. is providing the information in this document to you “AS-IS” with all faults. PayPal, Inc. makes no warranties of any kind (whether express,
implied or statutory) with respect to the information contained herein. PayPal, Inc. assumes no liability for damages (whether direct or indirect), caused
by errors or omissions, or resulting from the use of this document or the information contained in this document or resulting from the application or use
of the product or service described herein. PayPal, Inc. reserves the right to make changes to any information herein without further notice.
This document describes the PayPal features for managing orders, such as Payment Data
Transfer (PDT), Instant Payment Notification (IPN), and Downloadable History Log.
This document is written for merchants who use PayPal to manage order information.
Revision History
TABLE P.1 Revision History
DateDescription
March 2008Corrected the procedure for checking the postback response from PayPal when
performing notification validation of IPNs. See “Using Postbacks for
Validation” on page 27.
January 2008Added information on how to search for contribution payments in transaction
history and what values the Type column in downloadable history logs carries
for donation activity. See Chapter 4, “Transaction History and Reporting Tools.”
September 2007Replaced the old PayPal logo in screen shots with the new PayPal logo
August 2007Added shipping_method to Appendix A, “IPN and PDT Variables”. See the
table of variables for “Website Payments Standard, Website Payments Pro, and
Refund Information” on page 55.
July 2007Minor bug fixing.
April 2007Added contact_phone to IPN variables. Added pointer to PayPal Business
Overview page.
October 2006Details about the Downloadable Dispute Report. Minor additions and
corrections to some variables in Appendix A.
July 2006Minor correction to values of payment_status IPN variable.
May 2006Description of the programmatically retrievable Dispute Report. Additional IPN
variable values for txn_type: merch-pmt for the Website Payments Pro monthly
fee and adjustment for a resolved dispute requiring a chargeback.
Order Management Integration GuideMarch 20087
P
Revision History
8March 2008Order Management Integration Guide
1
Email
Introduction
PayPal offers four payment notification methods for back-end integration:
z Email
z Reporting
z Instant Payment Notification (IPN)
z Payment Data Transfer (PDT)
You will receive an email notification in the following cases:
z Successful Payment
z Pending Payment
z Cancelled Payment
If you do not want to receive payment notifications via email:
1. Click the Profile subtab of the My Account tab.
2. Click the Notifications link in the Account Information column.
3. Find the Payment Notifications heading and clear the I receive PayPal Website
4. Click the Save button.
Reporting
PayPal’s Reporting Tools provide you with the information you need to effectively measure
and manage your business. With PayPal’s Reporting Tools, you can:
z Analyze your revenue sources to better understand your customers’ buying behavior
z Automate time-consuming bookkeeping tasks
z Accurately settle and reconcile transactions
Available reports:
Payments and Instant Purchase checkbox.
z Monthly Account Statements: View a summary of all credits and debits that have affected
your account balance each month.
Order Management Integration GuideMarch 20089
Introduction
1
Differences between Payment Data Transfer (PDT) and Instant Payment Notification (IPN)
z Merchant Sales Reports: Every week, receive valuable analysis of revenue by sales
channel and currency.
z History Log: View an online record of your received and sent payments.
z Downloadable Logs: Keep track of your transaction history by downloading it into
various file formats (suitable for financial settlements).
For more information about PayPal's reports, see
bin/webscr?cmd=p/xcl/rec/reports-intro-outside.
http://www.paypal.com/cgi-
Differences between Payment Data Transfer (PDT) and Instant
Payment Notification (IPN)
PDT's primary function is to display payment transaction details to buyers when they are
automatically redirected back to your site upon payment completion; however, there are cases
where you will not receive notification of all transactions, such as with pending transactions,
refunds, and reversals. For these reasons, or if you are using this data to fulfill orders, PayPal
strongly recommends that you also enable Instant Payment Notification (IPN).
Both IPN and PDT send back the same data; however, there are several important differences.
PDT:
z Is available only to merchants who integrate PayPal with their websites by using Website
Payments Standard.
z Requires Auto Return to be enabled.
z Auto Return will include an ID that can be used to query PayPal for the complete
transaction details.
z It is possible to miss a notification if the user closes the browser before the redirection is
complete.
IPN:
z Does not require Auto Return to be enabled.
z At the end of the website payment flow, PayPal POSTs the IPN data asynchronously (i.e.
not as part of the website payment flow).
z IPNs will also POST for eCheck clearings, reversals, and refunds.
SSL Not Required for IPN
Because credit card and bank information is not transmitted in Instant Payment Notification
(IPN), PayPal does not require Secure Sockets Layer (SSL) to encrypt IPN transmissions.
10March 2008Order Management Integration Guide
PayPal-Supported Transactional Currencies
PayPal-Supported Transactional Currencies
The following currencies are supported by PayPal for use in transactions.
TABLE 1.1 PayPal-Supported Currencies and Currency Codes for Transactions
ISO-4217
CodeCurrency
AUDAustralian Dollar
CADCanadian Dollar
CHFSwiss Franc
CZKCzech Koruna
DKKDanish Krone
EUREuro
GBPPound Sterling
Introduction
1
HKDHong Kong Dollar
HUFHungarian Forint
JPYJapanese Yen
NOKNorwegian Krone
NZDNew Zealand Dollar
PLNPolish Zloty
SEKSwedish Krona
SGDSingapore Dollar
USDU.S. Dollar
Order Management Integration GuideMarch 200811
Introduction
1
PayPal-Supported Transactional Currencies
12March 2008Order Management Integration Guide
Payment Data Transfer (PDT)
2
Merchants who use Website Payments Standard can use Payment Data Transfer (PDT) to
display transaction details to buyers who are redirected back to the merchants’ websites after
they complete their payments.
N OTE: You must enable Auto Return for Website Payments Standard to use Payment Data
Transfer. Auto Return applies to PayPal Website Payments Standard, including Buy
Now, Donation, Subscriptions, Shopping Cart, and Gift Certficate buttons. For more
information about Auto Return, see the PayPal Website Payments Standard Integration
Guide.
How PDT Works
Bob is going to purchase a widget from the Widget Warehouse.
Step 1: Bob goes to the Widget Warehouse website, finds the widget he wants, and clicks the
Buy Now button.
Step 2: Bob is taken to a PayPal Payment Details page which displays the details of the
payment he is about to make.
Order Management Integration GuideMarch 200813
Payment Data Transfer (PDT)
2
How PDT Works
Step 3: Bob enters his PayPal account information into the PayPal Login fields.
Step 4: Bob is then taken to a confirmation page that displays the details of his selection,
information about how his automatic payments will be funded, and his shipping information.
He clicks the Pay button to complete the payment.
14March 2008Order Management Integration Guide
Payment Data Transfer (PDT)
How PDT Works
2
Step 5: A payment confirmation page appears that informs Bob that his payment has been
completed and that he is being redirected back to the Widget Warehouse website.
Order Management Integration GuideMarch 200815
Payment Data Transfer (PDT)
2
How PDT Works
Step 6: A transaction token is passed to the return URL provided by the Widget Warehouse.
The Widget Warehouse fetches the transaction token and retrieves the transaction details from
PayPal via an HTTP POST. Included in the HTTP post is the identity token that was given to
the Widget Warehouse when PDT was enabled.
For more information about the PDT identity token, see “Getting and Using the Identity
Token” on page 18. For more information about the HTTP POST, see “PDT Notification
Synch” on page 19.
Step 7: The Widget Warehouse's Thank You page appears and displays the transaction
information, again informing Bob that his transaction has been completed and a receipt for the
purchase has been sent to him by email. The page also displays payment details, a link to
PayPal that Bob can use to view more transaction details if necessary, as well as links that he
can use to continue shopping.
For example, as shown in the following diagram: Thank you for your payment. Your
transaction has been completed, and a receipt for your purchase has been emailed to you. You
may log into your account at
www.paypal.com to view details of this transaction.
16March 2008Order Management Integration Guide
Payment Data Transfer (PDT)
Enabling Payment Data Transfer
Step 8: Bob receives an email receipt for this transaction, confirming his purchase and
including a copy of the payment details, the Widget Warehouse's business information, and his
confirmed shipping address.
2
Enabling Payment Data Transfer
You can enable PDT from your account profile, and you can enable PDT when you use a
button creation tool on the PayPal website to create payment buttons for Website Payments
Standard.
For more information about enabling PDT from a button creation tool, see the Website
Payments Standard Integration Guide.
To enable PD from your account profile:
Order Management Integration GuideMarch 200817
Payment Data Transfer (PDT)
2
Enabling Payment Data Transfer
1. Click the My Account tab.
2. Click the Profile subtab.
3. Click the Website Payment Preferences link, as shown in the following snapshot.
The Website Payment Preferences page opens.
4. Click the Payment Data Transfer On radio button, as shown in the following diagram.
Yo u must enable Auto Return in order to use Payment Data Transfer. Auto Return can also
be enabled from the Website Payment Preferences page.
5. Click the Save button.
Getting and Using the Identity Token
When you click the Save button and save your PDT preferences, a message appears at the top
of the page indicating that you have successfully saved your preferences. Your identity token
also appears in this message.
You will need to pass this identity token, along with the transaction token, to PayPal in order to
receive information that confirms that a payment is complete.
18March 2008Order Management Integration Guide
For security, the identity token is not sent to you; however, once you have enabled PDT, it
permanently appears below the Payment Data Transfer On/Off radio buttons on the Websit e Payments Preferences page.
PDT and PayPal Account Optional
Payment Data Transfer (PDT)
PDT and PayPal Account Optional
2
The PayPal Account Optional does not require your customers who are new to PayPal to
create a PayPal account to complete a purchase—they go through an alternate checkout and
have the option to sign up afterward. Customers who already have PayPal accounts will
continue to enjoy the privileges of those accounts, such as payment history and integration
with eBay Auctions, and their checkout experience will remain the same.
This PayPal Account Optional feature is available for Buy Now, Donations, and Shopping
Cart buttons, but not for Subscription buttons.
PayPal Account Optional is enabled by default. If the merchant has turned on Payment Data
Transfer and has not disabled PayPal Account Optional, a new user will not be automatically
directed back to the merchant website, but will be given the option to return. When the buyer
clicks the Continue button, the transaction ID associated with the transaction is sent. The
merchant returns the transaction ID, along with their identity token, and PayPal then sends the
merchant payment information that confirms that the payment is complete. The buyer is
directed back to the merchant site where the transaction information is displayed. However, if
the buyer does not click the Continue button, they will not be directed back to the merchant's
site and PDT will not be initiated.
PDT Notification Synch
After you have activated PDT, every time a buyer makes a website payment and is redirected
to your return URL, a transaction token is sent via a FORM GET variable to this return URL.
To properly use PDT and display transaction details to your customer, you should read the
transaction token from the variable tx and retrieve transaction details from PayPal by
constructing an HTTPS POST to PayPal. This is called notification synch or synchronization.
Order Management Integration GuideMarch 200819
Payment Data Transfer (PDT)
2
PDT Notification Synch
Constructing the POST
Here are the guidelines for constructing the PDT HTTPS POST to PayPal for notification
synch:
1. Your POST must be sent to
2. You must include the cmd variable with the value _notify-synch:
cmd=_notify-synch
3. You must include the transaction token in the variable tx and the value of the transaction
token received via PayPal’s GET:
value_of_transaction_token
tx=
4. You must post your identity token using the variable at and the value of your PDT identity
token:
your_identity_token
at=
For information about the identity token, see “Getting and Using the Identity Token” on
page 18.
PayPal Response to POST
PayPal responds to the post with a single word on one line in the body of the response:
SUCCESS or FAIL. When you receive a SUCCESS response, the rest of the body of the
response is the transaction details, one per line, in the format
are both be URL-encoded strings. This response data needs to be parsed appropriately and
then URL-decoded.
If the response is FAIL, PayPal recommends making sure that:
z The Transaction token is not bad.
z The ID token is not bad.
z The tokens have not expired.
20March 2008Order Management Integration Guide
PDT and Auto Return: Messaging to Buyer
With Auto Return, you must display a message on the page displayed by the Return URL that
helps the buyer understand that the payment has been made, that the transaction has been
completed, and that payment transaction details will be sent to the buyer by email. You can
display to your customer whatever payment details you feel are appropriate; however, PayPal
recommends including the following:
z Item name
z Amount paid
z Payer email
z Shipping address
If you are using PDT to determine when to fulfill an order automatically, confirm that the
payment_status is Completed, since the buyer could use methods such as eChecks that do
not immediately clear.
For a list of PDT variables, see Appendix A, “IPN and PDT Variables.”
Payment Data Transfer (PDT)
Preventing Fraud
2
Preventing Fraud
In order to prevent fraud, PayPal recommends that your programs verify the following:
z txn_id is not a duplicate to prevent someone from reusing an old, completed transaction.
z receiver_email is an email address registered in your PayPal account, to prevent the
payment from being sent to a fraudulent account.
z Other transaction details, such as the item number and price, to confirm that the price has
not been changed.
Sample Code for PDT
Sample code for the following development environments is available on the PayPal website
at
Instant Payment Notification (IPN) allows you to integrate PayPal payments with your
website’s back-end operations. IPN provides immediate notification and confirmation of
PayPal payments you receive.
This chapter details IPN in the following sections:
z “About IPN” on page 23
z “Setting Up IPN” on page 24”
z “Using IPN Notification Validation to Help Prevent Fraud” on page 26”
z “Using IPN with Multiple Currencies” on page 28”
z “Dispute Notification and Downloadable Dispute Report” on page 31
About IPN
Instant Payment Notification
(IPN)
Instant Payment Notification consists of three parts:
1. A customer pays you.
2. PayPal POSTs FORM variables to a URL you specify that runs a program to process the
variables.
3. You validate the notification.
Order Management Integration GuideMarch 2008 - first technical draft23
Instant Payment Notification (IPN)
3
Setting Up IPN
FIGURE 3.1 How IPN Works: Three General Steps
1. A customer payment or a refund triggers IPN. This payment can be via Website Payments
Standard FORMs or via the PayPal Web Services APIs for Express Checkout, MassPay, or
RefundTransaction. If the payment has a “Pending” status, you receive another IPN when
the payment clears, fails, or is denied.
2. PayPal posts HTML FORM variables to a program at a URL you specify. You can specify
this URL either in your Profile or with the notify_url variable on each transaction. This
post is the heart of IPN. Included in the notification is the customer’s payment information
(such as customer name, payment amount). All possible variables in IPN posts are detailed
in . When your server receives a notification, it must process the incoming data.
3. Your server must then validate the notification to ensure that it is legitimate.
Setting Up IPN
Follow these procedures to set up IPN:
z “Activating IPN for Your PayPal Account” on page 24
z “Setting Up an IPN-Processing Program” on page 25
Activating IPN for Your PayPal Account
You can activate IPN for your PayPal account through your account profile. Separately, you
can activate IPN for specific payments by including a notification URL in the programming
code that your website sends to PayPal when people pay you.
24March 2008 - first technical draftOrder Management Integration Guide
Instant Payment Notification (IPN)
Setting Up IPN
Activating IPN Through Your Account Profile
When you activate IPN through your account profile, the notification URL that you specify is
used for all your IPNs, You can override the value on specific payment transactions by
including notification URLs in the programming code that your website sends to PayPal when
people pay you.
To activate IPN through your account profile:
1. Log in to your Business or Premier account.
2. Click the Profile subtab.
3. In the Selling Preferences column, click the Instant Payment Notification Preferences
link.
4. Click the Edit button.
5. Select the checkbox to activate IPN.
6. In the Notification URL text box, enter the URL of the program that will receive and
process IPNs
3
7. Click the Save button.
Activating IPN by Including the Notification URL in Programming Code
You can activate IPN for specific payments by including a notification URL in the
programming code that your website sends to PayPal when people pay you. PayPal sends only
IPNs related to payments that result from the code. PayPal sends them to the URL that you
specified in the code.
For example, if you accept payments from different websites through one PayPal account, you
could include different notification URLs in your programming code to let each website
receive IPNs only for its own payments.
N OTE: Notifcation URLs that you include in programming code override the notification URL
that you may have set in your account profile.
To learn how to include notification URLs in programming code:
z See the Name-Value Pair API Developer Guide and Reference
– or –
z See the Website Payments Standard Integration Guide
Setting Up an IPN-Processing Program
The data sent to you by IPN comes as HTML FORM name/value pairs.
Sample code for the following development environments is available on the PayPal website
at