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.
6April 2007Name-Value Pair API Developer Guide and Reference
Preface
This Document
The PayPal Name-Value Pair API Developer Guide and Reference describes the PayPal
Name-Value Pair API.
Intended Audience
The PayPal Name-Value Pair API Developer Guide and Reference is written for web
developers who are implementing solutions using the Name-Value Pair API.
Documentation Problems
If you discover any errors in or have any problems with this documentation, please email us by
following the instructions below. Describe the error or problem as completely as possible and
give us the document title, the date of the document, and the page number or page range.
To contact Developer Technical Support about documentation problems:
Log in to your account at
password in the Member Log In box
Click Help Center at the bottom of the box on the right side of the page.
Click Email PayPal Technical Support.
Complete the form.
https://developer.paypal.com/ by entering your email address and
Name-Value Pair API Developer Guide and ReferenceApril 20077
Preface
Revision History
Revision History
Revision history for PayPal Name-Value Pair API Developer Guide and Reference.
TABLE P.1 Revision History
DateDescription
April 2007Revised document to represent specifics for Germany.
February 2007Bug fixes including updating Line Item Details for Express Checkout APIs, dding
December 2006Updates for bug fixes.
October 2006First public release.
SHIPTOCOUNTRYCODE, and adding Switch/Solo codes for AVS and CVV2.
8April 2007Name-Value Pair API Developer Guide and Reference
Overview
1
This chapter describes the PayPal Name-Value Pair (NVP) API at a high level and contains the
following sections:
z Introducing the PayPal NVP API
z Basic Steps
z Taking Your Application Live
z Technical Details
Introducing the PayPal NVP API
The PayPal NVP API is a simple programmatic interface that allows you, the merchant, to
access PayPal’s business functionality to:
z Accept PayPal in checkout on your website using Express Checkout.
z Pay one or more recipients using Mass Payment.
z Issue full refunds or multiple partial refunds.
z Search transactions using a start date or other criteria.
z View details of a specific transaction.
The PayPal NVP API makes it easy to add PayPal to your web application. You construct an
NVP string and post it to the PayPal server using HTTPS. PayPal posts back a reponse in NVP
format.
Integrating with the PayPal API
You can develop with the PayPal NVP API using two different approaches:
Integrate Directly
You can integrate directly with the PayPal NVP API using the programming language of your
choice. This is the most straightforward and flexible approach. You can download web
samples that show how to integrate directly using PHP, Classic ASP, and ColdFusion.
For more information, see Appendix C, “NVP API Web Samples.”
Integrate Using an SDK
You can integrate with the NVP API using a software development kit (SDK). SDKs are
provided for Java and ASP.NET. The SDKs provide simple functions for integrating with the
NVP API.
Name-Value Pair API Developer Guide and ReferenceApril 20079
Overview
Basic Steps
For details about the PayPal NVP SDK, see Appendix D, “The Java SDK” or Appendix E,
“The ASP.NET SDK.”
Samples
To help you get started with the PayPal NVP API, samples are provided at
https://www.paypal.com/IntegrationCenter/ic_nvp.html. Using the samples, you can send API
calls to the PayPal Sandbox test environment.
Basic Steps
This section describes the basic steps for programming with the PayPal NVP API.
During application development, your application communicates with the PayPal Sandbox test
environment. The following section, “Taking Your Application Live” on page 11, describes
how to move your application to the live PayPal environment.
N OTE: The simplest way to get started is to download and try out the sample applications as
described in “Integrating with the PayPal API” on page 9.
Create a Web Application
Your NVP API implementation usually runs in a web application. You can write your own
application or use one of the samples as a starting point.
Get API Credentials
To access the PayPal API, you need API credentials, either an API signature or API certificate,
that identify you.
Use the following sample API signature and password in your sample programs that run in the
PayPal Sandbox test environment.
N OTE: If you are using the samples, this signature is already in the code.
TABLE 1.1 Details of the Sample API Signature
API usernamesdk-three_api1.sdk.com
API passwordQFZCWN5HZM8VBG7Q
API signatureA-IzJhZZjhg29XQ2qnhapuwxIDzyAZQ92FRP5dqBzVesOkzbdUONzmOU
10April 2007Name-Value Pair API Developer Guide and Reference
Create and Post the Request
Create an NVP request string and post it to PayPal sandbox server. Add code to your web
application to do the following tasks:
1. URL-encode the name and value parameters in the request to ensure correct transmission
of all characters. This is described in “URL-Encoding” on page 13.
2. Construct the NVP API request string as described in “Request Format” on page 14. The
NVP format is described in “NVP Format” on page 12.
3. Post the NVP request to the PayPal Sandbox as described in “Posting Using HTTPS” on
page 16.
Interpret the Response
PayPal processes your request and posts back a reponse in NVP format. Add code to your web
application to do the following tasks:
1. Receive the HTTP post response, and extract the NVP string.
Overview
Taking Your Application Live
2. URL-decode the parameter values as described in “URL-Encoding” on page 13.
3. Take appropriate action for successful and failed reponses.
Taking Your Application Live
After you have finished coding and testing your application, deploy your application to the
live PayPal server using your PayPal business account and API credentials for that account.
Set Up a PayPal Business Account
When you are ready to deploy your application to the live PayPal server, create a PayPal
business account on
Set Up API Credentials
To use the APIs, you need a set of credentials to identify yourself to PayPal. Create an API
signature for your business account.
For instructions on setting up API credentials for the business account, go to
Name-Value Pair API Developer Guide and ReferenceApril 200711
Overview
Technical Details
IMPORTANT: If you are using API signature, you must protect the API signature values in
N OTE: While API signature is recommended, you can also use API certificate.
Modify Your Code
In your application, change the following items from the PayPal Sandbox values to the live
PayPal server values:
z The server address in the URL. (See “Posting Using HTTPS” on page 16.)
z API credentials you set up in “Set Up API Credentials” on page 11.
your implementation. Consider storing these values in a secure location other
than your web server document root and setting the file permissions so that
only the system user that executes your ecommerce application can access it.
The sample code does not store these values securely. The sample code
should never be used in production.
Technical Details
This section describes details of the technologies used by the PayPal NVP API.
Request-Response Model
When you use the PayPal NVP API, you post an NVP request to PayPal, and PayPal posts
back an NVP response.
URL Format
The request and response are in URL-encoded format, which is defined by the Worldwide Web
Consortium (W3C). URL is defined as part of the URI specification. Find out more about URI
at
http://www.w3.org/Addressing/.
NVP Format
NVP is a way of specifying names and values in a string. NVP is the informal name for the
query in the URI specification. The NVP string is appended to the URL.
An NVP string conforms to the following guidelines:
z The name is separated from the value by an equal sign (=). For example:
FIRSTNAME=Robert
z Name-value pairs are separated by an ampersand (&). For example:
12April 2007Name-Value Pair API Developer Guide and Reference
Overview
Technical Details
URL-Encoding
The request and response are URL-encoded. URL-encoding ensures that you can transmit
special characters, characters that are not allowed in a URL, and characters that have special
meaning in a URL, such as the equal sign and ampersand. For example, the following NVP
string:
NAME=Robert Moore&COMPANY=R. H. Moore & Associates
DecodeNo built-in function. Several implementation examples are available on the
Internet.
Decodejava.net.URLDecoder.decode
Decodeurldecode()
DecodeURLDecodeurlEncodedString[, charset])
Name-Value Pair API Developer Guide and ReferenceApril 200713
Overview
Technical Details
Request Format
Each NVP request consists of required and optional parameters and their values. Parameter
names are not case sensitive. The examples in this document use UPPERCASE for parameter
names and divide the parameters into required security parameters and body parameters.
In practice, you need to concatenate all parameters and values into a single URL-encoded
string. After the METHOD parameter, you can specify the parameters in any order.
Required Security Parameters
The required security parameters are described below. These are your PayPal API credentials.
TABLE 1.4 Required Security Parameters: API Credentials
ParameterValue
USERRequiredYour PayPal API Username.
PWDRequiredYour PayPal API Password.
VERSION=2.3RequiredVersion number of the NVP API service.
SIGNATUREOptionalYour PayPal API signature string.
If you use an API certificate, do not include this parameter.
SUBJECTOptionalEmail address of a PayPal account that has granted you permission to
make this call.
Set this parameter only if you are calling an API on a different user’s
behalf.
IMPORTANT: You must protect the values for USER, PWD, and SIGNATURE in your
implementation. Consider storing these values in a secure location other than
your web server document root and setting the file permissions so that only
the system user that executes your ecommerce application can access it.
The sample code does not store these values securely. The sample code
should never be used in production.
14April 2007Name-Value Pair API Developer Guide and Reference
Overview
Technical Details
You may see sample code where these values are stored in an HTML form.
The following is an example of what you should NOT do in production:
<form method=post
action=https://api-3t.sandbox.paypal.com/nvp>
<!-- UNPROTECTED VALUES. DO NOT USE IN PRODUCTION! -->
<input type=hidden name=USER value=xxxxxx.paypal.com>
<input type=hidden name=PWD value=abcdefg>
<input type=hidden name=SIGNATURE value=xxxxxxxxxxxxxxx>
...
</form>
API Parameters
The request body must contain the name of the API method in the METHOD parameter. In
addition, each method has required and optional parameters:
METHOD=methodName&requiredAndOptionalParameters
All API methods and their parameters are detailed in Appendix A, “NVP API Method and
Field Reference.” Examples of use are in Chapter 2, “Accepting PayPal in Express Checkout,”
and Chapter 3, “Back-Office Administration.”
Response Format
A response from the PayPal servers is a URL-encoded name-value pair string, just like the
request, except it has the following general format.
TABLE 1.5 General Format of a Successful Response
Success
Response
Fields
API Response
Fields
ACK=Success&TIMESTAMP=date/timeOfResponse
&CORRELATIONID=debuggingToken&VERSION=2.300000
&BUILD=buildNumber
&NAME1=value1&NAME2=value2&NAME3=value3&...
Each response includes the ACK field. If the ACK field’s value is Success or
SuccessWithWarning, you should process the API response fields. In a successful response,
you can ignore all fields up to and including the BUILD field. The important fields begin after
the BUILD field.
The possible successful response fields for each method are detailed in Appendix A, “NVP
API Method and Field Reference.” What you do with the fields depends on the particular API
method you are calling, such as filling-in a FORM for your user, updating your database, and
so on.
The examples show the
successful response header fields
like this:
[successResponseFields]
Name-Value Pair API Developer Guide and ReferenceApril 200715
Overview
Technical Details
Error Responses
If the ACK value is Error or Warning, API response fields are not returned. An error response
has the following general format.
TABLE 1.6 Format of an Error Response
Response
Fields on Error
For possible causes of errors and how to correct them, see the explanation of the specific error
code, short message, and long message in Appendix B, “Error Message Reference.”
ACK Parameter Values
The following table lists values for the ACK parameter.
T
ACK=Error&TIMESTAMP=date/timeOfResponse&
CORRELATIONID=debuggingToken&VERSION=2.300000&
BUILD=buildNumber&L_ERRORCODE0=errorCode&
L_SHORTMESSAGE0=shortMessage
L_LONGMESSAGE0=longMessage
&L_SEVERITYCODE0=severityCode
ABLE 1.7 ACK Parameter Values
Type of ResponseValue
Successful responseSuccess
SuccessWithWarning
Error responseError
Warning
Multiple errors can be returned.
Each set of errors has a different
numeric suffix, starting with 0
and incremented by one for each
error.
Posting Using HTTPS
Your web application posts the URL-encoded NVP string over an HTTPS connection to one of
the PayPal API servers. PayPal provides a live server and a Sandbox server that allows you to
process transactions in a test environment.
API Servers for API Signature Security
If you use an API signature, post the request to one of these servers:
Sandbox: https://api-3t.sandbox.paypal.com/nvp
Live: https://api-3t.paypal.com/nvp
API Servers for API Certificate Security
If you use an API certificate, post the request to one of these servers:
Sandbox: https://api.sandbox.paypal.com/nvp
Live: https://api.paypal.com/nvp
16April 2007Name-Value Pair API Developer Guide and Reference
Accepting PayPal in Express
2
Checkout
By choosing Express Checkout, the customer can save time by skipping several checkout steps
using the billing and shipping information stored on PayPal.
This section describes how to use Express Checkout to accept payments using PayPal and
contains the following topics:
z “Basic Checkout with PayPal” on page 17
z “Controlling the Shipping Address Using SetExpressCheckout” on page 21
z “Changing the Language on the PayPal Login Page Using SetExpressCheckout” on
page 23
z “Changing the Logo on the PayPal Pages Using SetExpressCheckout” on page 23
z “Form-Filling Your Payment Review Page Using GetExpressCheckoutDetails” on page 24
z “Making a Sale Using DoExpressCheckoutPayment” on page 25
z “Changing the URL for IPN Using DoExpressCheckoutPayment” on page 25
z “Including Line Item Details Using DoExpressCheckoutPayment” on page 26
z “Including Subtotals Using DoExpressCheckoutPayment” on page 27
z “Updating Order Details Using DoExpressCheckoutPayment” on page 27
z “Updating the Shipping Address Using DoExpressCheckoutPayment” on page 28
Basic Checkout with PayPal
N OTE: See the Integrationshandbuch Express-Kaufabwicklung for details on Express
Checkout including page flow, integration points, button placement, and page design.
Express Checkout with PayPal requires the following steps:
1. Starting the Checkout Using SetExpressCheckout
2. Redirecting the Customer’s Browser to PayPal Login Page
3. Getting Payer Details Using GetExpressCheckoutDetails
4. Making a Sale Using DoExpressCheckoutPayment
In SetExpressCheckout response, you obtain a TOKEN that uniquely identifies this threestep transaction. You pass this TOKEN in the request to GetExpressCheckoutDetails and
DoExpressCheckoutPayment. Both GetExpressCheckoutDetails and
DoExpressCheckoutPayment return this TOKEN in the response.
This example shows basic checkout using the minimum number of parameters.
Name-Value Pair API Developer Guide and ReferenceApril 200717
Accepting PayPal in Express Checkout
2
Basic Checkout with PayPal
1. Starting the Checkout Using SetExpressCheckout
The SetExpressCheckout request method notifies PayPal that you are using Express
Checkout to obtain payment from your customer.
You must always include the following parameters in SetExpressCheckout request:
z AMT
z RETURNURL
z CANCELURL
You are also advised to include the following parameters to ensure a smooth flow in case the
funding methods giropay or electronic funds transfer are being used:
z GIROPAYSUCCESSURL
z GIROPAYFAILURL
z BANKTXNPENDINGURL
N OTE: Because we do not specify a value for PAYMENTACTION, this parameter defaults to
Sale.
Save TOKEN for use on the remaining Express Checkout calls.
2. Redirecting the Customer’s Browser to PayPal Login Page
After you receive a successful response from SetExpressCheckout, add the TOKEN from
SetExpressCheckout response as a name/value pair to the following URL, and redirect
For redirecting the customer’s browser to the PayPal login page, PayPal recommends that you
use the HTTPS response 302 “Object Moved” with the URL above as the value of the
Location header in the HTTPS response. Ensure that you use an SSL-enabled server to
prevent browser warnings about a mix of secure and insecure graphics.
18April 2007Name-Value Pair API Developer Guide and Reference
Accepting PayPal in Express Checkout
Basic Checkout with PayPal
3. Getting Payer Details Using GetExpressCheckoutDetails
The GetExpressCheckoutDetails method returns information about the customer,
including name and address stored on PayPal.
You must always include the following parameters in GetExpressCheckoutDetails:
z TOKEN: use the value from SetExpressCheckout response
The response contains this TOKEN and customer details.
Make sure TOKEN matches the value in SetExpressCheckout response.
Save PAYERID for use on the next call.
4. Making a Sale Using DoExpressCheckoutPayment
Request to obtain payment with PayPal Express Checkout using
DoExpressCheckoutPayment request.
By default, you make a final sale with DoExpressCheckoutPayment request.
You must always include the following parameters in DoExpressCheckoutPayment
request:
z TOKEN: use the value from GetExpressCheckoutDetails response
z PAYERID: use the value from GetExpressCheckoutDetails response
z PAYMENTACTION: set to Sale. This is the default value in SetExpressCheckout.
z AMT: use the same value as in SetExpressCheckout request
EXAMPLE 2.3 Making a Sale
[requiredSecurityParameters]
TOKEN=EC-0E881823PA052770A&AMT=10.00&
Request
Name-Value Pair API Developer Guide and ReferenceApril 200719
To support giropay payments, you pass the following three URLs as part of the
SetExpressCheckout request. These URLs tell PayPal where to redirect the customer
based on the success or failure of each type of payment transaction.
TABLE 2.1SetExpressCheckout fields for giropay
NVPSOAPDescriptionRequired?
GIROPAYSUCCESSURLgiropaySuccessURLThe URL on the merchant site to
redirect to after a successful
giropay payment.
No
GIROPAYCANCELURLgiropayCancelURLThe URL on the merchant site to
BANKTXNPENDINGURLBanktxnPendingURLThe URL on the merchant site to
Redirecting the Customer to PayPal
After selecting a funding source on PayPal, the customer is redirected back to your website, as
in the regular Express Checkout flow. There is one additional field, REDIRECTREQUIRED,
returned in the response from both GetExpressCheckoutDetails and
DoExpressCheckoutPayment.
If the value of this field is true, you redirect the customer from your Order Review page to
https://www.paypal.com/webscr?cmd=_complete-express-checkout&token=TOKEN . Append the
token that you received in SetExpressCheckout. PayPal then redirects the customer from this
redirect page to the necessary page for the selected funding source.
No
redirect to after a giropay or bank
transfer payment is cancelled or
fails.
No
transfer to after a bank transfer
payment.
20April 2007Name-Value Pair API Developer Guide and Reference
Accepting PayPal in Express Checkout
Controlling the Shipping Address Using SetExpressCheckout
Completing the Transaction
Corresponding the three fields passed to SetExpressCheckout (see Table 2.1,
“SetExpressCheckout fields for giropay”), you must add the following three additional pages
to your website:
TABLE 2.2Additional pages required for giropay integration
PageDescription
Order CompletionThe page to redirect the customer to after a successful giropay payment.
Order CancellationThe page to redirect the customer to after a giropay or bank-transfer payment
is cancelled or fails
Order PendingThe page to redirect the customer to after a bank-transfer payment.
Controlling the Shipping Address Using SetExpressCheckout
2
You can make changes to the behavior of the shipping address with the
REQCONFIRMSHIPPING, NOSHIPPING, and ADDROVERRIDE parameters in
SetExpressCheckout request.
N OTE: The shipping address is specified in the SHIPTOxxx parameters.
Suppressing Display of Shipping Address on PayPal
To suppress the display of the customer’s shipping address on the PayPal web pages, set
NOSHIPPING to 1 in SetExpressCheckout request. You might want to do this if you are
selling a product or service that does not require shipping.
To override the shipping address stored on PayPal, call SetExpressCheckout to set
ADDROVERRIDE to 1 and set the shipping address fields (see Table A.3, “Ship to Address
(Optional)”).
The customer cannot edit the address if it has been overridden.
22April 2007Name-Value Pair API Developer Guide and Reference
Accepting PayPal in Express Checkout
Changing the Language on the PayPal Login Page Using SetExpressCheckout
Changing the Language on the PayPal Login Page Using
SetExpressCheckout
To change the language displayed on the PayPal login page, set LOCALECODE to one of the
allowable values in SetExpressCheckout. For LOCALECODE values, see Table A.2,
“SetExpressCheckout Request Parameters”. The following example sets LOCALECODE to
French.
EXAMPLE 2.5 Changing the PayPal Login Page Language to French
You can modify the logo and other color settings on the PayPal pages in two ways:
z Specifying a predefined Custom Payment Page Style
z Setting logo and color settings individually
Specifying a Custom Payment Page Style
You can set the Custom Payment Page Style for the PayPal pages by setting the PAGESTYLE
parameter in SetExpressCheckout. Set PAGESTYLE to one of the Page Style Names you
defined in your Custom Payment Pages on
https://www.paypal.com.
The following example sets PAGESTYLE to DesignerFotos-Yellow in the SetExpressCheckout method
EXAMPLE 2.6 Specifying a Custom Payment Page Style
Name-Value Pair API Developer Guide and ReferenceApril 200723
PAGESTYLE=DesignerFotos-Yellow
[successResponseFields]
&METHOD=SetExpressCheckout&AMT=10.00&
&TOKEN=EC-17C76533PL706494P
Accepting PayPal in Express Checkout
2
Form-Filling Your Payment Review Page Using GetExpressCheckoutDetails
Specifying Logo and Color Settings Individually
You can modify the PayPal web pages to look like your own web pages by setting the
following parameters in SetExpressCheckout:
z HDRIMG: specify an image to appear at the top left of the payment page
z HDRBORDERCOLOR: set the border color around the header of the payment page
z HDRBACKCOLOR: set the background color for the background of the header of the payment
page
z PAYFLOWCOLOR: set the background color for the payment page
EXAMPLE 2.7 Specifying Logo and Color Settings Individually
Use the payer name and shipping address returned by GetExpressCheckoutDetails
response to fill in form fields on your payment review page which you display after the
customer returns from PayPal.
24April 2007Name-Value Pair API Developer Guide and Reference
Accepting PayPal in Express Checkout
Making a Sale Using DoExpressCheckoutPayment
Get the payer name from the following parameters in GetExpressCheckoutDetails
response:
z SALUTATION
z FIRSTNAME
z MIDDLENAME
z LASTNAME
z SUFFIX
Get the shipping address from the following parameters in GetExpressCheckoutDetails
response:
z SHIPTONAME
z SHIPTOSTREET
z SHIPTOSTREET2
z SHIPTOCITY
z SHIPTOSTATE
2
z SHIPTOCOUNTRYCODE
z SHIPTOPHONENUM
z SHIPTOZIP
Making a Sale Using DoExpressCheckoutPayment
Use DoExpressCheckoutPayment to make a final sale.
For more information, see “Basic Checkout with PayPal” on page 17.
Changing the URL for IPN Using DoExpressCheckoutPayment
You can change the URL for receiving Instant Payment Notification (IPN) about this
transaction by setting the NOTIFYURL parameter in DoExpressCheckoutPayment.
N OTE: If you do not specify this value in the request, the notification URL from your
Merchant Profile is used, if one exists.
For more information about IPN, see the Order Management Integration Guide.
Including Line Item Details Using DoExpressCheckoutPayment
You can include line item details by setting the following parameters in
DoExpressCheckoutPayment:
z L_NAMEn: item name or description
z L_NUMBERn: line item number
z L_QTYn: item quantity
z L_TAXAMTn: sales tax for the item
z L_AMTn: cost of item
You can detail as many items as you want. Beginning with 0, append an index number to the
field name and increment that index number by one for each item.
The following example sets line item details for two items. These details are recorded on
PayPal.
EXAMPLE 2.10 Including Line Item Details
&METHOD=DoExpressCheckoutPayment&
&TOKEN=EC-4XH62109C8044521N&
n, you must specify the TAXAMT parameter. The values for
N OTE: If the line item details do not add up to ITEMAMT or TAXAMT, the line item details are
discarded, and the transaction is processed using the values of ITEMAMT or TAXAMT.
The ACK value in the response is set to SuccessWithWarning.
Including Subtotals Using DoExpressCheckoutPayment
If you want the PayPal user to see subtotals of item cost, shipping charges, handling charges,
and sales tax, include the following parameters in DoExpressCheckoutPayment:
z ITEMAMT
z SHIPPINGAMT
z HANDLINGAMT
z TAXAMT
2
N OTE: Be sure that the summed values of ITEMAMT, SHIPPINGAMT, HANDLINGAMT, and
TAXAMT equal the value of AMT. You cannot include a zero amount for any of these
Updating Order Details Using DoExpressCheckoutPayment
You may need to update order details on PayPal if the customer makes a change to the order
after returning to your order review page. If the change causes new values for one or more of
the following parameters, you need to update the order details on PayPal using
DoExpressCheckoutPayment:
Name-Value Pair API Developer Guide and ReferenceApril 200727
Accepting PayPal in Express Checkout
2
Updating the Shipping Address Using DoExpressCheckoutPayment
z DESC: item description
z CUSTOM: field for your own use
z INVNUM: your invoice or tracking number
These three parameters may have been set in SetExpressCheckout.
You may need to update the shipping address on PayPal if the customer updates the shipping
address after returning to your order review page. If this happens, you need to update the
shipping address for this transaction on PayPal.
You can update the shipping address by setting the following parameters in
DoExpressCheckoutPayment:
z SHIPTONAME
z SHIPTOSTREET
z SHIPTOSTREET2
z SHIPTOCITY
z SHIPTOSTATE
z SHIPTOCOUNTRYCODE
z SHIPTOPHONENUM
z SHIPTOZIP
28April 2007Name-Value Pair API Developer Guide and Reference
Updating the Shipping Address Using DoExpressCheckoutPayment
Name-Value Pair API Developer Guide and ReferenceApril 200729
Accepting PayPal in Express Checkout
2
Updating the Shipping Address Using DoExpressCheckoutPayment
30April 2007Name-Value Pair API Developer Guide and Reference
Back-Office Administration
3
This section gives you examples of the following functions:
z “Refunding Using RefundTransaction” on page 31
z “Searching for Transactions Using TransactionSearch” on page 32
z “Viewing Details of a Single Transaction Using GetTransactionDetails” on page 33
Refunding Using RefundTransaction
With RefundTransaction, you can refund the full amount or a partial amount of a
transaction. Specify the original transaction ID and the refund type: Full or Partial.
Full Refund
IMPORTANT: If you refund the full amount, do not set the AMT field.
EXAMPLE 3.1 Refunding the Full Amount of a Transaction
Searching for Transactions Using TransactionSearch
To find all transactions that occurred on a particular date, use TransactionSearch and set
the STARTDATE field to the date you desire. The date must be in UTC/GMT format.
EXAMPLE 3.4 Searching for Transactions by STARTDATE
Name-Value Pair API Developer Guide and ReferenceApril 200733
Back-Office Administration
3
Viewing Details of a Single Transaction Using GetTransactionDetails
34April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field
A
Reference
General Characteristics of Requests and Parameters
Parameters
The request parameter string follows the query component syntax defined in Uniform Resource
Identifier (URI): Generic Syntax. Parameter names and their values can be upper- or lowercase.
We show parameter names in uppercase for clarity. All values must be URL-encoded.
Multi-Value Fields
Fields that accept multiple values have names like this:
L_FIELDNAMEn
where L_ is literal, FIELDNAME is the name of the parameter, and n is an index number,
starting at 0 and incremented by one for each value of the field. Index numbers must be
sequential.
For example, if an order contains multiple items, you can add an item cost for each item using
the L_
AMTn parameter:
L_AMT0=4.95&L_AMT1=6.72&L_AMT2=7.95
PayPal-Supported Transactional Currencies
The following currencies are supported by PayPal for use in transactions.
TABLE A.1PayPal-Supported Currencies and Currency Codes for Transactions
ISO-4217
CodeCurrency
AUDAustralian Dollar
CADCanadian Dollar
CHFSwiss Franc
CZKCzech Koruna
DKKDanish Krone
EUREuro
GBPPound Sterling
Name-Value Pair API Developer Guide and ReferenceApril 200735
NVP API Method and Field Reference
Express Checkout
T
ABLE A.1PayPal-Supported Currencies and Currency Codes for Transactions
ISO-4217
CodeCurrency
HKDHong Kong Dollar
HUFHungarian Forint
JPYJapanese Yen
NOKNorwegian Krone
NZDNew Zealand Dollar
PLNPolish Zloty
SEKSwedish Krona
SGDSingapore Dollar
USDU.S. Dollar
Express Checkout
SetExpressCheckout Request
T
ABLE A.2SetExpressCheckout Request Parameters
ParameterDescriptionRequired
METHODName of the API: SetExpressCheckoutYe s
RETURNURLURL to which the customer’s browser is returned after choosing to
pay with PayPal.
N OTE: PayPal recommends that the value be the final review page
on which the customer confirms the order and payment.
Character length and limitations: no limit.
CANCELURLURL to which the customer is returned if he does not approve the
use of PayPal to pay you.
N OTE: PayPal recommends that the value be the original page on
which the customer chose to pay with PayPal.
Character length and limitations: no limit
Ye s
Ye s
GIROPAYSUCCESSURLURL of your website where the user gets redirected once he
successfully completed a transaction with giropay. This page should
be the order confirmation page.
No
(recommended)
36April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field Reference
Express Checkout
T
ABLE A.2SetExpressCheckout Request Parameters (Continued)
ParameterDescriptionRequired
GIROPAYCANCELURLURL of your website where the user gets redirected when a giropay
or electronic funds transfer transaction fails.
BANKTXNPENDINGURLURL of your website where the user gets redirected when he has
initiated an electronic funds transfer.
AMTThe total cost of the order to the customer. If shipping cost and tax
charges are known, include them in this value; if not, this value
should be the current sub-total of the order.
N OTE: Limitations: Must not exceed $10,000 USD in any currency.
No currency symbol. Must have two decimal places, decimal
separator must be a period (.), and the optional thousands
separator must be a comma (,).
CURRENCYCODEA three-character currency code for one of the currencies listed in
PayPal-Supported Transactional Currencies
. Default: USD.
MAXAMTThe expected maximum total amount of the complete order,
including shipping cost and tax charges.
N OTE: Limitations: Must not exceed $10,000 USD in any
currency. No currency symbol. Must have two decimal
places, decimal separator must be a period (.), and the
optional thousands separator must be a comma (,).
PAYMENTACTIONHow you want to obtain payment:
z Sale indicates that this is a final sale for which you are
requesting payment.
Character length and limit: Up to 13 single-byte alphabetic
characters
Allowable Values:
z Authorization
z Order
z Sale
Default: The transaction resulting from
DoExpressCheckoutPayment request will be a final sale..
No
(recommended)
No
(recommended)
Ye s
No
No
No
EMAILEmail address of the buyer as entered during checkout. PayPal uses
No
this value to pre-fill the PayPal membership sign-up portion of the
PayPal login page.
Character length and limit: 127 single-byte alphanumeric characters
DESCDescription of items the customer is purchasing.
No
Character length and limitations: 127 single-byte alphanumeric
characters
Name-Value Pair API Developer Guide and ReferenceApril 200737
NVP API Method and Field Reference
Express Checkout
T
ABLE A.2SetExpressCheckout Request Parameters (Continued)
ParameterDescriptionRequired
CUSTOMA free-form field for your own use, such as a tracking number or
other value you want PayPal to return on
GetExpressCheckoutDetails response and
DoExpressCheckoutPayment response.
Character length and limitations: 256 single-byte alphanumeric
characters
INVNUMYour own unique invoice or tracking number. PayPal returns this
value to you on DoExpressCheckoutPayment response.
Character length and limitations: 127 single-byte alphanumeric
characters
REQCONFIRMSHIPPINGThe value 1 indicates that you require that the customer’s shipping
address on file with PayPal be a confirmed address.
N OTE: Setting this field overrides the setting you have specified in
your Merchant Account Profile.
Character length and limitations: One single-byte numeric character.
Allowable values: 0, 1
Default: 0
NOSHIPPINGThe value 1 indicates that on the PayPal pages, no shipping address
fields should be displayed whatsoever.
Character length and limitations: Four single-byte numeric character.
Allowable values: 0, 1
Default: 0
No
No
No
No
ADDROVERRIDEThe value 1 indicates that the PayPal pages should display the
shipping address set by you in this SetExpressCheckout request,
not the shipping address on file with PayPal for this customer.
N OTE: Displaying the PayPal street address on file does not allow
the customer to edit that address.
Allowable values: 0, 1
Default: 0
TOKENA timestamped token by which you identify to PayPal that you are
processing this payment with Express Checkout.
N OTE: The token expires after three hours.
If you set the token in the SetExpressCheckout request, the value
of the token in the response is identical to the value in the request.
Character length and limitations: 20 single-byte characters
Allowable values: See the description of TOKEN in
“SetExpressCheckout Response Fields
.”
Table A.4,
No
No
38April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field Reference
Express Checkout
T
ABLE A.2SetExpressCheckout Request Parameters (Continued)
ParameterDescriptionRequired
LOCALECODELocale of pages displayed by PayPal during Express Checkout.
Character length and limitations: Any two-character country code.
The following two-character country codes are supported by PayPal:
z AU
z DE
z FR
z IT
z GB
z ES
z US
Any other value will default to US.
N OTE: For the list of country codes, see Appendix F, “Country
Codes.”
PAGESTYLESets the Custom Payment Page Style for payment pages associated
with this button/link. This value corresponds to the HTML variable
page_style for customizing payment pages. The value is the same as
the Page Style Name you chose when adding or editing the page
style from the Profile subtab of the My Account tab of your
PayPal account.
Character length and limitations: 30 single-byte alphabetic
characters.
HDRIMGA URL for the image you want to appear at the top left of the
payment page. The image has a maximum size of 750 pixels wide by
90 pixels high. PayPal recommends that you provide an image that is
stored on a secure (https) server.
Character length and limitations: 127
No
No
No
HDRBORDERCOLORSets the border color around the header of the payment page. The
No
border is a 2-pixel perimeter around the header space, which is 750
pixels wide by 90 pixels high.
Character length and limitations: Six character HTML hexadecimal
color code in ASCII
HDRBACKCOLORSets the background color for the header of the payment page.
No
Character length and limitation: Six character HTML hexadecimal
color code in ASCII
PAYFLOWCOLORSets the background color for the payment page.
No
Character length and limitation: Six character HTML hexadecimal
color code in ASCII
Name-Value Pair API Developer Guide and ReferenceApril 200739
NVP API Method and Field Reference
Express Checkout
ABLE A.2SetExpressCheckout Request Parameters (Continued)
T
ParameterDescriptionRequired
Shipping AddressOptional shipping address. The parameters for the optional Ship to
Address are described in
(Optional)
IMPORTANT: Ship to Address is optional, but if you include it,
T
ABLE A.3Ship to Address (Optional)
ParameterDescriptionRequired
SHIPTONAMEPerson’s name associated with this shipping address.
Character length and limitations: 32 single-byte characters
SHIPTOSTREETFirst street address.
Character length and limitations: 100 single-byte characters
SHIPTOCITYName of city.
Character length and limitations: 40 single-byte characters
SHIPTOSTATEState or province.
Character length and limitations: 40 single-byte characters
SHIPTOCOUNTRYCODECountry code.
Character limit: Two single-byte characters.
For the list of country codes, see
.”
certain fields are required.
Table A.3, “Ship to Address
Appendix F, “Country Codes.”
No
Ye s
Ye s
Ye s
Ye s
Ye s
SHIPTOZIPU.S. Zip code or other country-specific postal code.
Character length and limitations: 20 single-byte characters
SHIPTOSTREET2Second street address.
Character length and limitations: 100 single-byte characters
PHONENUMPhone number.
Character length and limit: 20 single-byte characters
Ye s
No
No
40April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field Reference
Express Checkout
SetExpressCheckout Response
TABLE A.4SetExpressCheckout Response Fields
ParameterDescription
TOKENA timestamped token by which you identify to PayPal that you are processing this
payment with Express Checkout.
N OTE: The token expires after three hours.
If you set the token in the SetExpressCheckout request, the value of the token in the
response is identical to the value in the request.
Character length and limitations: 20 single-byte characters
Redirecting the Customer’s Browser to PayPal Login Page
After you receive a successful response from SetExpressCheckout, add the TOKEN from
SetExpressCheckout response as a name/value pair to the following URL, and redirect your
customer’s browser to it:
For redirecting the customer’s browser to the PayPal login page, PayPal recommends that you
use the HTTPS response 302 “Object Moved” with the URL above as the value of the
Location header in the HTTPS response. Ensure that you use an SSL-enabled server to prevent
browser warnings about a mix of secure and insecure graphics.
GetExpressCheckoutDetails Request
T
ABLE A.5GetExpressCheckoutDetails Parameters
ParameterDescriptionRequired?
METHODName of the API: GetExpressCheckoutDetailsYe s
TOKENA timestamped token, the value of which was returned by
SetExpressCheckout response.
Character length and limitations: 20 single-byte characters
Allowable values: An unexpired token
Ye s
Name-Value Pair API Developer Guide and ReferenceApril 200741
TOKENThe timestamped token value that was returned by SetExpressCheckout response
and passed on GetExpressCheckoutDetails request.
Character length and limitations: 20 single-byte characters
Possible values: See the description of TOKEN in
Response Fields
EMAILEmail address of payer.
Character length and limitations: 127 single-byte characters
Character length and limitations:13 single-byte alphanumeric characters.
PAYERSTATUSStatus of payer.
Character length and limitations: 10 single-byte alphabetic characters.
Possible values: verified, unverified
Table A.4, “SetExpressCheckout
SALUTATIONPayer’s salutation.
Character length and limitations: 20 single-byte characters
FIRSTNAMEPayer’s first name.
Character length and limitations: 25 single-byte characters
MIDDLENAMEPayer’s middle name.
Character length and limitations: 25 single-byte characters
LASTNAMEPayer’s last name.
Character length and limitations: 25 single-byte characters
SUFFIXPayer’s suffix.
Character length and limitations: 12 single-byte characters
COUNTRYCODEPayer’s country of residence in the form of ISO standard 3166 two-character country
codes.
Character length and limitations: Two single-byte characters
For the list of country codes, see
BUSINESSPayer’s business name.
Character length and limitations: 127 single-byte characters
SHIPTONAMEPerson’s name associated with this address.
Character length and limitations: 32 single-byte characters
Appendix F, “Country Codes.”
SHIPTOSTREETFirst street address.
Character length and limitations: 100 single-byte characters
42April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field Reference
Express Checkout
T
ABLE A.6GetExpressCheckoutDetails Response Fields (Continued)
FieldDescription
SHIPTOSTREET2Second street address.
Character length and limitations: 100 single-byte characters
SHIPTOCITYName of city.
Character length and limitations: 40 single-byte characters
SHIPTOSTATEState or province
Character length and limitations: 40 single-byte characters
SHIPTOCOUNTRYCODECountry code.
Character limit: Two single-byte characters.
For the list of country codes, see
SHIPTOZIPU.S. Zip code or other country-specific postal code.
Character length and limitations: 20 single-byte characters
ADDRESSSTATUSStatus of street address on file with PayPal
CUSTOMA free-form field for your own use, as set by you in the Custom element of
SetExpressCheckout request.
Character length and limitations: 256 single-byte alphanumeric characters
Appendix F, “Country Codes.”
INVNUMYour own invoice or tracking number, as set by you in the element of the same name in
SetExpressCheckout request .
Character length and limitations: 127 single-byte alphanumeric characters
PHONENUMPayer’s contact telephone number.
N OTE: PayPal returns a contact telephone number only if your Merchant account
profile settings require that the buyer enter one.
Character length and limitations: Field mask is XXX-XXX-XXXX (for US numbers) or
+XXX XXXXXXXX (for international numbers)
REDIRECTREQUIREDIf the value equals “True,” you must redirect the user after the DoExpressCheckout
call. The value here indicates that you should inform your user on the Review Order
page that he will be redirected to PayPal to complete the transaction.
DoExpressCheckoutPayment Request
Request to obtain payment with PayPal Express Checkout.
IMPORTANT: PayPal requires that a merchant using Express Checkout display to the
customer the same amount that the merchant sends to PayPal in the AMT
parameter with the DoExpressCheckoutPayment request API.
Name-Value Pair API Developer Guide and ReferenceApril 200743
NVP API Method and Field Reference
Express Checkout
TABLE A.7DoExpressCheckoutPayment Parameters
Parameter DescriptionRequired?
METHODName of the API: DoExpressCheckoutPaymentYe s
TOKENThe timestamped token value that was returned by
SetExpressCheckout response and passed on
GetExpressCheckoutDetails request.
Character length and limitations: 20 single-byte characters
PAYMENTACTIONHow you want to obtain payment:
z Sale indicates that this is a final sale for which you are requesting
payment.
Character length and limit: Up to 13 single-byte alphabetic characters
Allowable Values:
z Authorization
z Order
z Sale
Default: The transaction resulting from DoExpressCheckoutPayment
request will be a final sale..
PAYERIDUnique PayPal customer account identification number as returned by
GetExpressCheckoutDetails response.
Character length and limitations: 13 single-byte alphanumeric characters.
AMTTotal of order, including shipping, handling, and tax.
N OTE: Limitations: Must not exceed $10,000 USD in any currency.
No currency symbol. Must have two decimal places, decimal
separator must be a period (.), and the optional thousands
separator must be a comma (,).
Ye s
Ye s
Ye s
Ye s
DESCDescription of items the customer is purchasing.
No
Character length and limitations: 127 single-byte alphanumeric characters
CUSTOMA free-form field for your own use.
No
Character length and limitations: 256 single-byte alphanumeric characters
INVNUMYour own invoice or tracking number.
No
Character length and limitations: 127 single-byte alphanumeric characters
BUTTONSOURCEAn identification code for use by third-party applications to identify
No
transactions.
Character length and limitations: 32 single-byte alphanumeric characters
44April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field Reference
Express Checkout
ABLE A.7DoExpressCheckoutPayment Parameters (Continued)
T
Parameter DescriptionRequired?
NOTIFYURLYour URL for receiving Instant Payment Notification (IPN) about this
transaction.
N OTE: If you do not specify this value in the request, the notification URL
from your Merchant Profile is used, if one exists.
Character length and limitations: 2,048 single-byte alphanumeric
characters
ITEMAMTSum of cost of all items in this order.
Limitations: Must not exceed $10,000 USD in any currency. No
currency symbol. Must have two decimal places, decimal separator
must be a period (.), and the optional thousands separator must be a
comma (,).
N OTE: ITEMAMT is required if you specify a value for L_AMTn.
SHIPPINGAMTTotal shipping costs for this order.
N OTE: Character length and limitations: Must not exceed $10,000 USD in
any currency. No currency symbol. Regardless of currency, decimal
separator must be a period (.), and the optional thousands separator
must be a comma (,). Equivalent to nine characters maximum for
USD.
HANDLINGAMTTotal handling costs for this order.
N OTE: Character length and limitations: Must not exceed $10,000 USD in
any currency. No currency symbol. Regardless of currency, decimal
separator must be a period (.), and the optional thousands separator
must be a comma (,). Equivalent to nine characters maximum for
USD.
No
No
No
No
TAXAMTSum of tax for all items in this order.
N OTE: Character length and limitations: Must not exceed $10,000 USD in
No
any currency. No currency symbol. Regardless of currency, decimal
separator must be a period (.), and the optional thousands separator
must be a comma (,). Equivalent to nine characters maximum for
USD.
N OTE: TAXAMT is required if you specify a value for L_TAXAMTn.
CURRENCYCODEA three-character currency code for one of the currencies listed in PayPal-
No
Supported Transactional Currencies. Default: USD.
L_NAMEnItem name.
No
Character length and limitations: 127 single-byte characters
These parameters should be ordered sequentially beginning
with 0, for example, L_NAME0, L_NAME1, and so forth.
Name-Value Pair API Developer Guide and ReferenceApril 200745
NVP API Method and Field Reference
Express Checkout
ABLE A.7DoExpressCheckoutPayment Parameters (Continued)
T
Parameter DescriptionRequired?
L_NUMBERnItem number.
Character length and limitations: 127 single-byte characters
L_QTYnItem quantity.
Character length and limitations: Any positive integer
L_TAXAMTnItem sales tax.
L_AMTnCost of item
No
These parameters should be ordered sequentially beginning
with 0, for example, L_NUMBER0, L_NUMBER1, and so forth.
No
These parameters should be ordered sequentially beginning
with 0, for example, L_QTY0, L_QTY1, and so forth.
No
Character length and limitations: Must not exceed $10,000
USD in any currency. No currency symbol. Regardless of
currency, decimal separator must be a period (.), and the
optional thousands separator must be a comma (,). Equivalent
to nine characters maximum for USD.
These parameters should be ordered sequentially beginning
with 0, for example, L_TAXAMT0, L_TAXAMT1, and so forth.
No
Character length and limitations: Must not exceed $10,000
USD in any currency. No currency symbol. Regardless of
currency, decimal separator must be a period (.), and the
optional thousands separator must be a comma (,). Equivalent
to nine characters maximum for USD.
These parameters should be ordered sequentially beginning
with 0, for example, L_AMT0, L_AMT1, and so forth.
Shipping AddressOptional shipping address. The parameters for the optional Ship to Address
are described in
I MPORTANT: Ship to Address is optional, but if you include it, certain
T
ABLE A.8Optional Ship to Address
ParameterDescriptionRequired?
SHIPTONAMEPerson’s name associated with this address.
Character length and limitations: 32 single-byte characters
SHIPTOSTREETFirst street address.
Character length and limitations: 100 single-byte characters
SHIPTOCITYName of city.
Character length and limitations: 40 single-byte characters
Table A.8, “Optional Ship to Address.”
fields are required.
No
Ye s
Ye s
Ye s
46April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field Reference
Express Checkout
T
ABLE A.8Optional Ship to Address (Continued)
ParameterDescriptionRequired?
SHIPTOSTATEState or province.
Ye s
Character length and limitations: 40 single-byte characters
SHIPTOCOUNTRYCODECountry code.
Ye s
Character limit: Two single-byte characters
For the list of country codes, see
SHIPTOZIPU.S. ZIP code or other country-specific postal code.
Appendix F, “Country Codes.”
Ye s
Character length and limitations: 20 single-byte characters
SHIPTOSTREET2Second street address.
No
Character length and limitations: 100 single-byte characters
SHIPTOPHONENUMPhone number.
No
Character length and limit: 20 single-byte characters
DoExpressCheckoutPayment Response
ABLE A.9DoExpressCheckout Payment Response Fields
T
FieldDescription
TOKENThe timestamped token value that was returned by SetExpressCheckout response and
passed on GetExpressCheckoutDetails request.
Character length and limitations:20 single-byte characters
Allowable values: See the description of TOKEN in
Response Fields
.”
Table A.4, “SetExpressCheckout
TRANSACTIONIDUnique transaction ID of the payment.
N OTE: If the PaymentAction of the request was Authorization or Order, this value
is your AuthorizationID for use with the Authorization & Capture APIs.
Character length and limitations:19 single-byte characters
Possible values: Transaction specific
TRANSACTIONTYPEThe type of transaction
Character length and limitations:15 single-byte characters
Possible values:
z cart
z express-checkout
Name-Value Pair API Developer Guide and ReferenceApril 200747
NVP API Method and Field Reference
Express Checkout
T
ABLE A.9DoExpressCheckout Payment Response Fields (Continued)
FieldDescription
PAYMENTTYPEIndicates whether the payment is instant or delayed.
Character length and limitations: Seven single-byte characters
Possible values:
z none
z echeck
z instant
ORDERTIMETime/date stamp of payment
Possible values: Transaction specific
AMTThe final amount charged, including any shipping and taxes from your Merchant Profile.
Character length and limitations: Does not exceed $10,000 USD in any currency.
No currency symbol. Regardless of currency, decimal separator is a period (.), and
the optional thousands separator is a comma (,). Equivalent to nine characters
maximum for USD.
Possible Values: Transaction specific
CURRENCYCODEA three-character currency code for one of the currencies listed in PayPay-Supported
Transactional Currencies. Default: USD.
FEEAMTPayPal fee amount charged for the transaction
Character length and limitations: Does not exceed $10,000 USD in any currency.
No currency symbol. Regardless of currency, decimal separator is a period (.), and
the optional thousands separator is a comma (,). Equivalent to nine characters
maximum for USD.
Possible values: Transaction specific
SETTLEAMTAmount deposited in your PayPal account after a currency conversion.
Possible values: Transaction specific
TAXAMTTax charged on the transaction.
Character length and limitations: Does not exceed $10,000 USD in any currency.
No currency symbol. Regardless of currency, decimal separator is a period (.), and
the optional thousands separator is a comma (,). Equivalent to nine characters
maximum for USD.
Possible values: Transaction specific
EXCHANGERATEExchange rate if a currency conversion occurred. Relevant only if your are billing in their
non-primary currency. If the customer chooses to pay with a currency other than the nonprimary currency, the conversion occurs in the customer’s account.
Character length and limitations: a decimal that does not exceed 17 characters, including
decimal point
Possible values: Transaction specific
48April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field Reference
T
ABLE A.9DoExpressCheckout Payment Response Fields (Continued)
FieldDescription
PAYMENTSTATUSStatus of the payment:
Completed: The payment has been completed, and the funds have been added
successfully to your account balance.
Pending: The payment is pending. See the PendingReason element for more
information.
PENDINGREASONThe reason the payment is pending:
z none: No pending reason
z address: The payment is pending because your customer did not include a confirmed
shipping address and your Payment Receiving Preferences is set such that you want to
manually accept or deny each of these payments. To change your preference, go to the
Preferences section of your Profile.
z echeck: The payment is pending because it was made by an eCheck that has not yet
cleared.
z 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.
z 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.
z verify: The payment is pending because you are not yet verified. You must verify
your account before you can accept this payment.
z other: The payment is pending for a reason other than those listed above. For more
information, contact PayPal customer service.
Express Checkout
REASONCODEThe reason for a reversal if TransactionType is reversal:
z none: No reason code
z chargeback: A reversal has occurred on this transaction due to a chargeback by your
customer.
z guarantee: A reversal has occurred on this transaction due to your customer
triggering a money-back guarantee.
z buyer-complaint: A reversal has occurred on this transaction due to a complaint
about the transaction from your customer.
z refund: A reversal has occurred on this transaction because you have given the
customer a refund.
z other: A reversal has occurred on this transaction due to a reason not listed above.
REDIRECTREQUIREDIf the value equals "True" you have to redirect the user to PayPal. PayPal will direct the
user according to the selected payment methods (e.g. to giropay).
When redirecting the user to Paypal you need to append the Token-value to the following
checkout&token=TOKEN. TOKEN needs to equal the Token-value that you received in the
SetExpressCheckoutResponse.
Name-Value Pair API Developer Guide and ReferenceApril 200749
NVP API Method and Field Reference
RefundTransaction
RefundTransaction
TABLE A.10 RefundTransaction Request Parameters
ParameterDescriptionRequired?
METHODName of API call: RefundTransactionYe s
TRANSACTIONIDUnique identifier of a transaction
Ye s
Character length and limitations: 17 single-byte alphanumeric characters
REFUNDTYPEType of refund you are making
z Other
z Full
z Partial
AMTRefund amount.
Ye s
No
Amount is required if RefundType is Partial.
N OTE: If RefundType is Full, do not set Amount unless your
merchant account has been enabled to issue refunds greater
than the amount in referenced transactions.
NOTECustom memo about the refund.
Character length and limitations: 255 single-byte alphanumeric characters
T
ABLE A.11 DoRefund Response Fields
FieldDescription
REFUNDTRANSACTIONIDUnique transaction ID of the refund.
Character length and limitations:17 single-byte characters
NETREFUNDAMTAmount subtracted from PayPal balance of original recipient of payment to
make this refund
No
FEEREFUNDAMTTransaction fee refunded to original recipient of payment
GROSSREFUNDAMTAmount of money refunded to original payer
TransactionSearch
With TransactionSearch you must always set the StartDate field. Some other behavior:
z Setting TransactionID overrides all other fields (even the required StartDate field).
z The effect of setting other elements is additive or can alter the search criteria.
50April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field Reference
TransactionSearch
TransactionSearch returns up to 100 matches. Partial matches are displayed. For example,
setting the TransactionSearchRequest FirstName to “Jess” returns results such as
“Jessica” and “Jesse”.
The most important returned element is TransactionID, which you can pass to
GetTransactionDetails in order to retrieve all available information about a specific
transaction.
TABLE A.12 TransactionSearch Request Parameters
ParameterDescriptionRequired
METHODName of API call: TransactionSearchYe s
STARTDATEThe earliest transaction date at which to start the search.
NOTE: No wildcards are allowed. The value must be in UTC/GMT
format.
ENDDATEThe latest transaction date to be included in the searchNo
EMAILSearch by the buyer’s email address
Character length and limitations: 127 single-byte alphanumeric characters
RECEIVERSearch by the receiver’s email address. If the merchant account has only
one email, this is the primary email. Can also be a non-primary email.
RECEIPTIDSearch by the PayPal Account Optional receipt IDNo
TRANSACTIONIDSearch by the transaction ID.
NOTE: The returned results are from the merchant’s transaction records.
Character length and limitations: 19 single-byte characters maximum
INVNUMSearch by invoice identification key, as set by you for the original
transaction. This field searches the records for items sold by the merchant,
not the items purchased.
NOTE: No wildcards are allowed.
Character length and limitations: 127 single-byte characters maximum
ACCTSearch by credit card number, as set by you for the original transaction.
This field searches the records for items sold by the merchant, not the
items purchased.
NOTE: No wildcards are allowed.
Ye s
No
No
No
No
No
Character length and limitations: Must be at least 11 and no more than 25
single-byte numeric characters maximum. Special punctuation, such as
dashes or spaces, is ignored.
SALUTATIONBuyer’s salutation
Character length and limitations: 20 single-byte characters
FIRSTNAMEBuyer’s first name
Character length and limitations: 25 single-byte characters
Name-Value Pair API Developer Guide and ReferenceApril 200751
No
No
NVP API Method and Field Reference
TransactionSearch
T
ABLE A.12 TransactionSearch Request Parameters (Continued)
ParameterDescriptionRequired
MIDDLENAMEBuyer’s middle name
No
Character length and limitations: 25 single-byte characters
LASTNAMEBuyer’s last name
No
Character length and limitations: 2025 single-byte characters
SUFFIXPayer’s suffix
No
Character length and limitations: 12 single-byte characters
AUCTIONITEMNUMBERSearch by auction item number of the purchased goodsNo
TRANSACTIONCLASSSearch by classification of transaction.
NOTE: Some kinds of possible classes of transactions are not searchable
No
with this field. You cannot search for bank transfer
withdrawals, for example.
z All: all transaction classifications
z Sent: only payments sent
z Received: only payments received
z MassPay: only mass payments
z MoneyRequest: only money requests
z FundsAdded: only funds added to balance
z FundsWithdrawn: only funds withdrawn from balance
z Referral: only transactions involving referrals
z Fee: only transactions involving fees
z Subscription: only transactions involving subscriptions
z Dividend: only transactions involving dividends
z Billpay: only transactions involving BillPay Transactions
z Refund: only transactions involving funds
z CurrencyConversions: only transactions involving currency
conversions
z BalanceTransfer: only transactions involving balance transfers
z Reversal: only transactions involving BillPay reversals
z Shipping: only transactions involving UPS shipping fees
z BalanceAffecting: only transactions that affect the account
balance
z ECheck: only transactions involving eCheck
AMTSearch by transaction amountNo
52April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field Reference
TransactionSearch
T
ABLE A.12 TransactionSearch Request Parameters (Continued)
ParameterDescriptionRequired
STATUSSearch by transaction status:
z Pending: The payment is pending. The specific reason the payment
is pending is returned by the GetTransactionDetails API
PendingReason field.
z Processing: The payment is being processed.
z Success: The payment has been completed and the funds have been
added successfully to your account balance.
z Denied: You denied the payment. This happens only if the payment
was previously pending.
z 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.
ABLE A.13 TransactionSearch Response Fields
T
FieldDescription
L_TIMESTAMPnThe date and time (in UTC/GMT format) the transaction occurred
These parameters should be ordered sequentially beginning with 0, for
example, L_TIMESTAMP0, L_TIMESTAMP1, and so forth.
L_TIMEZONEnThe time zone of the transaction
These parameters should be ordered sequentially beginning with 0, for
example, L_TIMEZONE0, L_TIMEZONE1, and so forth.
No
L_TYPEnThe type of the transaction
These parameters should be ordered sequentially beginning with 0, for
example, L_TYPE0, L_TYPE1, and so forth.
L_EMAILnThe email address of either the payer or the payment recipient (the “payee”). If the
payment amount is positive, this field is the recipient of the funds. If the payment is
negative, this field is the paying customer.
These parameters should be ordered sequentially beginning with 0, for
example, L_EMAIL0, L_EMAIL1, and so forth.
L_NAMEnDisplay name of the payer
These parameters should be ordered sequentially beginning with 0, for
example, L_NAME0, L_NAME1, and so forth.
L_TRANSACTIONIDnSeller’s transaction ID
These parameters should be ordered sequentially beginning with 0, for
example, L_TRANSACTIONID0, L_TRANSACTIONID1, and so forth.
L_STATUSnThe status of the transaction.
These parameters should be ordered sequentially beginning with 0, for
example, L_STATUS0, L_STATUS1, and so forth.
Name-Value Pair API Developer Guide and ReferenceApril 200753
NVP API Method and Field Reference
GetTransactionDetails
T
ABLE A.13 TransactionSearch Response Fields (Continued)
FieldDescription
L_AMTnThe total gross amount charged, including any profile shipping cost and taxes
These parameters should be ordered sequentially beginning with 0, for
example, L_AMT0, L_AMT1, and so forth.
L_FEEAMTnThe fee that PayPal charged for the transaction
These parameters should be ordered sequentially beginning with 0, for
example, L_FEEAMT0, L_FEEAMT1, and so forth.
L_NETAMTnThe net amount of the transaction
These parameters should be ordered sequentially beginning with 0, for
example, L_NETAMT0, L_NETAMT1, and so forth.
GetTransactionDetails
T
ABLE A.14 GetTransactionDetails Request Parameters
ParameterDescriptionRequired?
METHODName of the API: GetTransactionDetails Yes
TRANSACTIONIDUnique identifier of a transaction.
N OTE: The details for some kinds of transactions cannot be retrieved with
GetTransactionDetails. You cannot obtain details of bank
transfer withdrawals, for example.
Character length and limitations: 17 single-byte alphanumeric characters
T
ABLE A.15 GetTransactionDetails Response Fields
ParameterDescription
RECEIVERBUSINESSEmail address or account ID of the payment recipient (the seller). Equivalent to
Receiver if payment is sent to primary account.
Character length and limitations: 127 single-byte alphanumeric characters
RECEIVEREMAILPrimary email address of the payment recipient (the seller).
If you are the recipient of the payment and the payment is sent to your non-primary
email address, the value of Receiver is still your primary email address.
Character length and limitations: 127 single-byte alphanumeric characters
Ye s
RECEIVERIDUnique account ID of the payment recipient (the seller). This value is the same as
the value of the recipient's referral ID.
54April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field Reference
T
ABLE A.15 GetTransactionDetails Response Fields (Continued)
ParameterDescription
EMAILEmail address of payer
Character length and limitations: 127 single-byte characters
PAYERIDUnique customer ID.
Character length and limitations: 13 single-byte alphanumeric characters.
PAYERSTATUSStatus of payer’s email address:
Verified
Unverified
FIRSTNAMEPayer’s first name
Character length and limitations: 25 single-byte characters
LASTNAMEPayer’s last name
Character length and limitations: 25 single-byte characters
MIDDLENAMEPayer’s middle name
Character length and limitations: 25 single-byte characters
GetTransactionDetails
PAYERBUSINESSPayer’s business name.
Character length and limitations: 127 single-byte characters
SHIPTOCOUNTRYCODEPayment sender’s country of residence using standard two-character ISO 3166
country codes.
Character length and limitations: Two single-byte characters
For the list of country codes, see
SALUTATIONPayer’s salutation
Character length and limitations: 20 single-byte characters
SUFFIXPayer’s suffix
Character length and limitations: 12 single-byte characters
ADDRESSOWNEReBay company that maintains this address
ADDRESSSTATUSStatus of the address on file with PayPal:
None
Confirmed
Unconfirmed
SHIPTOCITYName of city.
Character length and limitations: 120 single-byte alphanumeric characters
SHIPTONAMEPerson’s name associated with this address.
Character length and limitations: 32 single-byte alphanumeric characters
Appendix F, “Country Codes.”
SHIPTOPHONENUMPhone number associated with this address
SHIPTOZIPPostal code
Name-Value Pair API Developer Guide and ReferenceApril 200755
NVP API Method and Field Reference
GetTransactionDetails
T
ABLE A.15 GetTransactionDetails Response Fields (Continued)
ParameterDescription
SHIPTOSTATEState or province.
Character length and limitations: 120 single-byte alphanumeric characters
SHIPTOSTREETFirst street address.
Character length and limitations: 300 single-byte alphanumeric characters
SHIPTOSTREET2Second street address.
Character length and limitations: 300 single-byte alphanumeric characters
PARENTTRANSACTIONIDOriginal transaction to which this transaction is related. This field is populated for
the following transaction types:
z Reversal
z Capture of an authorized transaction.
z Reauthorization of a transaction.
z Capture of an order. The value of ParentTransactionID is the original
OrderID.
z Authorization of an order. The value of ParentTransactionID is the
original OrderID.
z Capture of an order authorization.
z Void of an order. The value of ParentTransactionID is the original
OrderID.
Character length and limitations: 19 single-byte characters
TRANSACTIONIDPayPal transaction identification number
Character length and limitations: 19 single-byte characters
RECEIPTIDReceipt ID
Character length and limitations: 16 digits in xxxx-xxxx-xxxx-xxxx format
TRANSACTIONTYPEThe type of transaction
cart: Transaction created by customer via the PayPal Shopping Cart feature.
send-money: Transaction created by customer from the Send Money tab on the
PayPal website.
web-accept: Transaction created by customer via Buy Now, Donation, or
Auction Smart Logos.
subscr-*: Transaction created by customer via Subscription. eot means “end of
subscription term.”
merch-pmt: preapproved payment.
mass-pay: Transaction created via
MassPay.
virtual-terminal: Transaction created via merchant virtual terminal.
PAYMENTTYPEIndicates whether the payment is instant or delayed.
Character length and limitations: Seven single-byte characters
ORDERTIMEDate and time of payment
AMTFull amount of the customer’s payment, before transaction fee is subtracted
56April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field Reference
GetTransactionDetails
ABLE A.15 GetTransactionDetails Response Fields (Continued)
T
ParameterDescription
FEEAMTTransaction fee associated with the payment
SETTLEAMTAmount 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. This amount is
calculated after fees and taxes have been assessed.
TAXAMTAmount of tax for transaction
EXCHANGERATEExchange rate for transaction
PAYMENTSTATUSStatus of the payment.
The status of the payment:
z None: No status
z Canceled-Reversal: This means 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.
z Completed: The payment has been completed, and the funds have been added
successfully to your account balance.
z Denied: You denied the payment. This happens only if the payment was
previously pending because of possible reasons described for the
PendingReason element.
z Expired: the authorization period for this payment has been reached.
z Failed: The payment has failed. This happens only if the payment was made
from your customer’s bank account.
z Pending: The payment is pending. See the PendingReason field for more
information.
z Refunded: You refunded the payment.
z 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.
z Processed: A payment has been accepted.
z Voided: An authorization for this transaction has been voided.
Name-Value Pair API Developer Guide and ReferenceApril 200757
NVP API Method and Field Reference
GetTransactionDetails
T
ABLE A.15 GetTransactionDetails Response Fields (Continued)
ParameterDescription
PENDINGREASONN OTE: PendingReason is returned in the response only if PaymentStatus is
Pending.
The reason the payment is pending:
z none: No pending reason
z address: The payment is pending because your customer did not include a
confirmed shipping address and your Payment Receiving Preferences is set
such that you want to manually accept or deny each of these payments. To
change your preference, go to the Preferences section of your Profile.
z echeck: The payment is pending because it was made by an eCheck that has
not yet cleared.
z 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.
z 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.
z verify: The payment is pending because you are not yet verified. You must
verify your account before you can accept this payment.
z other: The payment is pending for a reason other than those listed above. For
more information, contact PayPal Customer Service.
REASONCODEThe reason for a reversal if TransactionType is reversal:
z none: No reason code
z chargeback: A reversal has occurred on this transaction due to a chargeback
by your customer.
z guarantee: A reversal has occurred on this transaction due to your customer
triggering a money-back guarantee.
z buyer-complaint: A reversal has occurred on this transaction due to a
complaint about the transaction from your customer.
z refund: A reversal has occurred on this transaction because you have given
the customer a refund.
z other: A reversal has occurred on this transaction due to a reason not listed
above.
INVNUMInvoice number you set in the original transaction.
Character length and limitations: 127 single-byte alphanumeric characters
CUSTOMCustom field you set in the original transaction.
Character length and limitations: 127 single-byte alphanumeric characters
NOTEMemo entered by your customer in PayPal Website Payments note field.
Character length and limitations: 255 single-byte alphanumeric characters
SALESTAXAmount of tax charged on payment
58April 2007Name-Value Pair API Developer Guide and Reference
NVP API Method and Field Reference
GetTransactionDetails
T
ABLE A.15 GetTransactionDetails Response Fields (Continued)
ParameterDescription
L_DESCnItem name set by you or entered by the customer. If this was a shopping cart
transaction, PayPal appends the number of the item to the HTML item_name
variable. For example, item_name1, item_name2, and so forth.
Character length and limitations: 127 single-byte alphanumeric
characters
These parameters should be ordered sequentially beginning with 0,
for example, L_DESC0, L_DESC1, and so forth.
L_NUMBERnItem number set by you. If this was a shopping cart transaction, PayPal appends the
number of the item to the HTML item_number variable. For example,
item_number1, item_number2, and so forth.
Character length and limitations: 127 single-byte alphanumeric
characters
These parameters should be ordered sequentially beginning with 0,
for example, L_NUMBER0, L_NUMBER1, and so forth.
L_QTYnQuantity set by you or entered by the customer.
Character length and limitations: no limit
These parameters should be ordered sequentially beginning with 0,
for example, L_QTY0, L_QTY1, and so forth.
L_AMTnCost of item
These parameters should be ordered sequentially beginning with 0,
for example, L_AMT0, L_AMT1, and so forth.
L_OPTIONSnPayPal item options for shopping cart
These parameters should be ordered sequentially beginning with 0,
for example, L_OPTIONS0, L_OPTIONS1, and so forth.
SUBSCRIPTIONIDID generated by PayPal for the subscriber.
Character length and limitations: no limit
SUBSCRIPTIONDATESubscription start date
EFFECTIVEDATEDate when the subscription modification will be effective
RETRYTIMEDate PayPal will retry a failed subscription payment.
USERNAMEUsername generated by PayPal and given to subscriber to access the subscription.
Character length and limitations: 64 alphanumeric single-byte characters
PASSWORDPassword generated by PayPal and given to subscriber to access the subscription.
For security, the value of the password is hashed.
Character length and limitations: 128 alphanumeric single-byte characters
RECURRENCESThe number of payment installments that will occur at the regular rate.
Character length and limitations: no limit
REATTEMPTIndicates whether reattempts should occur upon payment failures
Name-Value Pair API Developer Guide and ReferenceApril 200759
NVP API Method and Field Reference
Mass Payment
T
ABLE A.15 GetTransactionDetails Response Fields (Continued)
ParameterDescription
RECURRINGIndicates whether regular rate recurs.
1 = Yes
PERIODThe period of time that the subscriber will be charged.
Character length and limitations: no limit
BUYERIDCustomer’s auction ID
CLOSINGDATEAuction’s close date
MULTIITEMCounter used for multi-item auction payments
Mass Payment
T
ABLE A.16 MassPay Parameters
ParameterDescription
METHODName of the API: MassPay Ye s
RECEIVERTYPEIndicates how you identify the recipients of payments in all the individual
mass payment items: either by EmailAddress (L_EMAIL
item) or by UserID (L_RECEIVERID_
nPayment amount.Yes
L_AMT
n in the individual item).
n in the individual
CURRENCYCODEA three-character currency code for one of the currencies listed in PayPay-
Supported Transactional Currencies. Default: USD.
L_EMAIL
nEmail address of recipient.
N OTE: You must specify either L_EMAILn or L_RECEIVERIDn, but you
must not mix them. Use only one or the other, but not both, in a single
request.
Character length and limitations: 127 single-byte characters maximum.
These parameters should be ordered sequentially beginning
with 0, for example, L_EMAIL0, L_EMAIL1, and so forth.
L_RECEIVERID
nUnique PayPal customer account number. This value corresponds to the
value of PAYERID returned by GetTransactionDetails.
These parameters should be ordered sequentially beginning
with 0, for example, L_RECEIVERID0, L_RECEIVERID1, and
so forth.
Require
d?
Ye s
Ye s
Depends
on
RECEIVE
RTYPE
Depends
on
RECEIVE
RTYPE
60April 2007Name-Value Pair API Developer Guide and Reference
T
ABLE A.16 MassPay Parameters (Continued)
ParameterDescription
NVP API Method and Field Reference
Mass Payment
Require
d?
L_UNIQUEIDnTransaction-specific identification number for tracking in an accounting
system.
Character length and limitations: 30 single-byte characters. No whitespace
allowed.
These parameters should be ordered sequentially beginning
with 0, for example, L_UNIQUEID0, L_UNIQUEID1, and so
forth.
L_NOTE
nCustom note for each recipient.
Character length and limitations: 4,000 single-byte alphanumeric characters
These parameters should be ordered sequentially beginning
with 0, for example, L_NOTE0, L_NOTE1, and so forth.
EMAILSUBJECTThe subject line of the email that PayPal sends when the transaction is
completed. The subject line is the same for all recipients.
Character length and limitations: 255 single-byte alphanumeric characters
T
ABLE A.17 MassPay Response Fields
The fields in the response are the standard response header fields. See [successResponseHeader].
No
No
No
Name-Value Pair API Developer Guide and ReferenceApril 200761
NVP API Method and Field Reference
Mass Payment
62April 2007Name-Value Pair API Developer Guide and Reference
Error Message Reference
B
This chapter contains error messages for the API.
Error Response Format
If the ACK value is Error or Warning, specific API response fields are not returned. An error
response has the following general format
66March 2007Name-Value Pair API Developer Guide and Reference
General API Errors
TABLE B.2 General API Errors
Short
Error Code
MessageLong MessageCorrecting This Error
Error Message Reference
General API Errors
10002Authentication
/Authorization
Failed
10002Authentication
/Authorization
Failed
10002Authentication
/Authorization
Failed
10002Internal ErrorInternal Error
10002Authentication
/Authorization
Failed
10002Authentication
/Authorization
Failed
Username/Password is incorrectThis error can be caused by
You do not have permissions to make this API
call
Account is locked or inactive
Internal Error
Account is not verified
an incorrect API username,
an incorrect API password,
or an invalid API signature.
Make sure that all three of
these values are correct. For
your security, PayPal does
not report exactly which of
these three values might be
in error.
10002Authentication
/Authorization
Failed
10002Authentication
/Authorization
Failed
10002Restricted
account
Name-Value Pair API Developer Guide and ReferenceMarch 200767
This call is not defined in the database!
Token is not valid
Account is restrictedYour PayPal merchant
account has been restricted.
Contact your PayPal account
manager for resolution.
Error Message Reference
Express Checkout API Errors
T
ABLE B.2 General API Errors
Short
Error Code
MessageLong MessageCorrecting This Error
10002Authentication
/Authorization
Failed
10002Authentication
/Authorization
Failed
10002Authentication
/Authorization
Failed
10002Restricted
account
Token is not valid
API access is disabled for this account
Client certificate is disabled
Account is restricted
Express Checkout API Errors
T
ABLE B.3 SetExpressCheckout API Errors
Short
Error Code
MessageLong MessageCorrecting This Error...
10001ButtonSource
value
truncated.
10001Internal Error Internal Error
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
The transaction could not be loaded
Transaction refused because of an invalid
argument. See additional error messages for
details.
The transaction id is not valid
68March 2007Name-Value Pair API Developer Guide and Reference
Error Code
Error Message Reference
Express Checkout API Errors
T
ABLE B.3 SetExpressCheckout API Errors
Short
MessageLong MessageCorrecting This Error...
10007Permission
denied
10102PaymentActio
n of Order
Temporarily
Unavailable
10103Please use
another
Solution Type.
10402Authorization
only is not
allowed for
merchant.
10404Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10405Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
You do not have permissions to make this API
call
PaymentAction of Order is temporarily
unavailable. Please try later or use other
PaymentAction.
Your Solution Type is temporarily
unavailable. If possible, please use another
Solution Type.
This merchant account is not permitted to set
PaymentAction to Authorization. Please
contact Customer Service.
ReturnURL is missing.
CancelURL is missing.
10407Transaction
Invalid buyer email address (BuyerEmail).
refused
because of an
invalid
argument. See
additional error
messages for
details.
10409You're not
authorized to
Express Checkout token was issued for a
merchant account other than yours.
access this
info.
Name-Value Pair API Developer Guide and ReferenceMarch 200769
Error Message Reference
Express Checkout API Errors
T
ABLE B.3 SetExpressCheckout API Errors
Short
Error Code
10410Invalid token Invalid token.
MessageLong MessageCorrecting This Error...
10411This Express
Checkout
session has
expired.
This Express Checkout session has expired.
Token value is no longer valid.
The token returned by
SetExpressCheckout
response expires after
three hours. If you attempt to
send the
DoExpressCheckoutPaym
ent after that time, you will
receive error code 10411 in
the
DoExpressCheckoutPaym
ent response.
If you receive this error, you
must return your customer to
PayPal to approve the use of
PayPal again. Display an
error message to inform the
customer that the transaction
expired, and provide a
button to return to PayPal. In
this situation, you are
effectively restarting the
entire checkout process. (Do
not reuse the expired token
value on
SetExpressCheckout
request.) However,
because you already know
the final OrderTotal, be
sure to update the value for
that element if appropriate.
You might also want to
update the values for
ReturnURL and
CancelURL, if necessary.
70March 2007Name-Value Pair API Developer Guide and Reference
Error Code
Error Message Reference
Express Checkout API Errors
T
ABLE B.3 SetExpressCheckout API Errors
Short
MessageLong MessageCorrecting This Error...
10412Duplicate
invoice
10415Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
Payment has already been made for this
InvoiceID.
A successful transaction has already been
completed for this token.
PayPal checks that
InvoiceID values are
unique for any particular
merchant. If you send an
InvoiceID value already
associated with another
transaction in the PayPal
system, PayPal returns error
code 10412.
You might not be able to
correct this error during an
actual checkout. If you get
this error, research why
might occur and modify
your implementation of
Express Checkout to ensure
that you generate unique
invoice identification
numbers.
PayPal allows a token only
once for a successful
transaction.
Handling this error
If you determine that your
customers are clicking your
“Place Order” button twice,
PayPal recommends that you
disable the button after your
customer has clicked it.
10425Express
Checkout has
Express Checkout has been disabled for this
merchant. Please contact Customer Service.
been disabled
for this
merchant.
10432Transaction
refused
Invoice ID value exceeds maximum allowable
length.
because of an
invalid
argument. See
additional error
messages for
details.
Name-Value Pair API Developer Guide and ReferenceMarch 200771
Error Message Reference
Express Checkout API Errors
T
ABLE B.3 SetExpressCheckout API Errors
Short
Error Code
MessageLong MessageCorrecting This Error...
10433Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10434Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10436Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
Value of OrderDescription element has been
truncated.
Value of Custom element has been truncated.
PageStyle value exceeds maximum allowable
length.
10437Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10438Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
cpp-header-image value exceeds maximum
allowable length.
cpp-header-image value exceeds maximum
allowable length.
72March 2007Name-Value Pair API Developer Guide and Reference
Error Code
Error Message Reference
Express Checkout API Errors
T
ABLE B.3 SetExpressCheckout API Errors
Short
MessageLong MessageCorrecting This Error...
10439Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10440Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10471Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
cpp-header-image value exceeds maximum
allowable length.
cpp-header-image value exceeds maximum
allowable length.
ReturnURL: Invalid parameter
10472Transaction
CancelURL is invalid.
refused
because of an
invalid
argument. See
additional error
messages for
details.
10537Risk Control
Country Filter
Failure
10538Risk Control
Max Amount
Failure
Name-Value Pair API Developer Guide and ReferenceMarch 200773
The transaction was refused because the
country was prohibited as a result of your
Country Monitor Risk Control Settings.
The transaction was refused because the
maximum amount was excceeded as a result of
your Maximum Amount Risk Control Settings.
Error Message Reference
Express Checkout API Errors
T
ABLE B.3 SetExpressCheckout API Errors
Short
Error Code
MessageLong MessageCorrecting This Error...
10539Payment
declined by
your Risk
Controls
settings:
PayPal Risk
Model.
10725Shipping
Address
Country Error
10727Shipping
Address1
Empty
10728Shipping
Address City
Empty
10729Shipping
Address State
Empty
10730Shipping
Address Postal
Code Empty
Payment declined by your Risk Controls
settings: PayPal Risk Model.
There was an error in the Shipping Address
Country field
The field Shipping Address1 is required
The field Shipping Address City is required
The field Shipping Address State is required
The field Shipping Address Postal Code is
required
10731Shipping
Address
Country Empty
10736Shipping
Address
Invalid City
State Postal
Code
T
ABLE B.4 GetExpressCheckoutDetails API Errors
Error
Code
10001Internal Error Internal Error
10001Internal Error Transaction failed due to internal
Short
MessageLong MessageCorrecting This Error...
error
The field Shipping Address Country is
required
A match of the Shipping Address City, State,
and Postal Code failed.
74March 2007Name-Value Pair API Developer Guide and Reference
T
ABLE B.4 GetExpressCheckoutDetails API Errors
Error Message Reference
Express Checkout API Errors
Error
Code
Short
MessageLong MessageCorrecting This Error...
10001ButtonSource
value
truncated.
10001ButtonSource
value
truncated.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
The transaction could not be
loaded
The transaction could not be
loaded
Transaction refused because of
an invalid argument. See
additional error messages for
details.
The transaction id is not valid
10004Invalid
transaction
type
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
You can not get the details for
this type of transaction
The transaction could not be
loaded
The transaction id is not valid
Name-Value Pair API Developer Guide and ReferenceMarch 200775
Error Message Reference
Express Checkout API Errors
T
ABLE B.4 GetExpressCheckoutDetails API Errors
Error
Code
10007Permission
10007Permission
10007Permission
10408Express
10409You're not
10410Invalid token Invalid token.
10411This Express
Short
MessageLong MessageCorrecting This Error...
You do not have permissions to
denied
denied
denied
Checkout
token is
missing.
authorized to
access this
info.
Checkout
session has
expired.
make this API call
You do not have permission to
get the details of this transaction
You do not have permissions to
make this API call
Express Checkout token is
missing.
Express Checkout token was
issued for a merchant account
other than yours.
This Express Checkout session
has expired. Token value is no
longer valid.
T
ABLE B.5 DoExpressCheckoutPayment API Errors
Error
Code
10001Internal Error Transaction failed due to internal
10001Internal Error Warning an internal error has
10001ButtonSource
10001Internal Error Internal Error
Short
MessageLong MessageCorrecting This Error...
error
occurred. The transaction id may
not be correct
The transaction could not be
value
truncated.
loaded
76March 2007Name-Value Pair API Developer Guide and Reference
T
ABLE B.5 DoExpressCheckoutPayment API Errors
Error Message Reference
Express Checkout API Errors
Error
Code
Short
MessageLong MessageCorrecting This Error...
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10007Permission
denied
10406Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
Transaction refused because of
an invalid argument. See
additional error messages for
details.
The transaction id is not valid
You do not have permissions to
make this API call
The PayerID value is invalid.
10408Express
Checkout
Express Checkout token is
missing.
token is
missing.
10409You're not
authorized to
access this
Express Checkout token was
issued for a merchant account
other than yours.
info.
10410Invalid token Invalid token.
10411This Express
Checkout
session has
This Express Checkout session
has expired. Token value is no
longer valid.
expired.
10412Duplicate
invoice
Name-Value Pair API Developer Guide and ReferenceMarch 200777
Payment has already been made
for this InvoiceID.
Error Message Reference
Express Checkout API Errors
T
ABLE B.5 DoExpressCheckoutPayment API Errors
Error
Code
Short
MessageLong MessageCorrecting This Error...
10413Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10414Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10415Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
The totals of the cart item
amounts do not match order
amounts.
The amount exceeds the
maximum amount for a single
transaction.
A successful transaction has
already been completed for this
token.
If you include any of the following element values
with DoExpressCheckoutPayment, the sum of
their values must equal the value of OrderTotal.
z ItemTotal
z ShippingTotal
z HandlingTotal
z TaxTotal
If you get this error, research why it might have
occurred and modify your implementation of
Express Checkout to ensure proper addition of the
values.
10416Transaction
refused
because of an
invalid
You have exceeded the
maximum number of payment
attempts for this token.
You can send a maximum of 10
DoExpressCheckoutPayment API calls for any
single token value, after which the token becomes
invalid.
argument. See
additional error
messages for
details.
78March 2007Name-Value Pair API Developer Guide and Reference
T
ABLE B.5 DoExpressCheckoutPayment API Errors
Error Message Reference
Express Checkout API Errors
Error
Code
Short
MessageLong MessageCorrecting This Error...
10417Transaction
cannot
complete.
10418Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
The transaction cannot complete
successfully. Instruct the
customer to use an alternative
payment method.
The currencies of the shopping
cart amounts must be the same.
It is possible that the payment method the customer
chooses on PayPal might not succeed when you
send DoExpressCheckoutPayment. The most
likely cause is that the customer’s credit card failed
bank authorization. Another possible, though rare,
cause is that the final OrderTotal is significantly
higher than the original estimated OrderTotal
you sent with SetExpressCheckout at
Integration Point 1, and the final OrderTotal
does not pass PayPal’s risk model analysis.
If the customer has no other PayPal funding source
that is likely to succeed,
DoExpressCheckoutPayment response
returns error code 10417.
Instruct the customer that PayPal is unable to
process the payment and redisplay alternative
payment methods with which the customer can pay.
10419Express
Checkout
Express Checkout PayerID is
missing.
PayerID is
missing.
10420Transaction
refused
Express Checkout
PaymentAction is missing.
because of an
invalid
argument. See
additional error
messages for
details.
Name-Value Pair API Developer Guide and ReferenceMarch 200779
Error Message Reference
Express Checkout API Errors
TABLE B.5 DoExpressCheckoutPayment API Errors
Error
Code
10421This Express
10422Customer must
10423Transaction
Short
MessageLong MessageCorrecting This Error...
Checkout
session
belongs to a
different
customer.
choose new
funding
sources.
refused
because of an
invalid
argument. See
additional error
messages for
details.
This Express Checkout session
belongs to a different customer.
Token value mismatch.
The customer must return to
PayPal to select new funding
sources.
This transaction cannot be
completed with PaymentAction
of Authorization.
When your customer logs into PayPal, the PayPal
PayerID is associated with the Express Checkout
token. This error is caused by mixing tokens for
two different PayerIDs. The Token and PayerID
returned for any particular customer by
GetExpressCheckoutDetails response
must be the same ones you send with
DoExpressCheckoutPayment.
Verify that your programs are properly associating
the Tokens and PayerIDs.
It is possible that the payment method the customer
chooses on PayPal might not succeed when you
send DoExpressCheckoutPayment request. If
the customer has a different PayPal funding source
that is likely to succeed,
DoExpressCheckoutPayment response returns
error code 10422 so you can redirect the customer
back to PayPal.
This error occurs if at Integration Point 1, you set
PaymentAction to Sale with
SetExpressCheckout request but at Integration Point 3, you set PaymentAction to
Authorization with
DoExpressCheckoutPayment.
PayPal does not allow this switch from Sale to
Authorization in a single checkout session.
PayPal does allow the reverse, however. You can
set PaymentAction to Authorization with
SetExpressCheckout at Integration Point 1 and
switch PaymentAction to Sale with
DoExpressCheckoutPayment at Integration
Point 3.
10424Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
Shipping address is invalid.If you receive this error message, PayPal
recommends that you return your customer to
PayPal to review and approve new valid funding
sources. Although this error is rare, you should
consider trapping the error to display a message to
the customer describing what happened, along with
a button or hyperlink to return to PayPal. For the
rules of this calculation, see the chapter about best
practices in the PayPal Express Checkout Integration Guide.
80March 2007Name-Value Pair API Developer Guide and Reference
T
ABLE B.5 DoExpressCheckoutPayment API Errors
Error Message Reference
Express Checkout API Errors
Error
Code
Short
MessageLong MessageCorrecting This Error...
10431Item amount is
invalid.
10432Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10433Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10434Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
Item amount is invalid.
Invoice ID value exceeds
maximum allowable length.
Value of OrderDescription
element has been truncated.
Value of Custom element has
been truncated.
10435Transaction
refused
because of an
The customer has not yet
confirmed payment for this
Express Checkout session.
invalid
argument. See
additional error
messages for
details.
10441Transaction
refused
because of an
The NotifyURL element value
exceeds maximum allowable
length.
invalid
argument. See
additional error
messages for
details.
Name-Value Pair API Developer Guide and ReferenceMarch 200781
Error Message Reference
Express Checkout API Errors
T
ABLE B.5 DoExpressCheckoutPayment API Errors
Error
Code
10442ButtonSource
10443Transaction
10444Transaction
10445This
Short
MessageLong MessageCorrecting This Error...
value
truncated.
refused
because of an
invalid
argument. See
additional error
messages for
details.
refused
because of an
invalid
argument. See
additional error
messages for
details.
transaction
cannot be
processed at
this time.
Please try
again later.
The ButtonSource element value
exceeds maximum allowable
length.
This transaction cannot be
completed with PaymentAction
of Order.
The transaction currency
specified must be the same as
previously specified.
This transaction cannot be
processed at this time. Please try
again later.
10446Unconfirmed
email
10474Invalid DataThis transaction cannot be
10537Risk Control
Country Filter
Failure
10538Risk Control
Max Amount
Failure
A confirmed email is required to
make this API call.
processed. The country code in
the shipping address must match
the buyer’s country of residence.
The transaction was refused
because the country was
prohibited as a result of your
Country Monitor Risk Control
Settings.
The transaction was refused
because the maximum amount
was excceeded as a result of your
Maximum Amount Risk Control
Settings.
The buyer selects the country of residence when
they sign up for their PayPal account. The country
of residence is displayed after the dash in the title
on the Account Overview page.
82March 2007Name-Value Pair API Developer Guide and Reference
T
ABLE B.5 DoExpressCheckoutPayment API Errors
Error Message Reference
Express Checkout API Errors
Error
Code
Short
MessageLong MessageCorrecting This Error...
10539Payment
declined by
your Risk
Controls
settings:
PayPal Risk
Model.
10725Shipping
Address
Country Error
10727Shipping
Address1
Empty
10728Shipping
Address City
Empty
10729Shipping
Address State
Empty
Payment declined by your Risk
Controls settings: PayPal Risk
Model.
There was an error in the
Shipping Address Country field
The field Shipping Address1 is
required
The field Shipping Address City
is required
The field Shipping Address State
is required
10730Shipping
Address Postal
Code Empty
10731Shipping
Address
Country Empty
10736Shipping
Address
Invalid City
State Postal
Code
The field Shipping Address
Postal Code is required
The field Shipping Address
Country is required
A match of the Shipping Address
City, State, and Postal Code
failed.
Name-Value Pair API Developer Guide and ReferenceMarch 200783
Error Message Reference
RefundTransaction API Errors
RefundTransaction API Errors
TABLE B.6 RefundTransaction API Errors
Short
Error Code
10001Internal Error Internal Error
10001Internal Error Warning an internal error has occurred. The
MessageLong MessageCorrecting This Error...
transaction id may not be correct
10001ButtonSource
value
truncated.
10001Internal Error Internal Error
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
The transaction could not be loaded
The partial refund amount must be a positive
amount
You can not specify a partial amount with a
full refund
A transaction id is required
84March 2007Name-Value Pair API Developer Guide and Reference
Error Code
Error Message Reference
RefundTransaction API Errors
T
ABLE B.6 RefundTransaction API Errors
Short
MessageLong MessageCorrecting This Error...
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
The partial refund amount must be a positive
amount
You can not specify a partial amount with a
full refund
A transaction id is required
10004Transaction
Transaction class is not supported
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
The transaction id is not valid
refused
because of an
invalid
argument. See
additional error
messages for
details.
10007Permission
denied
Name-Value Pair API Developer Guide and ReferenceMarch 200785
You do not have permission to refund this
transaction
Error Message Reference
RefundTransaction API Errors
T
ABLE B.6 RefundTransaction API Errors
Short
Error Code
MessageLong MessageCorrecting This Error...
10007Permission
denied
10009Transaction
refused
10009Transaction
refused
10009Transaction
refused
You do not have permissions to make this API
call
You do not have a verified ACHThis error can be caused by
insufficient funds in your
PayPal balance to cover the
amount of the refund and
either your not having yet
verified the bank account
associated with your PayPal
account or your not having
any bank account associated
with your PayPal account at
all.
Ensure that you have
sufficient funds in your
PayPal balance and that you
have verified the associated
bank account.
The partial refund amount must be less than or
equal to the original transaction amount
The partial refund amount must be less than or
equal to the remaining amount
10009Transaction
refused
10009Transaction
refused
10009Transaction
refused
10009Transaction
refused
10009Transaction
refused
10009Transaction
refused
10009Transaction
refused
The partial refund amount is not valid
Because a complaint case exists on this
transaction, only a refund of the full or full
remaining amount of the transaction can be
issued
You are over the time limit to perform a refund
on this transaction
Can not do a full refund after a partial refund
Account is locked or inactive
The partial refund must be the same currency
as the original transaction
This transaction has already been fully
refunded
86March 2007Name-Value Pair API Developer Guide and Reference
Error Code
Error Message Reference
TransactionSearch API Errors
T
ABLE B.6 RefundTransaction API Errors
Short
MessageLong MessageCorrecting This Error...
10009Transaction
refused
10009Transaction
refused
10009Transaction
refused
10009Transaction
refused
10009Transaction
refused
10011Invalid
transaction id
value
11001Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
Account is restricted
You can not refund this type of transaction
You can not do a partial refund on this
transaction
The account for the counterparty is locked or
inactive
You can not refund this type of transaction
Transaction refused because of an invalid
transaction id value
Transaction class is not supported
TransactionSearch API Errors
T
ABLE B.2TransactionSearch API Errors
Error
CodeShort MessageLong Message
10001Internal Error Internal Error
10001ButtonSource value
truncated.
10003Transaction refused because
of an invalid argument. See
additional error messages for
details.
Name-Value Pair API Developer Guide and ReferenceMarch 200787
The transaction could not be loaded
Start date is a required parameter
Error Message Reference
TransactionSearch API Errors
T
ABLE B.2TransactionSearch API Errors
Error
CodeShort MessageLong Message
10004Transaction refused because
of an invalid argument. See
additional error messages for
details.
10004Transaction refused because
of an invalid argument. See
additional error messages for
details.
10004Transaction refused because
of an invalid argument. See
additional error messages for
details.
10004Transaction refused because
of an invalid argument. See
additional error messages for
details.
10004Transaction refused because
of an invalid argument. See
additional error messages for
details.
10004Transaction refused because
of an invalid argument. See
additional error messages for
details.
Start date is invalid
End date is invalid
Currency is not supported
Transaction class is not supported
Receipt id is not valid
Payer email is invalid
10004Transaction refused because
of an invalid argument. See
additional error messages for
details.
10004Transaction refused because
of an invalid argument. See
additional error messages for
details.
10004Transaction refused because
of an invalid argument. See
additional error messages for
details.
10004Transaction refused because
of an invalid argument. See
additional error messages for
details.
Auction item id is not valid
Receiver email is invalid
You can not search for a transaction id and a receipt id
Receiver can only be specified for payments you've received
88March 2007Name-Value Pair API Developer Guide and Reference
T
ABLE B.2TransactionSearch API Errors
Error
CodeShort MessageLong Message
Error Message Reference
GetTransactionDetails API Errors
10004Transaction refused because
of an invalid argument. See
additional error messages for
details.
10007Permission denied You do not have permissions to search for this transaction
10007Permission denied You do not have permissions to make this API call
11002Search warning The number of results were truncated. Please change your search
The transaction id is not valid
parameters if you wish to see all your results.
GetTransactionDetails API Errors
T
ABLE B.7 GetTransactionDetails API Errors
Short
Error Code
10001Internal ErrorInternal Error
MessageLong Message
MassPay API Errors
ABLE B.8 MassPay API Errors
T
Short
Error Code
10001Inval id account
10001Internal ErrorInternal Error
10001Internal ErrorThe transaction could not be loaded
10001ButtonSource
Name-Value Pair API Developer Guide and ReferenceMarch 200789
MessageLong Message
The transaction failed as a result of an invalid credit card number.
number.
value
truncated.
Check the number or attempt with another card.
The transaction could not be loaded
Error Message Reference
MassPay API Errors
T
ABLE B.8 MassPay API Errors
Error Code
Short
MessageLong Message
10001Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10002Account
locked
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
The masspay receiver_type is not a recognizable type
The user account is locked
The number of input records is greater than maximum allowed
The number of input records is less than or equal to zero
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
The note string length exceeds the maximum limit of 4000
characters
The amount is missing
90March 2007Name-Value Pair API Developer Guide and Reference
T
ABLE B.8 MassPay API Errors
Short
Error Code
MessageLong Message
Error Message Reference
MassPay API Errors
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
The currency is missing
Currency is not supported
The amount is not a valid number
10004Transaction
refused
The amount exceeds the max limit of a single mass pay item
~1
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
The amount is less than or equal to zero
refused
because of an
invalid
argument. See
additional error
messages for
details.
Name-Value Pair API Developer Guide and ReferenceMarch 200791
Error Message Reference
MassPay API Errors
T
ABLE B.8 MassPay API Errors
Error Code
Short
MessageLong Message
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
10004Transaction
refused
because of an
invalid
argument. See
additional error
messages for
details.
The unique id string length exceeds the maximum limit of 30
characters
The unique id string contains a space as a character
The transaction id is not valid
10007Permission
denied
10301User not
allowed
10303Restricted
account
10304Unconfirmed
email
10305Limit
Exceeded
10306Limit
Exceeded
10307Receive only
account
You do not have permissions to make this API call
The user is not allowed to send money through Mass Pay
Account is restricted
The user account has unconfirmed email
The user account needs to have its sending limit removed in order
to make a mass payment.
The user’s international account needs to have its sending limit
removed in order to make a mass payment
The user account is receive only and therefore cannot send
payments out
92March 2007Name-Value Pair API Developer Guide and Reference
T
ABLE B.8 MassPay API Errors
Short
Error Code
MessageLong Message
Error Message Reference
MassPay API Errors
10308Masspay
server
configuration
error
10309Masspay
server
unavailable
10310Unable to
create payment
10311Unable to
submit
payment
10312Masspay
server error
10313Masspay
Invalid Data
10314Masspay input
parse error
10317Masspay
Invalid Email
There is some configuration error
The mass pay server is unavailable
Unable to create payments for masspay
Unable to submit payments for masspay
The masspay server has reported errors
The masspay input file includes invalid data
The input to the masspay server is incorrect. Please make sure
that you are using a correctly formatted input.
The masspay input file includes invalid Email
10320Internal ErrorInternal Error
10321Insufficient
The account does not have sufficient funds to do this masspay
funds
10327Masspay
The masspay input file includes invalid UserID
Invalid UserID
Name-Value Pair API Developer Guide and ReferenceMarch 200793
Error Message Reference
MassPay API Errors
94March 2007Name-Value Pair API Developer Guide and Reference
NVP API Web Samples
C
This chapter describes the NVP API Web Samples which access the NVP API directly. This
section includes the following topics:
z “Descriptions of the Samples” on page 95
z “Samples Using PHP” on page 99
z “Samples Using PHP” on page 99
z “Samples Using Classic ASP” on page 100
Descriptions of the Samples
The web samples consist of the following:
z “Accepting PayPal in Express Checkout” on page 95
z “Getting Transaction Details” on page 97
z “Common Files” on page 98
The main page of the samples, index.html or Default.htm, contains links to each sample.
N OTE: We describe the code samples for all programming languages in this section. Language
specific filenames are shown as
stands for SetExpressCheckout.java, SetExpressCheckout.php, and so forth.
Accepting PayPal in Express Checkout
This sample shows how to use Express Checkout to accept payments using PayPal. Access
this sample from the following choices displayed on index.html or Default.htm:
ExpressCheckout - SaleDo basic checkout with PayPal.
In the SetExpressCheckout request, the PAYMENTACTION
parameter is set to Sale.
filename.ext. For example, SetExpressCheckout.ext
Name-Value Pair API Developer Guide and ReferenceApril 200795
NVP API Web Samples
Descriptions of the Samples
The primary files for this sample are:
TABLE C.1Express Checkout Files
FileDescription
SetExpressCheckout.
ReviewOrder.
extThis file is called after the user clicks on a button during the
extThis is the main web page for the Express Checkout sample.
The page allows the user to enter amount and currency type. It
also accept input variable paymentType which becomes the
value of the PAYMENTACTION parameter.
When the user clicks the
Submit button, ReviewOrder.ext is
called.
Called by index.html or Default.htm.
Calls ReviewOrder.
ext.
checkout process to use PayPal's Express Checkout. The user
logs in to their PayPal account.
This file is called twice.
On the first pass, the code executes the if statement:
if (! isset ($token))
The code collects transaction parameters from the form
displayed by SetExpressCheckout.
ext then constructs and
sends a SetExpressCheckout request string to the PayPal
server. The paymentType variable becomes the
PAYMENTACTION parameter of the request string. The
RETURNURL parameter is set to this file; this is how
ReviewOrder.
ext is called twice.
On the second pass, the code executes the else statement.
On the first pass, the buyer completed the authorization in their
PayPal account; now the code gets the payer details by sending
a GetExpressCheckoutDetails request to the PayPal
server. Then the code calls GetExpressCheckoutDetails.
N OTE: Be sure to check the value of PAYPAL_URL. The buyer
ext.
is sent to this URL to authorize payment with their
PayPal account. For testing purposes, this should be set
to the PayPal sandbox.
Called by SetExpressCheckout.
Calls GetExpressCheckoutDetails.
Display.
ext.
ext.
ext, CallerService.ext, and
GetExpressCheckoutDetails.
extThis functionality is called after the buyer returns from PayPal
and has authorized the payment.
Displays the payer details returned by the
GetExpressCheckoutDetails response and calls
DoExpressCheckoutPayment.
ext to complete the payment
authorization.
Called by ReviewOrder.
Calls DoExpressCheckoutPayment.
ext.
ext and CallerService.ext.
96April 2007Name-Value Pair API Developer Guide and Reference
T
ABLE C.1Express Checkout Files (Continued)
FileDescription
DoExpressCheckoutPayment.extThis functionality is called to complete the payment with
Getting Transaction Details
This sample shows how to use the GetTransactionDetails request. Access this sample from the
following choice displayed on index.html or Default.htm:
GetTransactionDetailsGets transaction details for a specific transaction ID.
NVP API Web Samples
Descriptions of the Samples
PayPal and display the result to the buyer.
The code constructs and sends the
DoExpressCheckoutPayment request string to the PayPal
server.
Called by GetExpressCheckoutDetails.
CallerService.
ext.
The main page displays a text box where the user enters a
transaction ID. When the user clicks the
constructs an NVP API request to GetTransactionDetails
and sends it to the PayPal server.
ext and
Submit button, the code
The primary files for this sample are:
T
ABLE C.2Get Transaction Details Files
FileDescription
GetTransactionDetails.
TransactionDetails.
extThis is the main page for GetTransactionDetails sample. This page
displays a text box where the user enters a transaction ID and a
Submit button that calls TransactionDetails.ext.
Calls TransactionDetails.
extSends a GetTransactionDetails NVP API request to PayPal.
The code retrieves the transaction ID and constructs the NVP API
request string to send to the PayPal server. The request to PayPal
uses an API signature.
After receiving the response from the PayPal server, the code
displays the request and response in the browser. If the response
was a success, it displays the response parameters. If the response
was an error, it displays the errors received.
Called by GetTransactionDetails.html.
ext.
Name-Value Pair API Developer Guide and ReferenceApril 200797
NVP API Web Samples
Common Files
The following files are common to the samples.
TABLE C.3Common Files
FileDescription
index.html
Default.htm
sdk.cssCascading Style Sheet (CSS) used by index.html or Default.htm.
CallerService.
extThis is the configuration file for the samples.This file contains the
The main web page with links to each sample.
Calls SetExpressCheckout.
parameters needed to make an API call.
The samples come with an API signature for making API calls to the
PayPal sandbox. The API signature is described in
with API Signature” on page 98.
Called by TransactionDetails.ext, ReviewOrder.ext, and Display.ext.
Display.
extDisplays request and response parameters. If there is an error, displays
request and error parameters.
Called by TransactionDetails.
DoExpressCheckoutPayment.
Sample API User with API Signature
ext, and GetTransactionDetails.html.
“Sample API User
ext, and
ext.
The samples come with an API signature for use with the samples and the PayPal Sandbox.
This API signature belongs to the following user:
ABLE C.1 Details of the Sample API Signature
T
API usernamesdk-three_api1.sdk.com
API passwordQFZCWN5HZM8VBG7Q
API signatureA-IzJhZZjhg29XQ2qnhapuwxIDzyAZQ92FRP5dqBzVesOkzbdUONzmOU
IMPORTANT: You must protect the API signature values in your implementation. Consider
storing these values in a secure location other than your web server document
root and setting the file permissions so that only the system user executing
your ecommerce application can access it.
The sample code does not store these values securely. The sample code should never be
used in production.
98April 2007Name-Value Pair API Developer Guide and Reference
Samples Using PHP
This section contains information for configuring and running the NVP API Web Samples
Using PHP.
Required Software
The following software is required:
ABLE C.4Required Software
T
SoftwareVersionDownload Location
NVP API Web Samples
Samples Using PHP
PHP with CURL extension
enabled
Apache HTTP Server1.3.17 or greaterhttp://httpd.apache.org/
4.4.2 or greaterhttp://www.php.net/downloads.php
You must install and configure PHP with the Apache HTTP Server.
Download and Unzip the Samples
The latest version of the Web Samples are available at
https://www.paypal.com/IntegrationCenter/ic_nvp.html.
1. Download the zipfile distribution.
2. Unzip the zipfile to any directory of you choose.
Installing the Samples
Copy the sample folder, php_nvp_samples, to the docroot of the Apache HTTP Server. By
default docroot is in
datadir/htdocs.
Running the Samples
First, make sure that you have installed the required software and the samples.
You can run the samples by entering the following address in a web browser:
Name-Value Pair API Developer Guide and ReferenceApril 200799
NVP API Web Samples
Samples Using Classic ASP
Samples Using Classic ASP
This section contains information for configuring and running the NVP API Web Samples
Using Classic ASP.
Required Software
No additional software is required.
Download and Unzip the Samples
The latest version of the Web Samples are available at
https://www.paypal.com/IntegrationCenter/ic_nvp.html.
1. Download the zipfile distribution.
2. Unzip the zipfile to any directory of you choose.
Installing the Samples
The samples must be installed in IIS. The samples require IIS version 5.1 or above.
Create a virtual directory named PayPalClassicAspNvpSamples in IIS that points to
Samples_Root.
Running the Samples
First, make sure that you have installed the required software and the samples.
You can run the samples by entering the following address in a web browser: