Integration Guide

Table Of Contents
Express Checkout Integration Guide May 2010 33
PayPal Name-Value Pair API Basics
Creating an NVP Request
3
To enable PayPal to authenticate your request
1. Specify the API user name associated with your account.
USER=
API_username
2. Specify the password associated with the API user name.
PWD=
API_password
3. If you are using an API signature and not an API certificate, specify the API signature
associated with the API username.
SIGNATURE=
API_signature
Specifying Credentials using cURL
The following example shows one way to specify a signature using cURL:
curl --insecure https://api-3t.sandbox.paypal.com/nvp -d ^
"METHOD=DoDirectPayment^
&VERSION=56.0^
&USER=API_username^
&PWD=API_password^
&SIGNATURE=API_signatue^
&..."
NOTE: This example does not establish a secure connection and should not be used live on
paypal.com.
URL Encoding
All requests to execute PayPal API operations sent via HTTP must be URL encoded.
The PayPal NVP API uses the HTTP protocol to send requests and receive responses from a
PayPal API server. You must encode all data sent using the HTTP protocol because data that is
not encoded could be misinterpreted as part of the HTTP protocol instead of part of the
request. Most programming languages provide a way to encode strings in this way. You
should consistently URL encode the complete API request; otherwise, you may find that
unanticipated data causes an error.
NOTE: An HTTP form is automatically URL encoded by most browsers.