Home
  • Payments and Transfers
  • Disputes and Limitations
  • My Account
  • My Wallet
  • Login & Security
  • Seller Tools

How do I use Checkout with Reference Transactions and Payflow Pro?

To perform Reference Transactions with the Payflow API, you must be using Payflow Pro or Website Payments Pro Payflow Edition.
 
Enable Reference Transactions
To process Reference Transactions, you must enable this feature on both your Payflow Pro and PayPal accounts. You must have admin permissions to perform these steps.

Payflow Pro account:
  1. Log in to PayPal Manager.
  2. Click Account Administration.
  3. Click Transaction Settings.
  4. Set Allow Reference Transactions to Yes.
  5. Click Confirm.
Note: Changes may take up to an hour to take effect.

PayPal account:
  • Sandbox:  
  • Reference Transactions are automatically enabled on Sandbox accounts created after December 15, 2015.
  • If your Sandbox account was created before this date, contact PayPal's Customer Service and ask to have Reference Transactions enabled on your Sandbox account.  
  • Live/Production:
  • PayPal must approve enablement of Reference Transactions for your Live account.
  • To request approval for your Live account, contact PayPal's Customer Service.   

Perform Reference Transactions
After the Reference Transactions feature has been enabled on your account, you'll be able to perform Reference Transactions using Checkout. As with any Checkout API call, you must first set up the Checkout Token: SetExpressCheckout Request

SetExpressCheckout API call
 
USER=xxxx
PWD=xxxxxx
VENDOR=xxxxxxx
PARTNER=PayPal
TRXTYPE=A
TENDER=P
ACTION=S
AMT=1.00
CURRENCY=USD
RETURNURL=https://localhost/return.php
CANCELURL=https://localhost
BILLINGTYPE=MerchantInitiatedBilling
BA_DESC=TestBA

SetExpressCheckout API response
 
Array
(
[0] => RESULT=0
[1] => RESPMSG=Approved
[2] => TOKEN=EC-71R89077TF0534055
[3] => CORRELATIONID=8610b9bb780fc
)

You'll then redirect to the appropriate URL as normal:
https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-71R89077TF0534055

When the customer is returned to the RETURNURL as specified in the SetExpressCheckout API Call, the Token and PayerID are posted to you:
http://localhost/return.php?TOKEN=EC-71R89077TF0534055&PAYERID=WN26CFVF7686J

You can then take that Token and the PayerID to make the other calls.
 Create a Billing Agreement ID (BAID)
To create the BAID, make the following API call (note that "ACTION=X").

API call
 
USER=xxxx
PWD=xxxx
VENDOR=xxxxx
PARTNER=PayPal
TENDER=P
TRXTYPE=A
ACTION=X
TOKEN=EC-71R89077TF0534055

API response
The response contains the BAID:
 
Array
(
[0] => RESULT=0
[1] => PNREF=E15P2EB5B6AF
[2] => RESPMSG=Approved
[3] => TOKEN=EC-71R89077TF0534055
[4] => CORRELATIONID=4f0614e13db1b
[5] => BAID=B-9B302069LC631824C
)

You should store the BAID number associated with a specified user so you can bill them later using Reference Transactions.
 Example Reference Transaction with BAID
An example of a Reference Transaction using the BAID follows.

Reference Transaction API request
 
USER=xxxx
PWD=xxx
VENDOR=xxxx
PARTNER=PayPal
TENDER=P
TRXTYPE=S
ACTION=D
AMT=25.00
BAID=B-9B302069LC631824C

Note that the preceding request references the BAID from the response of the set of calls.

Reference Transaction API response
 
Array
(
[0] => RESULT=0
[1] => PNREF=E14P2EB5B7EC
[2] => RESPMSG=Approved
[3] => PPREF=3X3017474T589152S
[4] => CORRELATIONID=8b4fabed70e98
[5] => FEEAMT=1.03
[6] => BAID=B-9B302069LC631824C
[7] => PAYMENTTYPE=instant
[8] => PENDINGREASON=completed
)

Your Result is 0, and you get back your PayPal Reference Transaction ID (PPREF) and your Payflow Transaction ID (PNREF).

You can continue to use the BAID to make the Reference Transactions in the future. The BAID remains valid until canceled by the buyer or merchant.

See also:
Checkout for Payflow Guide
Was this article helpful?

More ways we can help

How are we doing?
Take our survey

We'll use cookies to improve and customise your experience if you continue to browse. Is it OK if we also use cookies to show you personalised ads? Learn more and manage your cookies