Transaction Information - Getting Started

Important: This integration method is deprecated as of January 1, 2017. PayPal continues to support existing merchants using this method, but please be advised new features and enhancements will not be applied to these integrations. For new integrations, see the PayPal Checkout Integration Guide.

Get up and running with this service:

Overview

Transaction Information is a list of calls that return account and transaction information.

Note that there is no "Transaction Information API" or service. "Transaction Information" is simply a nickid given to a collection of calls and these calls are from several different APIs.

These calls (from different APIs) make up the "Transaction Information" family of calls:

  • AddressVerify — Verifies the address and ZIP code of an account holder (API: Express Checkout and Website Payments Pro). To determine whether you can use this limited-release API, contact your PayPal integration team.
  • GetTransactionDetails — Retrieves information about the specified transaction ID (API: Express Checkout and Website Payments Pro)
  • GetBalance — Returns the available balance of the specified PayPal account (API: Express Checkout and Website Payments Pro)
  • PaymentDetails — Returns details about a payment corresponding to a transaction (API: Adaptive Payments)

(By the way, if your goal is to create an invoice, you are better off using the Invoicing API.)

You can make calls in these formats:

Request method Request format Response format
HTTP POST Name/value pairs Name/value pairs
HTTP POST SOAP (1.1, 1.2) SOAP

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

The following example calls GetTransactionDetails in the sandbox via the specified app (signified by combo of USER, PWD, SIGNATURE) to get facts about the transaction ID you provide (such as transaction date, amount, status).

  1. Obtain the endpoint for the service and environment you are addressing. The following example uses the sandbox endpoint for a name-value pair format using a Signature authentication:

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

    For the complete list of endpoints, including the SOAP endpoints, see NVP/SOAP API endpoints.

  2. Provide the authentication. For the sample GetTransactionDetails call, set these values through parameters that you pass to the call.

    // Sandbox API credentials for the API caller account
    USER : // user id
    PWD : // password
    SIGNATURE : // signature
    VERSION : // the release version of the API
    
  3. Provide parameters needed by the specific call being made (for this example, see also the GetTransactionDetails reference).

    METHOD : GetTransactionDetails
    TransactionID : a valid transaction ID
    

    You are now ready to make a call.

  4. Make the call. (For an example, see Try It, below.)

  5. Evaluate the response.

    For the Try It example below, you might get something like the following (which has been split to multiple lines for readability):

    ACK=Success
    // details of the transaction
    &RECEIVERBUSINESS=platfo_1255077030_biz%40gmail%2ecom
    &RECEIVEREMAIL=platfo_1255077030_biz%40gmail%2ecom&RECEIVERID=HZH2W8NPXUE5W
    &PAYERID=R6BXPWS9ELFQ2&PAYERSTATUS=unverified&COUNTRYCODE=US
    &ADDRESSOWNER=PayPal&ADDRESSSTATUS=None&SALESTAX=0%2e00
    &SHIPAMOUNT=0%2e00&SHIPHANDLEAMOUNT=0%2e00&FIRSTNAME=James
    &LASTNAME=Smith&TRANSACTIONID=61K41112Y6568602S&RECEIPTID=0256%2d9196%2d7112%2d3695
    &TRANSACTIONTYPE=webaccept&PAYMENTTYPE=instant&ORDERTIME=2011%2d08%2d11T00%3a14%3a20Z
    &AMT=5%2e00&FEEAMT=0%2e50&TAXAMT=0%2e00&CURRENCYCODE=USD&PAYMENTSTATUS=Pending
    &PENDINGREASON=payment-review&REASONCODE=None&PROTECTIONELIGIBILITY=Ineligible
    &PROTECTIONELIGIBILITYTYPE=None&L_QTY0=1&L_TAXAMT0=0%2e00&L_CURRENCYCODE0=USD
    // additional artifacts of a job run
    &TIMESTAMP=2011%2d08%2d15T23%3a39%3a30Z&CORRELATIONID=bca72df95d1f1&VERSION=78&BUILD=2020243
    

Try it

This example calls GetTransactionDetails in the sandbox via the specified app (signified by combo of USER, PWD, SIGNATURE) to get facts about the transaction ID you provide (such as transaction date, amount, status).

  1. Copy 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=GetTransactionDetails \
      -d VERSION=78&TransactionID=61K41112Y6568602S
    
  2. Replace the value of TransactionID with the ID of a current transaction (transactions disappear in six months). If you need a new transaction ID, see Getting a Transaction ID, below.

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

Get a transaction ID

If you need a fresh transaction ID for Try It, you can perform the following to get a handful of transaction IDs created between STARTDATE and ENDDATE (recommendation: replace these with recent dates).

  1. Copy 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=TransactionSearch \
      -d VERSION=78 \
      -d TRXTYPE=Q \
      -d STARTDATE=2011-01-01T0:0:0 \
      -d ENDDATE=2011-01-03T24:0:0
    
  2. Replace the values of STARTDATE and ENDDATE so that (1) they are close to each other (a larger range will result in more results and a longer response time) and (2) STARTDATE is not older than six months (for that is as long as transaction records are kept in the system).

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

    You get a result such as the following:

     L_TIMESTAMP0=2011%2d01%2d03T23%3a55%3a41Z&L_TIMESTAMP1=2011%2d01%2d03T23%3a46%3a12Z&L_TIMESTAMP2=...
     &L_TRANSACTIONID0=61K41112Y6568602S&L_TRANSACTIONID1=I%2d2GBYMGD8WXYW&L_TRANSACTIONID2=...
     
  4. Grab any one of the L_TRANSACTIONID values (e.g. the value of L_TRANSACTIONID0).

Next steps

We recommend the following:

  1. Try the same example with your own credentials to confirm that you set up your sandbox accounts correctly.

  2. Set up your sandbox environment.

    To make test calls, you need a sandbox account, test users, and PayPal API credentials. If you have not yet set these up, do so now. See Getting Started with PayPal Sandbox.

  3. Substitute your own Sandbox credentials and user-specific inputs in the Try It example and rerun it to confirm you set up your Sandbox and users correctly.

  4. API reference for the Transaction Information API

Schema

Main WSDL: https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl

Referenced XSD: https://www.paypalobjects.com/wsdl/eBLBaseComponents.xsd

Referenced XSD: https://www.paypalobjects.com/wsdl/CoreComponentTypes.xsd

Referenced XSD: https://www.paypalobjects.com/wsdl/EnhancedDataTypes.xsd

Adaptive Payments schema: https://svcs.paypal.com/AdaptivePayments?WSDL

Feedback