Make your first Express Checkout call

This topic describes how to make your first Express Checkout API call.

Make your first call

Use one of these formats to make calls:

Request method Request format Response format
HTTP POST Name-value pair (NVP) Name-value pair (NVP)
HTTP POST SOAP (1.1, 1.2) SOAP

Note: PayPal no longer supports the GET HTTP method for the classic NVP/SOAP APIs. For more information, including the planned change date, see Discontinue Use of GET Method for Classic APIs Microsite. Ensure that by the specified date your API requests only use the POST HTTP method.

The following example SetExpressCheckout call shows you how to construct an API call.

Get the endpoint for the service and environment that you want to access. For example, to access the NVP service in the PayPal sandbox:

https://api-3t.sandbox.paypal.com/nvp

To access the SOAP endpoint, see API endpoints.

Each API call specifies authentication credentials, as follows:

// Sandbox API credentials for the API caller account
USER= // user id
PWD= // password
SIGNATURE= // signature
VERSION= // the release version of the API

You can pass parameters in an API call. For example, you can pass the following parameters to the SetExpressCheckout operation:

METHOD=<var>SetExpressCheckout</var>
PAYMENTREQUEST_0_AMT= // payment amount
PAYMENTREQUEST_0_PAYMENTACTION= // type of transaction
PAYMENTREQUEST_0_CURRENCYCODE= // payment currency code
returnUrl= // redirect URL for use if the customer authorizes payment
cancelUrl= // redirect URL for use if the customer does not authorize payment

To make the call, see Try It!

Try it!

If the curl command is not found on your computer, download the free cURL executable.

This example shows a SetExpressCheckout Sandbox call that initiates a $10 payment. The combination of the USER, PWD, and SIGNATURE values identifies the app that makes the API call.

Copy and run this cURL command:

curl https://api-3t.sandbox.paypal.com/nvp \
-s \
--insecure \
-d USER=platfo_1255077030_biz_api1.gmail.com \
-d PWD=1255077037 \
-d SIGNATURE=Abg0gYcQyxQvnf2HDJkKtA-p6pqhA1k-KTYE0Gcy1diujFio4io5Vqjf \
-d METHOD=SetExpressCheckout \
-d VERSION=78 \
-d PAYMENTREQUEST_0_PAYMENTACTION=SALE \
-d PAYMENTREQUEST_0_AMT=19 \
-d PAYMENTREQUEST_0_CURRENCYCODE=USD \
-d cancelUrl=http://www.example.com/cancel.html \
-d returnUrl=http://www.example.com/success.html

A similar response should be returned:

ACK=Success
// a reference to the payment transaction that can be processed on paypal.com
&TOKEN=EC%2d5T410414TT256914A
// additional data about the API call
&TIMESTAMP=2011%2d08%2d09T18%3a21%3a32Z&CORRELATIONID=29bfef7d4d383&VERSION=78&BUILD=2020243LM-SJN-00711105:

This response has been split for readability.

If the call fails with ACK=Failure, review the error message details. Then, try the call again.

Next steps

For detailed integration steps, see the Express Checkout with In-Context integration guide.

Additional information