PayPal Order Management - 2008 Integration Guide

Order Management Integration Guide
For Professional Use Only Currently only available in English.
A usage Professional Uniquement Disponible en Anglais uniquement pour l’instant.
Last updated: March 2008
PayPal Order Management Integration Guide
© 2008 PayPal, Inc. All rights reserved. PayPal is a registered trademark of PayPal, Inc. The PayPal logo is a trademark of PayPal, Inc. Other trademarks and brands are the property of their respective owners. The information in this document belongs to PayPal, Inc. It may not be used, reproduced or disclosed without the written approval of PayPal, Inc. Copyright © PayPal. All rights reserved. PayPal S.à r.l. et Cie, S.C.A., Société en Commandite par Actions. Registered office: 22-24 Boulevard Royal, L­2449, Luxembourg, R.C.S. Luxembourg B 118 349 Consumer advisory: The PayPal™ payment service is regarded as a stored value facility under Singapore law. As such, it does not require the approval of the Monetary Authority of Singapore. You are advised to read the terms and conditions carefully.
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.

Contents

1
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
This Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Chapter 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 9
Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Reporting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Differences between Payment Data Transfer (PDT) and Instant Payment Notification (IPN) 10
SSL Not Required for IPN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
PayPal-Supported Transactional Currencies . . . . . . . . . . . . . . . . . . . . . . . . 11
Chapter 2 Payment Data Transfer (PDT) . . . . . . . . . . . . . . . .13
How PDT Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Enabling Payment Data Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Getting and Using the Identity Token . . . . . . . . . . . . . . . . . . . . . . . . . . 18
PDT and PayPal Account Optional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
PDT Notification Synch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Constructing the POST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
PayPal Response to POST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
PDT and Auto Return: Messaging to Buyer . . . . . . . . . . . . . . . . . . . . . . . 21
Preventing Fraud. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Sample Code for PDT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Chapter 3 Instant Payment Notification (IPN) . . . . . . . . . . . . .23
About IPN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Setting Up IPN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Activating IPN for Your PayPal Account . . . . . . . . . . . . . . . . . . . . . . . . . 24
Setting Up an IPN-Processing Program . . . . . . . . . . . . . . . . . . . . . . . . . 25
Using IPN Notification Validation to Help Prevent Fraud. . . . . . . . . . . . . . . . . . . 26
Using Shared Secrets for Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Using Postbacks for Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Order Management Integration Guide March 2008 3
Contents
1
Using IPN with Multiple Currencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
payment_gross and payment_fee . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Examples of Multi-currency IPN Variables. . . . . . . . . . . . . . . . . . . . . . . . 29
Dispute Notification and Downloadable Dispute Report . . . . . . . . . . . . . . . . . . . 31
Downloadable Dispute Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Chapter 4 Transaction History and Reporting Tools . . . . . . . . . .35
Using Monthly Account Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Searching History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Basic Searching by Activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Advanced Searching by Field Value . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Specifying Date Ranges for Basic and Advanced History Search . . . . . . . . . . . . 40
Downloading History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Selecting Which Fields to Include in the Download . . . . . . . . . . . . . . . . . . . 43
Understanding the Status and Life Cycle of Transactions . . . . . . . . . . . . . . . . 46
Reconciling Transactions using the Balance Impact Column . . . . . . . . . . . . . . 46
Reconciling Transactions Using the Net Amount Column . . . . . . . . . . . . . . . . 47
Reporting Disputed Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Programmatic Access to Dispute Report . . . . . . . . . . . . . . . . . . . . . . . . 48
Appendix A IPN and PDT Variables. . . . . . . . . . . . . . . . . . . .51
About These Tables of Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Transaction-Specific Variable Values . . . . . . . . . . . . . . . . . . . . . . . . . . 51
test_ipn Variable in Sandbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
IPN Variables in All Posts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
IPN Version: notify_version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Security Information: verify_sign. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Buyer Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Basic Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Advanced and Custom Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Website Payments Standard, Website Payments Pro, and Refund Information . . . . . . . 55
Currency and Currency Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Auctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Mass Payment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Subscriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Subscriptions Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Dispute Notification Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
4 March 2008 Order Management Integration Guide
Contents
Miscellaneous and Fee-Related IPN Variables . . . . . . . . . . . . . . . . . . . . . 70
PDT-Specific Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Appendix B Downloadable History Logs . . . . . . . . . . . . . . . . .71
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79
1
Order Management Integration Guide March 2008 5
1
Contents
6 March 2008 Order Management Integration Guide

Preface

P

This Document

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
Date Description
March 2008 Corrected the procedure for checking the postback response from PayPal when
performing notification validation of IPNs. See “Using Postbacks for
Validation” on page 27.
January 2008 Added 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 2007 Replaced the old PayPal logo in screen shots with the new PayPal logo
August 2007 Added 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 2007 Minor bug fixing.
April 2007 Added contact_phone to IPN variables. Added pointer to PayPal Business
Overview page.
October 2006 Details about the Downloadable Dispute Report. Minor additions and
corrections to some variables in Appendix A.
July 2006 Minor correction to values of payment_status IPN variable.
May 2006 Description 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 Guide March 2008 7
P
Revision History
8 March 2008 Order 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 Guide March 2008 9
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.
10 March 2008 Order 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 Code Currency
AUD Australian Dollar
CAD Canadian Dollar
CHF Swiss Franc
CZK Czech Koruna
DKK Danish Krone
EUR Euro
GBP Pound Sterling
Introduction
1
HKD Hong Kong Dollar
HUF Hungarian Forint
JPY Japanese Yen
NOK Norwegian Krone
NZD New Zealand Dollar
PLN Polish Zloty
SEK Swedish Krona
SGD Singapore Dollar
USD U.S. Dollar
Order Management Integration Guide March 2008 11
Introduction
1
PayPal-Supported Transactional Currencies
12 March 2008 Order 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 Guide March 2008 13
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.
14 March 2008 Order 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 Guide March 2008 15
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.
16 March 2008 Order 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 Guide March 2008 17
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.
18 March 2008 Order 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 Guide March 2008 19
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.
https://www.paypal.com/cgi-bin/webscr.
key=value where key and value
Example successful response:
SUCCESS first_name=Jane+Doe last_name=Smith payment_status=Completed payer_email=janedoesmith%40hotmail.com payment_gross=3.99 mc_currency=USD custom=For+the+purchase+of+the+rare+book+Green+Eggs+%26+Ham ...
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.
20 March 2008 Order 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
https://www.paypal.com/us/cgi-bin/webscr?cmd=p/xcl/rec/pdt-code.
z ASP/VBScript
z ColdFusion
z PERL
z PHP
Order Management Integration Guide March 2008 21
Payment Data Transfer (PDT)
2
Sample Code for PDT
22 March 2008 Order Management Integration Guide
3
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 Guide March 2008 - first technical draft 23
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.
24 March 2008 - first technical draft Order 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
http://www.paypal.com/us/cgi-bin/webscr?cmd=p/pdn/ipn-codesamples-pop-outside:
z ASP.Net/C#
z ASP/VBScript
Order Management Integration Guide March 2008 - first technical draft 25
Instant Payment Notification (IPN)
3

Using IPN Notification Validation to Help Prevent Fraud

z ColdFusion
z Java/JSP
z Perl
z PHP
Using IPN Notification Validation to Help Prevent Fraud
After your server receives an Instant Payment Notification, you must confirm that the notification is authentic. This is known as notification validation. Performing notification validation for all the IPNs that you receive helps you and PayPal prevent the kind of fraud that results from spoofing, or “man-in-the-middle” attacks.
IMPORTANT: If you do not use Encrypted Website Payments (EWP) or shared secret
validation, you must check the price, transaction ID, PayPal receiver email address and other data sent to you by IPN to ensure that they are correct. By examining this data, you can avoid being spoofed.
PayPal offers two methods for notification validation:
z Use shared secrets.
PayPal recommends this method because it ensures the validity of the data and decreases network traffic to and from your website. Use shared secrets for validation if:
– You are not using a shared website hosting service. – You have enabled SSL on your web server. – You are using Encrypted Website Payments. – You use the notify_url variable on each individual payment transaction.
For more information, see “Using Shared Secrets for Validation” on page 26.
z Send a postback to PayPal.
Use postbacks for validation if: – You rely on a shared website hosting service – You do not have SSL enabled on your web server
For more information, see “Using Postbacks for Validation” on page 27.

Using Shared Secrets for Validation

You can use shared secrets for IPN notification validation by including them in the programming code that your website sends to PayPal when people pay you. As an alternative, can set a shared secret in your account profile.
When your IPN-processing program receives an IPN, it must compare that the shared secret in the post from PayPal matches the shared secret that you expect for notifications about that payment. If the secret posted by PayPal does not match the secret that you expect, flag the IPN for further investigation.
26 March 2008 - first technical draft Order Management Integration Guide
Instant Payment Notification (IPN)
Using IPN Notification Validation to Help Prevent Fraud
Including Shared Secrets in Programming Code
If you use shared secrets for IPN notification validation, PayPal recommends that you include shared secrets in all the programming code that your website sends to PayPal when people pay you. Add a shared secret variable and value to the value of the notification URL that you include in your programming code.
Use the following format to specify a shared secret as part of a notification URL in your programming code:
yourIPNnotificationURL?shared_secret_variable_name=shared_secret_value
where:
yourIPNNotificationURL is the URL where you receive IPNs.
shared_secret_variable_name is any variable name that you want.
shared_secret_value is the shared secret itself.
For example, the value of the notification URL variable might look like this:
https%3A//www.mysite.com/PP-IPN-Validate.cfm?secret=shhhhhhh
N OTE: When you include a shared secret in programming code, the secret is included in IPNs
that are related to payments that result from the code, overriding the shared secret that you may have set in your account profile.
3
Setting a Shared Secret in Your Account Profile
If you want to use the same shared secret for notification verification of all IPNs, you can set the secret in your account profile. PayPal includes the secret you set in all IPNs, except for payments that result from programming code in which you include shared secrets with the notification URL variable.
Security Considerations with Shared Secrets for Validation
To ensure the security of the shared secrets in HTML button code that you send to PayPal, use Encrypted Website Payments (EWP). For more information about EWP, see the Website
Payments Standard Integration Guide.
Shared secrets posted to you by PayPal through IPN are not encrypted; they are in clear text for easier processing. Therefore, the shared secrets are recorded in the clear in the access logs of your web server. Be sure to practice proper security for these logs. If you use a web server hosting service, ensure that your provider practices proper security of your data.

Using Postbacks for Validation

If you cannot use shared secrets for notification validation, you can use postbacks to PayPal, instead. Your postback must include exactly the same variables and values that you receive in the IPN posted to your server by PayPal, and they must be in the same order.
Constructing Your Postback
Use these guidelines for constructing your postback to PayPal:.
1. Your postback must be sent to
Order Management Integration Guide March 2008 - first technical draft 27
https://www.paypal.com/cgi-bin/webscr.
Instant Payment Notification (IPN)
3

Using IPN with Multiple Currencies

N OTE: You can implement IPN without SSL, including your postbacks for validation, but
PayPal recommends against doing so.
2. Your postback must include the variable cmd with the value _notify-validate:
cmd=_notify-validate
3. Your postback must include exactly the same variables and values that you receive in the IPN from PayPal, and they must be in the same order.
Processing the PayPal Response to Your Postback
PayPal responds to your postbacks with a single word in the body of the response: VERIFIED or INVALID.
When you receive a VERIFIED postback response, perform the following checks on data in the IPN:
1. Check that the payment_status is Completed.
2. If the payment_status is Completed, check the txn_id against the previous PayPal
transaction that you processed to ensure it is not a duplicate.
3. Check that the receiver_email is an email address registered in your PayPal account.
4. Check that the price, carried in mc_gross, and the currency, carried in mc_currency, are
correct for the item, carried in item_name or item_number.
After you complete the above checks, notification validation is complete. You can update your database with the information provided, and you can initiate other appropriate automated back-end processing.
Handling Invalid Responses to Your Postback
When you receive an INVALID postback response, you should investigate. In some cases, these responses result from an IPN error, possibly from a change in the IPN format.
To determine if an INVALID response results from an IPN error, first examine your code. Your postback must include exactly the same variables and values that you receive in the IPN posted to your server by PayPal, and they must be in the same order.
Using IPN with Multiple Currencies
With multiple currencies, you can accept payments in any of the PayPal-supported currencies (see “PayPal-Supported Transactional Currencies” on page 11). As a result, your IPN notifications will then include information about the currency of the payment. The following overview explains how IPN interacts with multiple currencies.
N OTE: If you are using one of PayPal’s Website Payments solutions (e.g. PayPal Shopping
Cart), and would like to be paid in a currency other than U.S. Dollars, you will need to set up your buttons for your currency of choice.
28 March 2008 - first technical draft Order Management Integration Guide

payment_gross and payment_fee

These variables reflect the amount received and corresponding fee of U.S. Dollar (USD) payments. If the amount received and fee deducted are in a currency other than USD, the variables will still appear in your IPN, but will have no values in them.
N OTE: payment_fee is not always present in IPNs, such as when a payment is pending.
These values are absent for non-USD payments so that IPN scripts will not process these amounts as USD. However, legacy IPN scripts will continue to work as before as long as the merchant only receives USD payments.

Examples of Multi-currency IPN Variables

IPN notifications that use the payment_gross variable will have the following multi­currency variables added. The variables mc_gross and mc_fee will not be added to IPN notifications with txn_type: subscr_signup, subscr_cancel, subscr_modify, subscr_failed, or subscr_eot.
z mc_gross: Full amount of payment received, before transaction fee.
Instant Payment Notification (IPN)
Using IPN with Multiple Currencies
3
N OTE: If payment is in USD, the payment_gross value equals mc_gross.
z mc_fee: Transaction fee associated with the payment. Variable function like
payment_fee variable (variable does not appear when payment pending, and so on).
N OTE: If payment is in USD, the payment_fee value equals mc_fee.
z mc_currency: Currency of mc_gross, mc_fee, payment_gross, and payment_fee
amounts. Possible values are detailed in “” on page 10.
z For subscription IPN notifications, such as signup, cancel, modify, failed, and eot,
mc_currency is the currency of the subscription, rather than the currency of the payment.
Example 1
If a user with a USD balance receives a $100 USD payment, the following variables will be used for the payment:
z mc_gross = payment_gross
z mc_fee = payment_fee
EXAMPLE 3.1 Multi-currency IPN: USD Payment
payment_status = Completed payment_gross = 100 payment_fee = 3.00 mc_gross = 100 mc_fee = 3.00 mc_currency = USD
Order Management Integration Guide March 2008 - first technical draft 29
Instant Payment Notification (IPN)
3
Using IPN with Multiple Currencies
Example 2
f a user with a CAD balance receives a $100 CAD payment, the following variables will be used for the payment:
z mc_gross and mc_fee have values.
z payment_gross and payment_fee are blank.
EXAMPLE 3.2 Multi-currency IPN: CAD Payment
payment_status = Completed payment_gross = payment_fee = mc_gross = 100 mc_fee = 3.00 mc_currency = CAD
Example 3
If the account is set to automatically convert payments, these variables will be used to show the conversion. This example is for a user with a USD balance who receives a payment of 100 GBP:
EXAMPLE 3.3 Multiple-currency IPN: Automatic Conversion of GBP Payment
payment_status = Completed payment_gross = payment_fee = mc_gross = 100 mc_fee = 3.00 mc_currency = GBP settle_amount = 145.5 settle_currency = USD exchange_rate = 1.5
Example 4
If a payment received is pending due to pending_reason = multi_currency, the first IPN received would not have the settle_amount, settle_currency, or exchange_rate.
EXAMPLE 3.4 Multiple-currency IPN: Pending Payment
payment_status = Pending pending_reason = multi_currency payment_gross = mc_gross = 100 mc_currency = GBP
The second IPN contains information about settling the payment. If the payment is accepted into the account’s primary currency, which is USD in the following example:
EXAMPLE 3.5 Pending - Convert to Primary Currency
payment_status = Completed
30 March 2008 - first technical draft Order Management Integration Guide
Instant Payment Notification (IPN)

Dispute Notification and Downloadable Dispute Report

payment_gross = payment_fee = mc_gross = 100 mc_fee = 3.00 mc_currency = GBP settle_amount = 145.5 settle_currency = USD exchange_rate = 1.5
If the payment is accepted into a balance of the same currency:
EXAMPLE 3.6 Pending - Accept to Currency Balance
payment_status = Completed payment_gross = payment_fee = mc_gross = 100 mc_fee = 3.00 mc_currency = GBP
If the payment is denied:
3
EXAMPLE 3.7 Pending - Denied
payment_status = Denied payment_gross = mc_gross = 100 mc_currency = GBP
N OTE: If a user receives a payment into a currency balance and later converts this amount into
another currency balance, the corresponding currency conversion transaction has no IPN.
Dispute Notification and Downloadable Dispute Report
Buyers can register claims about payments; such claims are called cases. PayPal notifies merchants about new cases with email and with IPN.
There are two kinds of cases:
z Complaint: A buyer has used the PayPal Resolution Center to register a claim about a
payment to a merchant.
N OTE: After notification about a complaint claim, merchants must log in to PayPal to use
the Resolution Center to respond to the case.
z Chargeback: A buyer has filed a complaint with a credit card company that has resulted in
a chargeback. The credit card company notifies PayPal about the reason for the chargeback. After investigating the case, PayPal notifies the merchant of any action required.
Order Management Integration Guide March 2008 - first technical draft 31
Instant Payment Notification (IPN)
3
Dispute Notification and Downloadable Dispute Report
The IPN messages for chargebacks resulting from a complaint are asynchronous: the IPN message for the chargeback can be sent to the merchant before the IPN message relating to the complaint. You should compare the IPN variable parent_txn_id of all IPN messages to match the chargeback with the complaint.
IPN variables for cases include the type of case, the reason, and other information about the case. For details about all variables and their possible values, see “Dispute Notification
Variables” on page 68.

Downloadable Dispute Report

The Downloadable Dispute Report provides details about newly created disputes and changes in the status of cases already in mid-process. The report is designed for the merchant that processes payment volumes better handled by programmatic interfaces. Thus, while the report resembles the Dispute Report available via the Resolution Center on the PayPal site, the downloadable is different in that it contains all open records (records cannot be filtered) and the invoice ID, which can use to track dispute cases based on your transaction identifiers.
The report is generated every day based on activity for the previous day. Days in which no activity occurred create an empty report. Reports are available for seven days, after which the report is no longer available
The report contains information about all chargebacks and buyer complaints for your account. This report does not contain information about ACH returns of PayPal-unauthorized complaints.
First Report
When you are first signed up for the DDR, the report contains:
1. All open Chargebacks, regardless of the date the case was created or the current status of the case
2. All open Buyer Complaints, regardless of the date the case was created or the current status of the case
Use this report as a starting point against which you will compare all future reports. If you want this “first report” re-run, contact your PayPal Account Manager and ask them to generate a “first day” DDR report.
Subsequent Daily Reports
Reports generated every day following the First DDR report contain information about dispute activity for your account in the past 24 hours or since the last report was generated, including the following:
z New cases
z Changed cases, including cases that are closed
Setup
To use the report you must:
32 March 2008 - first technical draft Order Management Integration Guide
Instant Payment Notification (IPN)
Dispute Notification and Downloadable Dispute Report
1. Create a unique user with PayPal’s Multi-User Access feature for downloading reports
– Login to your PayPal account. – Click the Profile subtab. – Under the Account Information column, click Multi-User Access. – Click Add. – On the Multi-User Access page, enter the requested information into the fields provided. – Click the checkboxes next to each permission you want the alias to have. – Click Save.
2. Contact your PayPal Account Manager to sign you up for the report.
3. Write a script to download the report from PayPal.
Scripts
You can automate which details you want to be prioritized in your dispute reports by assigning values shown in the sample HTML below. You can set the values for day, month, and year. The uname value is the alias you created with the Multi-User Access feature.
<FORM ACTION=”https://www.paypal.com/us/DISPUTE-REPORT-SCHED-LOGIN” METHOD=”post”> <INPUT TYPE=”hidden” NAME=”day” VALUE=”16”> <INPUT TYPE=”hidden” NAME=”month” VALUE=”09”> <INPUT TYPE=”hidden” NAME=”year” VALUE=”2006” <INPUT TYPE=”hidden” NAME=”uname” VALUE=”yourAliasUsername”> <INPUT TYPE=”hidden” NAME=”pword” VALUE=”yourAliasPassword”> <INPUT TYPE=”image” VALUE=”Submit”> </FORM>
3
Additional Set Up
You will receive an email informing you that the report is ready. Be sure to monitor your primary email address for an email stating the download report is ready. This email contains a hyperlink to the report, which can you access with a browser. You can also use the email as a trigger for your script that programmatically retrieves the report.
Order Management Integration Guide March 2008 - first technical draft 33
Instant Payment Notification (IPN)
3
Dispute Notification and Downloadable Dispute Report
34 March 2008 - first technical draft Order Management Integration Guide
4
Transaction History and
Reporting Tools
With transaction history and reporting tools, you can access monthly account statements, search your account history for different kinds payments and transactions, download history to your local computer, and access reports about disputed transactions.
N OTE: PayPal offers an additional set of reporting tools from the PayPal Business Overview
page. Visit the page, at https://business.paypal.com
User’s Guide and to use the additional reporting tools.
To access the history and tools described here:
1. Log in to your Business or Premier account.
2. Click the History subtab.
The History page appears, as shown in Figure 4.1 , “The History Page.”
, to access the PayPal Reporting
Order Management Integration Guide March 2008 35
Transaction History and Reporting Tools
4

Using Monthly Account Statements

FIGURE 4.1 The History Page
Using Monthly Account Statements
After you activate monthly account statements, you can view them from the History page. New statements become available on the 15th of each month, and they remain available online for up to three months.
To activate monthly account statements:
1. From the My Account Overview page, click the History subtab.
The History page appears.
2. Click the View button.
36 March 2008 Order Management Integration Guide
3. On the displayed page, click the Ye s radio button.
4. Click the Save button.

Searching History

There are two ways to search your account history for payments and other activity:
Transaction History and Reporting Tools
Searching History
4
z Basic Searching by Activity: specify a kind of account activity, and specify a date range.
z Advanced Searching by Field Value: specify a value or a pattern of values in a specific
field, and specify a date range.
Order Management Integration Guide March 2008 37
Transaction History and Reporting Tools
4
Searching History

Basic Searching by Activity

From the History page, you can search your transaction history by specifying the kind of account activity you want to view.
In the Show dropdown menu, select one of the following types of account activity.
TABLE 4.1 Basic Search: Selectable Activity Types
All Activity - Advanced Vie w
All Activity - Simple Vie w
Payments Sent or Received
Mass Payments Refunds eChecks
Money Requests Currency Conversions Preapproved Payments
38 March 2008 Order Management Integration Guide
Fee Reversals Open Authorizations:
Sent or Received
Subscriptions Shipping PayPal Buyer Credit
BillPay Transactions Balance Affecting
Transactions
Donations Sent or Received
Transaction History and Reporting Tools
T
ABLE 4.1 Basic Search: Selectable Activity Types
Searching History
4
Funds Added or Withdrawn
Balance Transfer Gift Certificates
The choice All Activity - Simple View is selected by default. You can scroll up the list to select All Activity - Advanced View, which differs from All Activity - Simple View by including a Balance column. The Balance column shows an ellipsis (...) for transactions that do not affect your account balance.
For detailed information on how to specify a date range, see “Specifying Date Ranges for
Basic and Advanced History Search” on page 40.

Advanced Searching by Field Value

From the Search page, you can search your transaction history for a value or a pattern of values in a specific field.
In the Search For text box, type the value or pattern. From the In dropdown menu, select one of the following fields.
T
ABLE 4.2 Advanced Transaction Search: Key Fields
Field Matching Criteria
Email The text you enter must exactly match an email address
Transaction ID Exact match
Order Management Integration Guide March 2008 39
Transaction History and Reporting Tools
4
Searching History
T
ABLE 4.2 Advanced Transaction Search: Key Fields
Field Matching Criteria
Last Name Any part of the text you enter can match. For example, the
text mit matches Smith and Mitty
Last Name, First Name Any part of text can match
Receipt ID Exact match
Invoice ID Exact match
Billing Agreement Exact match
Profile ID Exact match
For detailed information on how to specify a date range, see “Specifying Date Ranges for
Basic and Advanced History Search” on page 40.

Specifying Date Ranges for Basic and Advanced History Search

You can confine your basic or advanced to search to a specific date range in these ways:
z Select the Within radio button, and select one of these time frames from the dropdown
menu:
–The Past Day – The Past Week – The Past Month –The Past Year
40 March 2008 Order Management Integration Guide
Transaction History and Reporting Tools

Downloading History

z Select the From radio button, and specify a date range using the text boxes for the From
and To day, month, and year.
IMPORTANT: The duration of the date range you specify affects how quickly you can view
the search results. The longer the duration, the longer the search results take. For faster results, narrow the date range.
4
Downloading History
The Download History page lets you specify a time frame for payments and transactions to include in downloadable history logs, which are files that you save on your local computer. You can also specify which fields to include and what file format your want.
To to create a downloadable history log and save it on your computer:
1. In the upper left area of the History page, click the Download My History link.
The Download History page appears.
Order Management Integration Guide March 2008 41
Transaction History and Reporting Tools
4
Downloading History
FIGURE 4.2 Download History Page
2. In the upper right area of the History Download page, click the Customize Download Fields link to select which fields you want to include in your downloadable history log.
For more information, see “Selecting Which Fields to Include in the Download” on
page 43.
3. Specify a Custom Date Range for the history you want to download, and select a File Type for D o w n lo a d .
Your choices are: – Comma Delimited – All Activity – Comma Delimited – Completed Payments – Comma Delimited – Balance Affecting Payments – Tab Delimited – All Activity – Tab Delimited – Completed Payments – Tab Delimited – Balance Affecting Payments – Intuit Quicken (.qif file format)
42 March 2008 Order Management Integration Guide
Transaction History and Reporting Tools
Downloading History
– Intuit QuickBooks (.iif file format)
– or –
Select the Last Download to Present radio button to download transactions that occurred after the last time you downloaded history, and select a File Type for Download.
Your choices are: – Comma Delimited – Completed Payments – Tab Delimited – Completed Payments – Intuit Quicken (.qif file format) – Intuit QuickBooks (.iif file format)
4. Select the Include Shopping Cart details checkbox if you want your downloadable history log to include a row of information for each item associated with shopping cart payments.
5. Click the Download History button.
6. When prompted, select whether to open the downloadable history log or to save it on your
local computer.
4

Selecting Which Fields to Include in the Download

Downloadable history logs always contains these fields:
z Date, Time, and Timezone
z Name
z Type, Status and Currency
z Gross, Fee, and Net
z From Email Address and To Email Address
z Transaction ID and Reference Transaction ID
z Receipt ID
z Balance
For details about these default fields, see Appendix B, “Downloadable History Logs.”
In addition, you can select other fields to include, using the Customize My History Download page.
To select the optional fields you want to include in downloadable history logs:
Order Management Integration Guide March 2008 43
Transaction History and Reporting Tools
4
Downloading History
1. In the upper right area of the History Download page, click the Customize Download Fields link, as shown below.
2. In the Customize My History Download page, select the checkboxes next to the fields
that you want to include.
44 March 2008 Order Management Integration Guide
Transaction History and Reporting Tools
FIGURE 4.3 The Customize My History Download Page
Downloading History
4
For details about these optional fields, see Appendix B, “Downloadable History Logs.”
3. Click the Save button to preserve you choices for future downloadable history logs.
Order Management Integration Guide March 2008 45
Transaction History and Reporting Tools
4
Downloading History

Understanding the Status and Life Cycle of Transactions

Each row in a downloadable history log shows a transaction, its status at the time of the download, and its effect on your balance.
Various types of transaction statuses and scenarios can have a negative, positive, or neutral balance effect. These statuses include:
z Pending
z Held
z Completed
z Denied
z Cancelled
z Reversed
For a complete list of possible transaction statuses, see “Status” on page 73.
Pending to Cleared or Uncleared
When a pending payment, such as an eCheck, clears after the three to four business days, the transaction status changes from Uncleared to Cleared.
Status of Disputed Transactions
Transactions with a Placed status (for temporary holds) usually involve a customer dispute.
If you are found in favor in a dispute, the transaction will be updated with a new line-item to indicate a Credit. However, if the opposite is true, the Balance Impact column will not change from the Debit status for that transaction.
You can generate a dispute report that correlates the transaction to the customer and the reason for the dispute. For more information, see “Reporting Disputed Transactions” on page 47.

Reconciling Transactions using the Balance Impact Column

The optional Balance Impact column shows the word “Credit” for a positive effect or the word “Debit” for a negative effect on your PayPal account balance.
Credit
When you receive an instant payment or credit card transaction, the Balance Impact column indicates a credit. Other possible credits to your account are refunds, reversals and payments sent but never claimed.
In some cases, a credit line-item can update a debit for a transaction. For example, if you send a payment initially indicated as a debit, but it is denied by the recipient, a new line-item for that transaction will indicate a credit.
Debit
Debits are transactions that reduce your available balance. For example, refunded transactions are recorded as a debit in the Balance Impact column and as completed in the Status column.
46 March 2008 Order Management Integration Guide
Transaction History and Reporting Tools

Reporting Disputed Transactions

Memo Entries
The Balance Impact column can display a Memo entry for transactions that do not affect your balance, such as unclaimed or uncleared transactions. These kinds of transactions have no effect on your balance, because they never becomes completed transactions.

Reconciling Transactions Using the Net Amount Column

The Net Amount of a transaction can aid in faster reconciliation.
In most cases, the Net Amount is the Gross minus Fee. When a History entry is updated (for example, in the case of a refund), the Net Amount column indicates the current net value of the transaction on a separate line-item.
FIGURE 4.4 Gross, Fee and Net Amount Calculations from History Log
4
Reporting Disputed Transactions
With dispute reports, you can focus only on transactions that are disputed by customers for some reason.
Order Management Integration Guide March 2008 47
Transaction History and Reporting Tools
4
Reporting Disputed Transactions
FIGURE 4.5 Dispute Report

Programmatic Access to Dispute Report

The Downloadable Dispute Report (DDR) provides merchants with a regular report of newly created disputes and changes in the status of those cases that are already open and are in the midst of processing.
The report is designed for the merchant that processes large volumes of payments. Thus, while the report resembles the Dispute Report available via the Resolution Center within the PayPal site, the DDR differs in that it contains all open records and the invoice ID which can be used to track dispute cases based on your transactional identifiers. The DDR cannot filter on open records.
N OTE: To use this feature, you must sign up for the report through your PayPal Account
Manager.
Content of the Report
The report contains information about all chargebacks and buyer complaints generated for your account. This report does not contain information about ACH returns of PayPal unauthorized complaints.
48 March 2008 Order Management Integration Guide
Transaction History and Reporting Tools
Reporting Disputed Transactions
First DDR Report
When you first sign up for the DDR, the report contains:
z All open chargebacks, regardless of the date the case was created or the current status of
the case
z All open buyer complaints, regardless of the date the case was created or the current status
of the case
Use this report as a starting point against which you will read future DDR reports.
N OTE: If you need to regenerate the first report, contact your PayPal Account Manager and
ask them to generate a first day DDR report for you.
Subsequent Daily DDR Reports
Following the first DDR report, reports are generated daily and contain information about dispute activity for your account in the past 24 hours, or since the last report was generated, including:
z New cases created
z Cases that were modified, including cases that were closed
4
Frequency / Archiving
The DDR is generated every day based on activity for the previous day. Days with no activity will generate an empty report.
PayPal will maintain DDR reports for seven days after which the report will not longer be available.
Report Set Up
To use the DDR you must:
1. Sign up for the report through your PayPal Account Manager
2. Create a unique user to download the report
3. Write code to download the report from a PayPal server
Step 1. Sign up for the report via PayPal Account Management. Contact your PayPal
Account Manager to sign up for the Downloadable Dispute Report.
Step 2. Create a Unique User on PayPal to Download the Report. To use the DDR, you
must use PayPal’s Multi-User Access feature to create a unique user for downloading reports.
1. Login to your PayPal account.
2. Select the Profile subtab.
3. Click the Multi-User Access link under the Account Information column to open the Multi-User Access page.
4. Click the Add button. On the Multi-User Access page, enter the requested information
into the fields provided.
Order Management Integration Guide March 2008 49
Transaction History and Reporting Tools
4
Reporting Disputed Transactions
5. Select the checkboxes next to each of the choices that you want the alias to have.
6. Click the Save button.
Your new user and alias appear on the Multi-User Access page along with a confirmation message that you have successfully added a new user to your account.
Step 3. Write Code to Download the Report from the PayPal Server. Write code to
request the report from a PayPal server. The code must send an HTTP POST to the PayPal server. The POST must be sent from a secure server that uses HTTPS. PayPal does not accept requests from servers using HTTP.
You can automate which details you want to be prioritized in your Settlement File reports by assigning values as depicted in the sample HTML code.
The HTML code below is an example of the values that your DDR may contain. In the following example, the uname value is the alias created using the Multi-User Access feature.
<FORM ACTION=”https://www.paypal.com/us/DISPUTE-REPORT-SCHED-LOGIN” METHOD=”post”>
<INPUT TYPE=”hidden” NAME=”day” VALUE=”16”> <INPUT TYPE=”hidden” NAME=”month” VALUE=”09”> <INPUT TYPE=”hidden” NAME=”year” VALUE=”2006”> <INPUT TYPE=”hidden” NAME=”uname” VALUE=”queuealias2”> <INPUT TYPE=”hidden” NAME=”pword” VALUE=”22222222”> <INPUT TYPE=”image” VALUE=”Submit”>
</FORM>
View the Report
You will receive an email when the report is ready. This email contains a link to the report which can you access via a browser.
You can also use the email as a trigger for your code to programmatically access the report.
50 March 2008 Order Management Integration Guide

IPN and PDT Variables

A
IPN and PDT variables are case-sensitive. All values are lowercase, except those for payment_status, which have an initial capital letter.
In addition, values posted by IPN are URL-encoded. For example, a colon in http:// is encoded as %3A in the IPN post: http%3A//

About These Tables of Variables

The tables in this appendix group IPN variables by different characteristics:
z “test_ipn Variable in Sandbox” on page 51
z “IPN Variables in All Posts” on page 52
z “Buyer Information” on page 52
z “Basic Information” on page 53
z “Advanced and Custom Information” on page 54
z “Website Payments Standard, Website Payments Pro, and Refund Information” on page 55
z “Currency and Currency Exchange” on page 60
z “Auctions” on page 62
z “Mass Payment” on page 62
z “Subscriptions” on page 64
z “Dispute Notification Variables” on page 68
z “PDT-Specific Variables” on page 70

Transaction-Specific Variable Values

Unless otherwise indicated in the table column labeled Possible Values, the value of an IPN or PDT variable is always specific to the transaction whose information is being posted.

test_ipn Variable in Sandbox

In the Sandbox environment, IPN includes the additional variable test_ipn with a value of 1 (one). The purpose of test_ipn is to provide testing programs a means to differentiate between Sandbox IPN and live IPN.
Order Management Integration Guide March 2008 51
IPN and PDT Variables
A

IPN Variables in All Posts

IPN Variables in All Posts

IPN Version: notify_version

The value of the notify_version variable is the version number of Instant Payment Notification that makes the post.
N OTE: The value notify_version is a means for PayPal to track versions of IPN. There is
no need for your programs to store this value or query it.

Security Information: verify_sign

The value of verify_sign is an encrypted string used to validate the authenticity of the transaction.

Buyer Information

TABLE A.1 IPN and PDT Variables: Buyer Information
Variable Name
address_ city
address_ country
address_ country_ code
address_ name
address_ state
address_ status
Possible Values Description
City of customer’s address. 40
Country of customer’s address. 64
Two-character ISO 3166 country code 2
Name used with address (included when the customer provides a Gift Address)
State of customer’s address 40
confirmed
unconfirmed
Customer provided a confirmed address. Customer provided an unconfirmed address.
Char Length
128
address_ street
address_zip Zip code of customer’s address. 20
first_name Customer’s first name 64
Customer’s street address. 200
52 March 2008 Order Management Integration Guide
T
ABLE A.1 IPN and PDT Variables: Buyer Information
IPN and PDT Variables

Basic Information

A
Variable Name
last_name Customer’s last name 64
payer_ business_ name
payer_email Customer’s primary email address. Use this email to provide any
payer_id Unique customer ID. 13
payer_ status
contact_ phone
residence_ country
Possible Values Description
Customer’s company name, if customer represents a business 127
credits.
verified
unverified
Customer has a Verified PayPal account. Customer has an Unverified PayPal account.
Customer’s telephone number. 20
Two-character ISO 3166 country code 2
Basic Information
Char Length
127
ABLE A.2 IPN and PDT Variables: Basic Information
T
Variable Name
business Email address or account ID of the payment recipient (that is, the
item_name Item name as passed by you, the merchant. Or, if not passed by
item_number Pass-through variable for you to track purchases. It will get
Possible Values Description
merchant). Equivalent to the values of receiver_email (if payment is sent to primary account) and business set in the Website Payment HTML.
N OTE: The value of this variable is normalized to lowercase
characters.
you, as entered by your customer. If this is a shopping cart transaction, PayPal will append the number of the item (e.g., item_name_1, item_name_2, and so forth).
passed back to you at the completion of the payment. If omitted, no variable will be passed back to you.
Char Length
127
127
127
Order Management Integration Guide March 2008 53
IPN and PDT Variables
A

Advanced and Custom Information

T
ABLE A.2 IPN and PDT Variables: Basic Information
Variable Name
quantity Quantity as entered by your customer or as passed by you, the
receiver_ email
receiver_id Unique account ID of the payment recipient (i.e., the merchant).
Possible Values Description
merchant. If this is a shopping cart transaction, PayPal appends the number of the item (e.g. quantity1, quantity2).
Primary email address of the payment recipient (that is, the merchant). If the payment is sent to a non-primary email address on your PayPal account, the receiver_email is still your primary email.
N OTE: The value of this variable is normalized to lowercase
characters.
This is the same as the recipient's referral ID.
Advanced and Custom Information
T
ABLE A.3 IPN and PDT Variables: Advanced and Custom Information
Char Length
127
13
Variable Name
custom Custom value as passed by you, the merchant. These are pass-
invoice Passthrough variable you can use to identify your Invoice
memo Memo as entered by your customer in PayPal Website Payments
option_ name_1
option_ name_2
option_ selection1
Possible Values Description
through variables that are never presented to your customer
Number for this purchase. If omitted, no variable is passed back.
note field.
Option 1 name as requested by you. If this is a shopping cart transaction, see Table A.4, “IPN and
PDT Variables: Website Payments Standard, Website Payments Pro, and Refund Information,” on page 55 for more information.
Option 2 name as requested by you. If this is a shopping cart transaction, see Table A.4, “IPN and
PDT Variables: Website Payments Standard, Website Payments Pro, and Refund Information,” on page 55 for more information.
Option 1 choice as entered by your customer. If this is a shopping cart transaction, see Table A.4, “IPN and
PDT Variables: Website Payments Standard, Website Payments Pro, and Refund Information,” on page 55 for more information.
Char Length
255
127
255
64
64
200
54 March 2008 Order Management Integration Guide

Website Payments Standard, Website Payments Pro, and Refund Information

T
ABLE A.3 IPN and PDT Variables: Advanced and Custom Information
IPN and PDT Variables
A
Variable Name
option_ selection2
tax Amount of tax charged on payment.
Possible Values Description
Option 2 choice as entered by your customer. If this is a shopping cart transaction, see Table A.4, “IPN and
PDT Variables: Website Payments Standard, Website Payments Pro, and Refund Information,” on page 55 for more information.
If this is a shopping cart transaction, see Table A.4, “IPN and
PDT Variables: Website Payments Standard, Website Payments Pro, and Refund Information,” on page 55 for more information.
Char Length
200
Website Payments Standard, Website Payments Pro, and
Refund Information
T
ABLE A.4 IPN and PDT Variables: Website Payments Standard, Website Payments Pro, and
Refund Information
Variable Name
Possible Values Description
Char Length
auth_id Transaction-
specific
auth_exp Transaction-
specific
auth_amount Transaction-
specific
auth_status Completed
Pending
Voided
mc_gross_
mc_ handling_
x Transaction-
specific for multiple currencies
Transaction­specific for
x
multiple currencies
Authorization identification number 19
Authorization expiration date and time, in the following format: HH:MM:SS DD Mmm YY, YYYY PST
Authorization amount
Status of authorization
The amount is in the currency of mc_currency, where x is the shopping cart detail item number. The sum of mc_gross_x should total mc_gross.
The x is the shopping cart detail item number. The handling_cart cart-wide Website Payments variable is also included in the mc_handling variable; for this reason, the sum of mc_handling_x might not be equal to mc_handling
28
Order Management Integration Guide March 2008 55
IPN and PDT Variables
A
Website Payments Standard, Website Payments Pro, and Refund Information
ABLE A.4 IPN and PDT Variables: Website Payments Standard, Website Payments Pro, and
T
Refund Information
Variable Name
mc_ shipping_
num_cart_ items
option_ name1
option_ name2
option_ selection1_
x
option_ selection2_
x
x
Possible Values Description
Transaction­specific for multiple currencies
This is the combined total of shipping and shipping2 Website Payments Standard variables, where x is the shopping cart detail item number. The shippingx variable is only shown when the merchant applies a shipping amount for a specific item. Because profile shipping might apply, the sum of shippingx might not be equal to shipping.
If this is a PayPal Shopping Cart transaction, number of items in cart.
PayPal appends the number of the item where x represents the number of the shopping cart detail item (e.g., option_name1, option_name2).
PayPal appends the number of the item where x represents the number of the shopping cart detail item (e.g., option_name2, option_name2).
PayPal appends the number of the item (e.g., option_selection1, option_selection2), where x represents the number of the shopping cart detail item.
PayPal appends the number of the item where x represents the number of the shopping cart detail item (e.g., option_selection1, option_selection2).
Char Length
64
64
200
200
parent_txn_ id
payment_ date
In the case of a refund, reversal, or canceled reversal, this variable contains the txn_id of the original transaction, while txn_id contains a new ID for the new transaction.
Time/Date stamp generated by PayPal, in the following format: HH:MM:SS DD Mmm YY, YYYY PST
19
28
56 March 2008 Order Management Integration Guide
IPN and PDT Variables
Website Payments Standard, Website Payments Pro, and Refund Information
T
ABLE A.4 IPN and PDT Variables: Website Payments Standard, Website Payments Pro, and
Refund Information
A
Variable Name
payment_ status
Possible Values Description
Canceled_ Reversal
Completed
Denied
Expired
Failed
Pending
Processed
Refunded
Reversed
Voided
The status of the payment: Canceled_Reversal: A reversal has been canceled. For
example, you won a dispute with the customer, and the funds for the transaction that was reversed have been returned to you.
Completed: The payment has been completed, and the funds have been added successfully to your account balance.
Denied: You denied the payment. This happens only if the payment was previously pending because of possible reasons described for the PendingReason element.
Expired: This authorization has expired and cannot be captured.
Failed: The payment has failed. This happens only if the payment was made from your customer’s bank account.
Pending: The payment is pending. See pending_reason more information.
Refunded: You refunded the payment. Reversed: A payment was reversed due to a chargeback or
other type of reversal. The funds have been removed from your account balance and returned to the buyer. The reason for the reversal is specified in the ReasonCode element.
Processed: A payment has been accepted. Voided: This authorization has been voided.
Char Length
for
payment_ type
Order Management Integration Guide March 2008 57
echeck
instant
echeck: This payment was funded with an eCheck. instant: This payment was funded with PayPal balance, credit
card, or Instant Transfer.
IPN and PDT Variables
A
Website Payments Standard, Website Payments Pro, and Refund Information
T
ABLE A.4 IPN and PDT Variables: Website Payments Standard, Website Payments Pro, and
Refund Information
Variable Name
pending_ reason
Possible Values Description
address
authorizati on
echeck
intl
multi­currency
unilateral
upgrade
verify
other
This variable is set only if payment_status = Pending. address: The payment is pending because your customer did
not include a confirmed shipping address and your Payment Receiving Preferences is set yo allow you to manually accept or deny each of these payments. To change your preference, go to the Preferences section of your Profile.
authorization: You set <PaymentAction> Authorization</PaymentAction> on SetExpressCheckoutRequest and have not yet captured
funds. echeck: The payment is pending because it was made by an
eCheck that has not yet cleared. intl: The payment is pending because you hold a non-U.S.
account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account Overview.
multi-currency: You do not have a balance in the currency sent, and you do not have your Payment Receiving Preferences set to automatically convert and accept this payment. You must manually accept or deny this payment.
unilateral: The payment is pending because it was made to an email address that is not yet registered or confirmed.
upgrade: The payment is pending because it was made via credit card and you must upgrade your account to Business or Premier status in order to receive the funds. upgrade can also mean that you have reached the monthly limit for transactions on your account.
verify: The payment is pending because you are not yet verified. You must verify your account before you can accept this payment.
other: The payment is pending for a reason other than those listed above. For more information, contact PayPal Customer Service.
Char Length
58 March 2008 Order Management Integration Guide
IPN and PDT Variables
Website Payments Standard, Website Payments Pro, and Refund Information
T
ABLE A.4 IPN and PDT Variables: Website Payments Standard, Website Payments Pro, and
Refund Information
A
Variable Name
reason_code chargeback
remaining_ settle
shipping_ method
shipping Transaction-
Possible Values Description
guarantee
buyer_ complaint
refund
other
Transaction­specific
Merchant­specific
specific
Char Length
This variable is set if payment_status =Reversed, Refunded, or Cancelled_Reversal
chargeback: A reversal has occurred on this transaction due to
a chargeback by your customer. guarantee: A reversal has occurred on this transaction due to
your customer triggering a money-back guarantee. buyer-complaint: A reversal has occurred on this transaction
due to a complaint about the transaction from your customer. refund: A reversal has occurred on this transaction because you
have given the customer a refund. other: A reversal has occurred on this transaction due to a
reason not listed above.
Remaining amount that can be captured with Authorization and Capture
The name of a shipping method from the Shipping Calculations section of the merchant's account profile. The buyer selected the named shipping method for this transaction.
Shipping charges associated with this transaction. Format: unsigned, no currency symbol, two decimal places.
tax PayPal appends the number of the item (e.g., item_name1,
item_name2). The tax_x variable is included only if there was
a specific tax amount applied to a particular shopping cart item. Because profile tax may apply to other items in the cart, the sum of tax_x might not total to tax.
transaction _entity
txn_id A unique transaction ID generated by PayPal. 19
auth
reauth
order
payment
Authorization and Capture transaction entity
Order Management Integration Guide March 2008 59
IPN and PDT Variables
A

Currency and Currency Exchange

T
ABLE A.4 IPN and PDT Variables: Website Payments Standard, Website Payments Pro, and
Refund Information
Variable Name
txn_type cart
Possible Values Description
cart: Transaction created by a customer:
express_ checkout
send_money
virtual_ terminal
web-accept
z Via the PayPal Shopping Cart feature. z Via Express Checkout when the cart contains multiple items.
express_checkout: Transaction created by Express Checkout when the customer’s cart contains a single item.
send-money: Transaction created by customer from the Send Money tab on the PayPal website.
virtual_terminal: Transaction created with Virtual Term inal.
web-accept: Transaction created by customer via Buy Now, Donation, or Auction Smart Logos.
N OTE: In some cases, txn_type is blank when the variable
reason_code is chargeback.
Currency and Currency Exchange
Char Length
ABLE A.5 IPN and PDT Variables: Currency and Currency Exchange Information
T
Variable Name
exchange_ rate
mc_currency Three-
mc_fee Transaction fee associated with the payment. mc_gross minus
Possible Values Description
Exchange rate used if a currency conversion occurred.
For payment IPN notifications, this is the currency of the character currency code. See table of supported currencies.
payment. For non-payment subscription IPN notifications, this is
the currency of the subscription.
mc_fee equals the amount deposited into the receiver_email
account. Equivalent to payment_fee for USD payments. If this
amount is negative, it signifies a refund or reversal, and either of
those payment statuses can be for the full or partial amount of the
original transaction fee.
Char Length
60 March 2008 Order Management Integration Guide
IPN and PDT Variables
Currency and Currency Exchange
T
ABLE A.5 IPN and PDT Variables: Currency and Currency Exchange Information
A
Variable Name
mc_gross Full amount of the customer's payment, before transaction fee is
mc_handling #
mc_shipping #
payment_fee Transaction-
Possible Values Description
subtracted. Equivalent to payment_gross for USD payments.
If this amount is negative, it signifies a refund or reversal, and
either of those payment statuses can be for the full or partial
amount of the original transaction.
Total handling amount associated with the transaction.
If this is a shopping cart transaction, see Table A.4, “IPN and
PDT Variables: Website Payments Standard, Website Payments
Pro, and Refund Information,” on page 55 for more information.
Total shipping amount associated with the transaction.
If this is a shopping cart transaction, see Table A.4, “IPN and
PDT Variables: Website Payments Standard, Website Payments
Pro, and Refund Information,” on page 55 for more information.
USD transaction fee associated with the payment. specific for USD payments only
payment_gross minus payment_fee equals the amount
deposited into the receiver email account. Is empty for non-USD
payments. If this amount is negative, it signifies a refund or
reversal, and either of those payment statuses can be for the full
or partial amount of the original transaction fee.
N OTE: This is a deprecated field. Use mc_fee instead.
Char Length
payment_ gross
settle_ amount
settle_ currency
Transaction­specific for USD payments only
Three­character currency code. See table of supported currencies.
Full USD amount of the customer’s payment, before transaction
fee is subtracted. Will be empty for non-USD payments. This is a
legacy field replaced by mc_gross. If this amount is negative, it
signifies a refund or reversal, and either of those payment
statuses can be for the full or partial amount of the original
transaction.
Amount that is deposited into the account’s primary balance after
a currency conversion from automatic conversion (through your
Payment Receiving Preferences) or manual conversion (through
manually accepting a payment).
Currency of settle_amount.
Order Management Integration Guide March 2008 61
IPN and PDT Variables
A

Auctions

Auctions
TABLE A.6 IPN and PDT Variables: Auctions
Variable Name
auction_ buyer_id
auction_ closing_ date
auction_ multi_item
for_auction true This is an auction payment—payments made using Pay for eBay
Possible Values Description
The customer’s auction ID. 64
The auction’s close date, in the following format: HH:MM:SS
DD Mmm YY, YYYY PST
The number of items purchased in multi-item auction payments.
It allows you to count the mc_gross or payment_gross for
the first IPN you receive from a multi-item auction
(auction_multi_item), since each item from the auction will
generate an Instant Payment Notification showing the amount for
the entire auction.
Items or Smart Logos—as well as Send Money/Money Request
payments with the type eBay items or Auction Goods (non-
eBay).

Mass Payment

Char Length
28
T
ABLE A.7 IPN and PDT Variables: Mass Payment
Variable Name
masspay_ txn_id_
mc_currency _
x
mc_fee_
x
x Transaction-
Possible Values Description
For Mass Payments, a unique transaction ID generated by the
PayPal system, where x is the record number of the mass pay
item
Transaction­specific for multiple currencies
specific for multiple Currencies
For Mass Payments, the currency of the amount and fee, where x
is the record number the mass pay item
For Mass Payments, the transaction fee associated with the
payment, where x is the record number the mass pay item
Char Length
19
62 March 2008 Order Management Integration Guide
T
ABLE A.7 IPN and PDT Variables: Mass Payment
IPN and PDT Variables
Mass Payment
A
Variable Name
Possible Values Description
mc_gross_x Transaction-
specific for Multiple Currencies
payment_ date
payment_fee _
x
Transaction­specific for USD payments only
payment_ gross_
x
Transaction­specific for USD payments only
payment_ status
Completed
Denied
Processed
The gross amount for the amount, where x is the record number
the mass pay item
For Mass Payments, the first IPN is the date/time when the
record set is processed and the second IPN is the date/time when
all payments are completed/returned. Format: HH:MM:SS DD
Mmm YY, YYYY PST
If the payment is USD, then the value is the same as that for
mc_fee_x, where x is the record number; if the currency is not
USD, then this is an empty string.
N OTE: This is a deprecated field. Use mc_fee_x instead.
If the payment is USD, then the value for this is the same as that
for the mc_gross_x, where x is the record number the mass pay
item. If the currency is not USD, this is an empty string.
N OTE: This is a deprecated field. Use mc_gross_x instead.
Completed: For Mass Payments, this means that all of your
payments have been claimed, or after a period of 30 days,
unclaimed payments have been returned to you.
Denied: For Mass Payments, this means that your funds were
not sent and the Mass Payment was not initiated. This may have
been caused by lack of funds.
Processed: Your Mass Payment has been processed and all
payments have been sent.
Char Length
28
reason_code 1001
1003
1004
This variable is only set if status = Failed.
1001: Invalid UserID.
1003: Country of Residence check failure
1004: Country of Funding Source check failure
receiver_ email_
status_
x
x Completed
Failed
Reversed
Unclaimed
For Mass Payments, the primary email address of the payment
recipient, where x is the record number of the mass pay item
For Mass Payments, the status of the payment, where x is the
record number
Completed: The payment has been processed, regardless of
whether this was originally a unilateral payment
127
Failed: The payment failed because of insufficient PayPal
balance.
Reversed: This is for unilateral payments that were not claimed
after 30 days and have been returned to the sender. Or the funds
have been returned because the Receiver’s account was locked.
Unclaimed: This is for unilateral payments that are unclaimed.
Order Management Integration Guide March 2008 63
IPN and PDT Variables
A

Subscriptions

T
ABLE A.7 IPN and PDT Variables: Mass Payment
Variable Name
txn_type masspay This payment was sent via Mass Payment
unique_id_
Possible Values Description
x For Mass Payments, the unique ID from input, where x is the
record number. This allows the merchant to cross-reference the
payment
Subscriptions

Subscriptions Variables

Along with other IPN variables, the following variables are included in Subscriptions IPNs.
ABLE A.1 Subscriptions Variables
T
Possible
Variable
txn_type subscr-
Values Description Char Limit
subscr_signup: subscription sign-up. failed
subscr­cancel
subscr­payment
subscr­signup
subscr-eot
subscr­modify
subscr_cancel: subscription cancellation.
subscr_failed: subscription payment failure.
subscr_payment: subscription payment.
subscr_eot: subscription’s end-of-term.
subscr_modify: subscription modification.
Char Length
13
subscr_date Start date or cancellation date depending on
whether transaction is subscr_signupor
subscr_cancel.
Time/Date stamp generated by PayPal , in the
following format: HH:MM:SS DD Mmm YY,
YYYY PST
subscr_ effective
Date when the subscription modification will be
effective (only for txn_type =
subscr_modify).
Time/Date stamp generated by PayPal , in the
following format: HH:MM:SS DD Mmm YY,
YYYY PST
64 March 2008 Order Management Integration Guide
T
ABLE A.1 Subscriptions Variables
Possible
Variable
period1 (optional) Trial subscription interval in days,
period2 (optional) Trial subscription interval in days,
period3 Regular subscription interval in days, weeks,
amount1 Amount of payment for trial period 1 for USD
amount2 Amount of payment for trial period 2 for USD
amount3 Amount of payment for regular subscription period
Values Description Char Limit
weeks, months, years (example: a 4 day interval is
“period1: 4 D”).
weeks, months, or years.
months, or years.
payments; otherwise blank (optional).
payments; otherwise blank (optional).
for USD payments; otherwise blank.
IPN and PDT Variables
Subscriptions
A
mc_amount1 Amount of payment for trial period 1, regardless of
currency (optional).
mc_amount2 Amount of payment for trial period 2, regardless of
currency (optional).
mc_amount3 Amount of payment for regular subscription period,
regardless of currency.
mc_currency See table of
supported currencies.
recurring Indicates whether regular rate recurs (1 is yes,
reattempt Indicates whether reattempts should occur upon
retry_at Date PayPal will retry a failed subscription
recur_times The number of payment installments that will occur
username (optional) Username generated by PayPal and
For non-payment subscriptions IPNs (i.e.,
txn_type= signup, cancel, failed, eot, or modify),
this is the currency of the subscription. For
payment IPNs, it is the currency of the payment
(i.e., txn_type = subscr_payment)
blank is no).
payment failures (1 is yes, blank is no).
payment.
at the regular rate.
given to subscriber to access the subscription.
64
password (optional) Password generated by PayPal and given
to subscriber to access the subscription (password
will be encrypted).
Order Management Integration Guide March 2008 65
24
IPN and PDT Variables
A
Subscriptions
T
ABLE A.1 Subscriptions Variables
Possible
Variable
subscr_id ID generated by PayPal for the subscriber. 19
Values Description Char Limit
Variables for Each Subscription Event
The following table shows which variables are associated and can be included in IPN posts with each subscription event type.
About payment_status and txn_type with Subscription IPN. In IPN messages posted by
Subscription events, the payment_status variable is sent when a payment or refund occurs. For all other events, the pertinent variable is txn_type.
T
ABLE A.2 IPN Variables with Each Subscription Event
Payment
Variable Signup Cancel Modify
Payment (USD)
(Multi­Currency) Refund Failed EOT
Basic Information
business X XXX X XX
receiver_email X XXX X XX
receiver_id XX
item_name X XXX X XX
item_number X XXX X XX
Advanced and Custom Information
invoice X XXX X XX
custom X XXX X XX
option_name1 X XXX X XX
option_selecti on1
option_name2 X XXX X XX
option_selecti on2
Transaction Information
payment_status XX X
X XXX X XX
X XXX X XX
pending_reason XX
reason_code XX
66 March 2008 Order Management Integration Guide
T
ABLE A.2 IPN Variables with Each Subscription Event
Payment
Payment
Variable Signup Cancel Modify
payment_date XX
txn_id XX
parent_txn_id XX
(USD)
(Multi­Currency) Refund Failed EOT
IPN and PDT Variables
Subscriptions
A
txn_type subscr_
signup
Currency and Exchange information
mc_gross XX
mc_fee XX
mc_currency X XXX X XX
settle_amount XX
exchange_rate XX
payment_gross XXX
payment_fee X
Buyer Information
first_name X XXX X XX
last_name X XXX X XX
payer_business _name
address_name X XXX X X
X XXX X X
subscr_ cancel
subscr_ modify
subscr_payment subscr_
failed
subscr _ eot
address_street X XXX X X
address_city X XXX X X
address_state X XXX X X
address_zip X XXX X X
address_ country
payer_email X XXX X XX
payer_id X XXX X XX
payer_status X XXX X XX
payment_type XX
Order Management Integration Guide March 2008 67
X XXX X X
IPN and PDT Variables
A

Dispute Notification Variables

T
ABLE A.2 IPN Variables with Each Subscription Event
Variable Signup Cancel Modify
Subscription Information
subscr_date XXX
Payment (USD)
Payment (Multi­Currency) Refund Failed EOT
subscr_ effective
period1 XXX
period2 XXX
period3 XXX
amount1 XXX
amount2 XXX
amount3 XXX
mc_amount1 XXX
mc_amount2 XXX
recurring XXX
reattempt XXX
retry_at X
recur_times XXX
username X XXX X XX
X
password X XXX X XX
subscr_id X XXX X XX
Dispute Notification Variables
T
ABLE A.8 Dispute Notification Variables
Possible
Variable
txn_type new_case
68 March 2008 Order Management Integration Guide
Values Description
new_case: A new case has been registered.
adjustment
adjustment: A case has been resolved and closed.
IPN and PDT Variables
Dispute Notification Variables
T
ABLE A.8 Dispute Notification Variables
Possible
Variable
txn_id The merchant’s original transaction identification number for the
case_id Case identification number.
Values Description
payment from the buyer, against which the case was registered.
Format: PP-nnn-nnn-nnn where n is any numeric character.
A
case_type complaint
chargeback
case_ creation_
Transaction­specific
date
reason_code Depends on
value of
case_type
z complaint: A buyer has logged a complaint through the
PayPal Resolution Center.
z chargeback: A buyer has filed a chargeback with his credit
card company, which has notified PayPal of the reason for the chargeback.
Date and time case was registered, in the following format: HH:MM:SS DD Mmm YY, YYYY PST
Reason for the case. Values for case_type set to complaint:
z non_receipt: Buyer claims that he did not receive goods or
service.
z not_as_described: Buyer claims that the goods or service
received differ from merchant’s description of the goods or service.
Values for case_type set to chargeback:
z unauthorized z adjustment_reimburse: A case that has been resolved
and close requires a reimbursement.
z non_receipt: Buyer claims that he did not receive goods or
service.
z duplicate: Buyer claims that a possible duplicate payment
was made to the merchant.
z merchandise: Buyer claims that the received merchandise
is unsatisfactory, defective, or damaged.
z special: Some other reason. Usually, special indicates a
credit card processing error for which the merchant is not responsible and for which no debit to the merchant will result. PayPal must review the documentation from the credit card company to determine the nature of the dispute and possibly contact the merchant to resolve it.
Order Management Integration Guide March 2008 69
IPN and PDT Variables
A

PDT-Specific Variables

Miscellaneous and Fee-Related IPN Variables

TABLE A.9 Miscellaneous and Fee-Related IPN Variables
Variable Name
txn_type merch-pmt Monthly fee for use of Website Payments Pro 64
Possible Values Description
PDT-Specific Variables
The following variables apply only to PDT.
T
ABLE A.10 PDT-Specific Variables
Variable Description
amt Amount of the transaction
cc Currency code
cm Custom message
sig
st Transaction status
tx Transaction ID/PDT token
Char Length
70 March 2008 Order Management Integration Guide

Downloadable History Logs

A
TABLE B.1 Fields and Values in Downloadable History Logs
Field Name Description Format
Payment Button Variable
Related IPN Variable
Date Date transaction was initiated
(according to PayPal system time, US-Pacific time zone).
Log sorted in reverse chronological order by Date (most recent first)
Time Time transaction was initiated
(according to PayPal system time, US-Pacific time zone).
Timezone The time zone used for recording
transactions in your PayPal account.
Name Name of counterparty.
If counterparty is a PayPal verified user, this field will contain the user's first and last name. If counterparty is not a verified user, field will contain the user’s email address.
[M]M/[D]D/Y YYY
HH:MM:SS
Alphanumeric; three-character codes
alphanumeric; 128-character limit
payment_dat e
subscr_date
first_namel ast_name
Order Management Integration Guide March 2008 71
Downloadable History Logs
B
T
ABLE B.1 Fields and Values in Downloadable History Logs
Field Name Description Format
Payment Button Variable
Related IPN Variable
Type Type of transaction:
Add Funds from a Bank Account ATM Withdrawal ATM Withdrawal Reversal Auction Payment Received Auction Payment Sent Canceled Fee Canceled Payment Canceled Transfer Chargeback Settlement Check Withdrawal from PayPal Currency Conversion Debit Card Cash Advance Debit Card Purchase Dividend From PayPal Money
Market Donation Received Donation Sent eCheck Received eCheck Sent Funds Added with a Personal Check Guarantee Reimbursement Payment Received Payment Sent PayPal PayPal Balance Adjustment Referral Bonus Refund Shopping Cart Item Shopping Cart Payment Received Shopping Cart Payment Sent Subscription Payment Received Subscription Payment Sent Transfer Update to Add Funds from a
Bank Account Update to Debit Card Credit Update to eCheck Received Update to Payment Received Update to Payment Sent continued...
alphanumeric; 39-character limit
txn_type
72 March 2008 Order Management Integration Guide
T
ABLE B.1 Fields and Values in Downloadable History Logs
Field Name Description Format
Type (continued) Update to Reversal
Update to Web Accept Payment Received
Virtual Debit Card Authorization Virtual Debit Card Credit Received Virtual Debit Card Purchase Virtual Debt Card Credit Received Web Accept Payment Received Web Accept Payment Sent Withdraw Funds to a Bank Account
Downloadable History Logs
Payment Button Variable
Related IPN Variable
B
Status Status of transaction at time of
download: Canceled Cleared Completed Denied Expired Failed Pending Refunded Returned Reversed Unclaimed Uncleared
Subject Subject of transaction as entered by
counterparty
Currency Currency of transaction alphanumeric;
alphanumeric; 10-character limit
alphanumeric; 256-character limit
three character limit
currency_ code
payment_ status
pending_ reason
mc_currency
settle_ currency
exchange_ rate
mc_gross
Order Management Integration Guide March 2008 73
Downloadable History Logs
B
T
ABLE B.1 Fields and Values in Downloadable History Logs
Payment Button
Field Name Description Format
Gross Gross amount of transaction signed decimal amount payment_
Fee Fee (if applicable) for transaction signed decimal payment_fee
Net Net amount of transaction signed decimal
Variable
Related IPN Variable
gross
settle_ amount
amount1
amount2
amount3
mc_fee
Note Note for transaction as entered by
counterparty
From Email Address
To Email Address Email address of transaction recipient alphanumeric;
Transaction ID PayPal-generated unique transaction IDalphanumeric;
Payment Type Payment type used for transaction:
Counterparty Status Account status of buyer:
Email address of transaction sender alphanumeric;
eCheck Instant PayPal Funds
International – Unverified International – Verified Unverified Verified
alphanumeric; 2000-character limit
128-character limit
128-character limit
17-character limit
alphanumeric; 27-character limit
alphanumeric; 27-character limit
payer_email
business receiver_
email
txn_id
payment_typ e
payer_statu s
Address Status Status of counterparty’s Shipping
Address. Confirmed Non-confirmed
alphanumeric; 14-character limit
address_ status
74 March 2008 Order Management Integration Guide
T
ABLE B.1 Fields and Values in Downloadable History Logs
Field Name Description Format
Downloadable History Logs
Payment Button Variable
Related IPN Variable
B
Item Title Specified by buyer in the website
field:
z Auction/Item Title
Or by seller in any of the following button-creation fields:
z PayPal Shopping Cart Item Name z Buy Now Item Name z Donations Item Name z Subscriptions Name
Item ID Specified by buyer in the website
field:
z Auction/Item Number
Or by seller in any of the following button-creation fields:
z PayPal Shopping Cart Item
Number
z Buy Now ID Number z Donations ID Number z Subscription Reference Number
Shipping Amount Specified by buyer in the website
field:
z eBay/Auction Shipping amount
Or by seller in any of the following button-creation fields:
z PayPal Shopping Cart Shipping
amount
z Buy Now Shipping amount
alphanumeric; 128-character limit
alphanumeric; 256-character limit
unsigned decimal
item_name item_name
item_number item_number
shipping
shipping2
handling
Insurance Amount Specified by buyer in the website
field:
z eBay/Auction Insurance amount
Sales Tax Sales Tax Amount specified in
seller’s button-creation process and
unsigned decimal
unsigned decimal
tax
Profile preferences
Option 1 Name Specified by seller in any of the
following button-creation fields:
z PayPal Shopping Cart Option 1
alphanumeric; 60-character limit
on0 option_name
1
Name
z Buy Now Option 1 Name z Subscription Option 1 Name
Order Management Integration Guide March 2008 75
Downloadable History Logs
B
T
ABLE B.1 Fields and Values in Downloadable History Logs
Field Name Description Format
Payment Button Variable
Related IPN Variable
Option 1 Value Entered by buyer in any of the
following website fields:
z PayPal Shopping Cart Option 1
Va lu e
z Buy Now Option 1 Value z Subscription Option 1 Value
Or specified by seller in any of the following button-creation fields:
z PayPal Shopping Cart Value 1
Choices
z Buy Now Value 1 Choices z Subscription Value 1 Choices
Option 2 Name Specified by seller in any of the
following button-creation fields:
z PayPal Shopping Cart Option 2
Name
z Buy Now Option 2 Name z Subscription Option 2 Name
Option 2 Value Entered by buyer in any of the
following website fields:
z PayPal Shopping Cart Option 2
Va lu e
z Buy Now Option 2 Value z Subscription Option 2 Value
Or specified by seller in any of the following button-creation fields:
z PayPal Shopping Cart Value 2
Choices
z Buy Now Value 2 Choices z Subscription Value 2 Choices
alphanumeri c; 30­character limit
alphanumeric; 60-character limit
alphanumeric; 30-character limit
on1 option_name
2
on1 option_
selection1
os1 option_
selection2
Auction Site Name of Auction Site:
z eBay z Yahoo! Auctions z uBid.com z Amazon.com Auctions z MSN Auctions z BidVille z Other
Item URL URL of eBay/Auction Item
(eBay/Auction-specific)
alphanumeric; 20-character limit
alphanumeric; 256-character limit
76 March 2008 Order Management Integration Guide
T
ABLE B.1 Fields and Values in Downloadable History Logs
Field Name Description Format
Downloadable History Logs
Payment Button Variable
Related IPN Variable
B
Closing Date Close date of eBay/Auction Item
(eBay/Auction-specific)
[M]M/[D]D/Y YYY
Reference Txn ID Transaction ID of parent transaction alphanumeric;
17-character limit
Invoice Number Specified by seller in any of the
alphanumeric invoice invoice
following button-creation fields:
z PayPal Shopping Cart Invoice
Number
z Buy Now Invoice Number z Subscription Invoice Number
Subscription Number
PayPal-generated Subscription Transaction ID Number
S-xxxxxxxxxxxxxxxx
alphanumeric; 19-character limit
where x is the transaction ID.
Custom Number Specified by seller in any of the
alphanumeric custom custom
following button-creation fields:
z PayPal Shopping Cart Custom
Number
z Buy Now Custom Number z Subscription Custom Number
subscr_id
Shipping Address Line 1
First line of shipping address as specified by counterparty
alphanumeric; 395-character
address_ street1
limit
Shipping Address Line 2
Town/City Town/City of shipping address as
State/Province/Regi on/County/Territor y/Prefecture/Repub
Second line of shipping address as specified by counterparty (if applicable)
specified by counterparty
State/Province/Region/Territory/Prefe cture/Republic of shipping address as specified by counterparty
alphanumeric; 395-character
address_ street2
limit
alphanumeric address_cit
y
address_ state
lic
Zip/Postal Code Zip/Postal Code of shipping address
address_zip
as specified by counterparty
Country Country of shipping address as
specified by counterparty
Order Management Integration Guide March 2008 77
address_ country
Downloadable History Logs
B
T
ABLE B.1 Fields and Values in Downloadable History Logs
Field Name Description Format
Payment Button Variable
Related IPN Variable
Balance Account balance at time of
transaction. Balance is reported in the currency of the transaction.
The Balance column can show “...” in some instances, which indicates that showing a balance is not appropriate for these kinds of transaction.
signed decimal
78 March 2008 Order Management Integration Guide

Index

A
address 58 address_city 52 address_country 52 address_country_code 52 address_name 52 address_state 52 address_status 52 address_street 52 address_zip 52 adjustment 68 All Activity - Advanced View 39 amount1 65 amount2 65 amount3 65 amt 70 auction_buyer_id 62, 70 auction_closing_date 62 auction_multi_item 62 AUD 11 Australian Dollar 11 auth_amount 55 auth_exp 55 auth_id 55 auth_status 55 authorization 58
B
cc 70 chargeback 69 CHF 11 cm 70 complaint 69 Completed 55, 57 contact_phone 53 currency codes 11 custom 54 Czech Koruna 11 CZK 11
D
Danish Krone 11 Denied 57 DKK 11 downloadable history logs 7, 41 duplicate 69
E
echeck 57, 58 EUR 11 Euro 11 exchange_rate 60 Expired 57 express_checkout 60
Balance 39 business 53
C
CAD 11 Canadian Dollar 11 Canceled-Reversal 57 cart 60 case_creation_date 69 case_id 69 case_type 69
Order Management Integration Guide March 2008 79
F
Failed 57 first_name 52 for_auction 62 Forint 11 fraud prevention 26
G
GBP 11
Index
H
History 35 HKD 11 Hong Kong Dollar 11 HUF 11 Hungarian Forint 11
I
iif file format 43 instant 57 intl 58 invoice 54 item_name 53 item_number 53
J
Japanese Yen 11 JPY 11
mc_shipping 61 mc_shipping_x 56 memo 54 merchandise 69 merch-pmt 70 multi-currency 58
N
Net Amount 47 New Zealand Dollar 11 new_case 68 NOK 11 non_receipt 69 Norwegian Krone 11 not_as_described 69 notification 24 notification URL 24, 25 notification validation 26 notify_version 52 num_cart_items 56 NZD 11
K
Koruna 11 Krona 11 Krone 11
L
last_name 53 logs 7, 41
M
masspay_txn_id_x 62 mc_amount1 65 mc_amount2 65 mc_amount3 65 mc_currency 60, 65 mc_currency_x 62 mc_fee 60, 61, 63 mc_fee_x 62, 63 mc_gross 61 mc_gross_x 55, 63 mc_handling 61 mc_handling_x 55
O
option_name_1 54 option_name_2 54 option_name1 54, 56 option_name2 54, 56 option_selection1 54 option_selection1_x 56 option_selection2 55 option_selection2_x 56 other 58
P
parent_txn_id 56 password 65 payer_business_name 53 payer_email 53 payer_id 53 payer_status 53 payment_ tatus 57 payment_date 56, 63 payment_fee 61 payment_fee_x 63
80 March 2008 Order Management Integration Guide
Index
payment_gross 61 payment_gross_x 63 payment_status 51, 63 payment_type 57 PayPal-supported currencies 11 Pending 55, 57 pending_reason 58 period1 65 period2 65 period3 65 PLN 11 Polish Zloty 11 Pound Sterling 11 Processed 57
Q
qif file format 42, 43 quantity 54 QuickBooks 43 Quicken 42, 43
R
reason_code 59, 63, 69 ReasonCode 57 reattempt 65 receiver_ email_x 63 receiver_email 53, 54 receiver_id 54 recur_times 65 recurring 65 Refunded 57 remaining_settle 59 residence_country 53 retry_at 65 Reversed 57
Singapore Dollar 11 special 69 st 70 status_x 63 subscr_cancel 64 subscr_date 64 subscr_effective 64 subscr_eot 64 subscr_failed 64 subscr_id 66 subscr_modify 64 subscr_payment 64 subscr_signup 64 Swedish Krona 11 Swiss Franc 11
T
tax 55, 59 test_ipn 51 transaction_entity 59 tx 70 txn_id 59, 69 txn_type 60, 64, 68
U
U.S. Dollar 11 unauthorized 69 unilateral 58 unique_id_x 64 upgrade 58 URL-encoding in IPN data 51 USD 11 username 65
V
S
SEK 11 send_money 60 settle_amount 61 settle_currency 61 SGD 11 shipping 59 sig 70
Order Management Integration Guide March 2008 81
verify 58 verify_sign 52 virtual_terminal 60 Voided 55, 57
W
web 60
Index
Y
Ye n 11
Z
Zloty 11
82 March 2008 Order Management Integration Guide
Loading...