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.
Payflow Pro Reporting Developer’s Guide describes the Reporting XML API. The XML API
enables you to develop Web and desktop applications that create, schedule, and run standard
(pre-defined) and custom Payflow services reports.
Audience
This guide assumes that its readers:
z Have a good understanding of XML application development
z Have a background in payments services
You should familiarize yourself with the introductory and Payflow documentation on PayPal
Manager’s Documentation page.
Preface
Organization
This guide is organized as follows:
z Chapter 1, “Reporting Overview,” provides an overview of Reporting and the types of
functionality it offers.
z Chapter 2, “Using the Reporting API,” describes how to use the Reporting API.
z Chapter 3, “Response Codes and Status Codes,” identifies all supported standard reports,
along with the valid and required parameters of each. It also presents status codes and
response codes, along with their associated message strings.
z Appendix A, “Reporting XML Schema,” provides the XML schema upon which the
Reporting XML API is based.
z Appendix B, “Reporting Samples,” presents samples demonstrating how to use the
reporting API.
z Appendix C, “Report Parameters,” describes the input and output parameters for each
standard report.
z Appendix D, “Search Parameters,” describes the input and output parameters for
performing searches by search name.
Reporting Developer’s Guide7
Preface
Where to Go for More Information
Where to Go for More Information
PayPal Manager online help describes the use of PayPal Manager—the web-based
administration tool that you use to process transactions manually, issue credits, and generate
reports.
How to Contact Customer Service
For answers to specific questions about PayPal products, contact Customer Service at payflow-
support@paypal.com
Revision History
Revision history for Reporting Developer’s Guide.
TABLE P.1 Revision History
DateDescription
June 2010Updated for technical accuracy.
December 2009Added Fraud Transaction Search table.
November 2008Updated links to test and live reporting URLs.
June 2008Minor clarifications and corrections.
August 2007Updated Title page and logo.
July 2006Updated document title, product names.
Reformatted in PayPal templates.
Updated to support new currencies.
March 2006Integrated Express Checkout feature.
8Reporting Developer’s Guide
Reporting Overview
1
The Reporting API is an API that you can use to automate your report queries. It allows you to
programmatically query in XML the Reporting database.
PayPal Manager is also a client of the Reporting API. Everything that Manager can do with
reports is available to you through API calls. You can, for example, request a particular report
be run within a specified date range. The response returns all the data that the report generates.
The reporting engine encapsulates the information in all the Payflow services reports. You can
store this information in your local database and use it as needed.
Operations You Can Perform Using the Reporting API
The Reporting API enables you to perform the following operations:
z Managing report templates
z Running reports on demand by report or report template name
z Obtaining information about reports
z Managing report template schedules
z Performing searches
The standard (predefined) reports supported are described in Appendix C, “Report
Parameters.”
Managing Report Templates
You may want to create report templates based on the reports that are supported. A report
template lets you create an instance of a report. With this instance, you provide a list of
parameters.
Report templates are handy when you find that you frequently need to look up reports based
on the same criteria. You provide the parameters and values once, and Reporting saves this
information with the report template. When you run the report template, you do not need to
provide the parameters a second time.
Report template management enables you to perform all the following tasks:
z Create report templates
z Query report templates in the database
z Retrieve report templates from the database
z Update report templates
z Delete report templates
Reporting Developer’s Guide9
Reporting Overview
1
URL for Running Applications
Running Reports by Report Template Name or Report Name
You can run reports and report templates. To run a report or report template, you submit a
runReportRequest, passing in the respective report name or report template name. You
can also pass in additional parameters in with a request.
To submit a request to the Reporting API, you post your XML request via HTTPS to the host
URLs in the body of the request. No SDK is needed since you just perform a standard HTTPS
post using the language of your choice. The Content-Type for the request should be text/plain.
Obtaining Information about Reports
You can obtain the following information about reports:
z Report status
z Report results
Managing Report Template Schedules
You can create, update, and delete report template schedules.
Performing Searches
You can search for payment transaction data based on search names such as
TransactionIDSearch, BatchIDSearch, and AccountNumberSearch.
URL for Running Applications
Use the following URLs for running Reporting applications.
This chapter describes how you can use the Reporting API to perform the following tasks.
z “Running Reports” on page 12
z “Managing Report Templates” on page 14
z “Using Report Templates” on page 15
z “Performing Searches” on page 18
API Notation in this Chapter
The chapter uses the following short-hand notation for referring to Reporting API requests and
parameter information.
requestName (paramName, paramName, [...])
requestName is the name of the request. The request input parameters, if any, are listed in a
parameter list enclosed in parentheses.
Request Authorization Parameter Data
The Reporting API notation in this chapter does not include the authorization information that
is passed with every request. All Reporting API requests require that you specify these
parameters and values as your user information.
TABLE 2.1User information
ParameterDescription
userIf you set up one or more additional users on the account, this value is
the ID of the user authorized to process transactions. If, however, you
have not set up additional users on the account, user has the same value
as vendor.
vendorYour merchant login ID that you created when you registered for the
Payflow Pro account.
partnerThe ID provided to you by the authorized PayPal Reseller who
registered you for the Payflow Pro service. If you purchased your
account directly from PayPal, use PayPal.
passwordThe 6- to 32-character password that you defined while registering for
the account.
Reporting Developer’s Guide11
Using the Reporting API
2
Where to Go For More Information on the APIs
Response Data
Responses include the following information:
z All responses return a base response consisting of a response code (responseCode) and
a response message (responseMsg).
z Most responses return applicable response parameter data.
z Some responses return a status code (statusCode) and a status message
(statusMsg).
Where to Go For More Information on the APIs
To understand how the XML API is coded, look at the request notation along with the XML
schema, samples, and report parameters in this guide. See the following sources for details:
SourceContents
Chapter 3,
“Response Codes
and Status Codes”
Appendix AContains the XML schema.
Appendix BProvides API request and response samples for each request and
Appendix CDescribes the input and output parameters for all standard (predefined)
Appendix DDescribes the input and output parameters for all report searches
Running Reports
You can run reports and obtain the report data right away. If, however, running a report takes
more than the time allotted, the report is run offline, and you must periodically check for the
report data.
Lists all response codes, status codes, and their message strings.
response referred to in this chapter.
reports supported.
supported.
12Reporting Developer’s Guide
Running a Report and Obtaining Report Data
This procedure describes how to run a report and how to obtain the data in that report.
Step 1. Run the report
To run a report, call runReportRequest, providing the following parameter
information.
reportNameName of the report, for example, DailyActivityReport.
reportParam(s)(Optional) paramName and paramValue for each request input
param to be assigned a value.
pageSizeNumber of rows of data per page. Default is 50.
The runReportResponse returns the reportId. The reportId is used to refer to the
particular report in future requests.
Using the Reporting API
Running Reports
2
Step 2. Get the metadata
To get information on how the report is formatted, call getMetaDataRequest, providing
the ReportId returned when the report was run.
getMetaDataRequest(ReportId)
getMetaDataResponse returns the following data.
ParameterDescription
numberOfRowsTotal number of rows.
numberOfPagesTotal number of pages in the report.
pageSizePage size.
numberOfColumnsTotal number of columns.
dataNameName of each column.
dataTypeType of column data, for example, string.
Step 3. Get the report data
To get the actual data in the report, call getDataRequest with the following parameters.
getDataRequest(reportId, pageNum)
reportIdID returned for this report returned by runReportRequest.
pageNumReport page number containing data to be returned.
Reporting Developer’s Guide13
Using the Reporting API
2
Managing Report Templates
Data is returned for the report page specified by pageNum. To obtain the data in a multi-page
report, you must call getDataRequest for each report page.
Running Reports Offline
When a report takes longer to run than the time allotted, it is taken offline and status code 2,
“Report is currently executing,” is returned. You must check for the results at a later time.
Step 1. Run the report
Request to run a report by calling runReportRequest. See “Step 1. Run the report” on
page 13.
The report times out. The ReportId and status code 2 are returned.
Step 2. Get the report results later
It is your responsibility to obtain the report results at a later time. Call
getResultsRequest, providing the reportId as a parameter.
getResultsRequest(reportId)
getResultsResponse returns a statusCode and statusMsg. Call
getResultsResponse in a loop until statusCode 3, “Report has completed
successfully,” is returned.
Step 3. Get the metadata
Request to get the report’s metadata by calling getMetaDataRequest. See “Step 2. Get
the metadata” on page 13.
Step 3. Get the report data
Request to get the report data by calling getDataRequest. See “Step 3. Get the report
data” on page 13.
Managing Report Templates
Using the Reporting API, you can create, update, and delete report templates.
Step 1. Create a report template
To create a report template, call createTemplateRequest with the following parameters.
templateNameName that you are giving to the report template.
reportNameStandard report from which you are creating the report template.
14Reporting Developer’s Guide
Using the Reporting API
Using Report Templates
reportParam(s)paramName and paramValue of each reportParam to be assigned a
value.
The response to creating a report template returns a respCode and respMsg.
Step 2. Update a report template
To update a report template, call the updateTemplateRequest with the following
parameters.
updateTemplateRequest(templateName, reportParams)
templateNameName given to the report template when it was created.
reportParam(s)paramName and paramValue of each reportParam to be
assigned a value.
The response to updating a report template returns a respCode and respMsg.
N OTE: Updating a report template is not incremental. It only sets values for the parameters
that are passed to updateTemplateRequest.
2
Step 3. Delete a report template
To delete a report template, call deleteTemplateRequest, providing the
templateName as the input parameter.
deleteTemplateRequest(templateName)
The response to deleting a report template returns a respCode and respMsg.
Using Report Templates
Report templates are run like any standard report. They can also be scheduled to run on a daily,
weekly, or monthly basis. Finally, report template schedules can be updated or deleted.
Running a report template and obtaining the report template data
Step 1. Run a report template
To run a report template, call runReportRequest with the following parameters.
templateNameName given to the report template when it was created.
Reporting Developer’s Guide15
Using the Reporting API
2
Using Report Templates
reportParam(s)(Optional) paramName and paramValue for each reportParam that you
pageSizeNumber of rows of data per page. Default is 50.
Step 2. Get the metadata
Request to get the report’s metadata by calling getMetaDataRequest. See “Step 2. Get
the metadata” on page 13.
Step 3. Get the report data
Request to get the report data by calling getDataRequest. See “Step 3. Get the report
data” on page 13.
Scheduling a Report Template
want to assign a value to. These parameters can be ones previously
saved in the report template or additional ones. The parameter values
take precedence over the values previously saved for the parameters in
the report template.
You can schedule a report template to run on a daily, weekly, or monthly basis. The Reporting
API includes functionality to create schedules and to get the results of a scheduled report
template.
Step 1. Create a schedule
To create a schedule for a report template, call createScheduleRequest with the
following parameters.
monthly (Specify dayOfMonth value as an integer from 1 to 31. If you
specify 30 when the month is 28 days long, the value is corrected to
28.)
The time of the day starts at midnight the previous night. The value
daily, for example, means midnight the previous night to midnight
tonight.
Step 2. Get the results
To get the results of a scheduled report template that is run, call getScheduleRequest
with scheduleName as a parameter.
getScheduleRequest(schedulename)
16Reporting Developer’s Guide
getScheduleResponse returns all the reportIds and execution dates of the reports that
were run on the schedule.
Step 3. Get the metadata
For each report, call getMetaDataRequest, passing in the reportId as a parameter, to get
the information on how that report is formatted. See “Step 2. Get the metadata” on page 13.
Step 4. Get the report data
Request to get the report data for each report that was run by calling getDataRequest. See
“Step 3. Get the report data” on page 13.
Managing Report Template Schedules
Using the Reporting API, you can update and delete report template schedules.
Update a schedule
To update a schedule, call the updateScheduleRequest with the following parameters.
searchNameOne of the search names listed above, for example,
TransactionIDSearch.
reportParam(s)paramName and paramValue of one or more input parameters for this
search. See
Appendix C, “Report Parameters,” for the required and
optional parameters.
pageSizeNumber of rows of data per page. Default is 50.
runSearchResponse returns the reportId for this search as well as the statusCode
and statusMsg.
Step 2. Get the metadata
Request to get the search metadata by calling getMetaDataRequest. See “Step 2. Get the
metadata” on page 13.
Step 3. Get the report data
Request to get the search data by calling getDataRequest. See “Step 3. Get the report
data” on page 13.
18Reporting Developer’s Guide
Response Codes and Status
3
Codes
This chapter provides the following details on reports. It identifies:
z Response codes and response messages
z Status codes and the status messages
Response Codes
Response codes indicate the success or failure of a Reporting request. Table 5-2 describes the
supported response codes and messages returned with each.
TABLE 3.1Response codes and response messages
Response CodeResponse Message
100Request has completed successfully
101Request has failed
102An internal scheduler error has occurred
103Unknown report requested
104Invalid Report ID
105A system error has occurred
106A database error has occurred
107Invalid XML request
108User authentication failed
109Invalid report parameters provided
110Invalid merchant account
111Invalid page number
112Template already exists
113Unknown template requested
Reporting Developer’s Guide19
Response Codes and Status Codes
3
Status Codes
Status Codes
Status codes indicate the status of a report, not necessarily the status of the Reporting request
to be executed. A report may fail even if a Reporting request succeeds.
TABLE 3.2Status codes and status messages
Status CodeStatus Message
1Report has been created
2Report is currently executing
3Report has completed successfully
4Report has failed
5Report has expired
6Report has expired
20Reporting Developer’s Guide
Reporting XML Schema
A
This appendix contains the XML Reporting 1.0 schema.
This appendix demonstrates how to use the Reporting API to create, run, and manage reports.
For details on the predefined reports named in this appendix, see the Manager User’s Guide.
N OTE: In this appendix, replace these values shown in boldface with appropriate values:
User, Vendor, Partner, and Password.
Running a Daily Activity Report
This section demonstrates how to run a Daily Activity Report.
Running a Daily Activity Report Request
The request demonstrates how to run a Daily Activity Report with a page size of 50 lines to
obtain results for September 7, 2007.
In the response to running the Daily Activity Report, the responseCode of 100 indicates
that the report completed successfully. The reportId 132 returned is used to uniquely
identify this report in future calls to the Reporting API.