Help Article

Ask our Business Community

Get started and join the conversation to use PayPal for business in the Headstart Community.

How do I set up Express Checkout with Recurring Billing in Payflow?

This article will help you use Recurring Billing with the Payflow API for Express Checkout. Using Recurring Billing with Payflow is much like Recurring Payments with the PayPal API; you're just passing different variables, but the logic itself is much the same.

First, as always when working with Express Checkout, you need to set up the transaction.
  • In the PayPal API, use the SetExpressCheckout method.
  • In Payflow, use the "S" ACTION Request.

Note: You can't create Express Checkout Recurring Billing Profiles within PayPal Manager.
 
"S" ACTION request
 
USER=MERCHANTLOGIN
PWD=PASSWORD
VENDOR=MERCHANTLOGIN
PARTNER=PayPal
TRXTYPE=S
TENDER=P
ACTION=S
AMT=10.00
CURRENCY=USD
RETURNURL=https://www.yoursite.com/return.php
CANCELURL=https://localhost
ORDERDESC=test order
BILLINGTYPE=RecurringBilling

"S" ACTION response
 
Array
(
[0] => RESULT=0
[1] => RESPMSG=Approved
[2] => TOKEN=EC-4X323426LW1559921
[3] => CORRELATIONID=c85296249209a
)

As you can see, you're returned a Token.

You then take that Token and append it to the PayPal URL:
https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=<Token>

Where <Token> is the value of the Token returned from the API call:
https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-4X323426LW1559921

At this point, the user is redirected and taken to PayPal.com, where they sign in to their account or create an account through our account creation flow.

Throughout checkout, the user sees a box reminding them that they're signing up to be recurringly billed from your service, where Your Business Name is the business name on your PayPal account.

The user then clicks Agree and Continue and they're sent to your RETURNURL as set in the "S" call:
RETURNURL=https://www.yoursite.com/return.php

When they return, your URL is then posted some data:
https://www.yoursite.com/return.php?token=EC-4X323426LW1559921&PayerID=5X4X6FQUMKFVA

You get back the Token and PayerID in the querystring.

You then invoke the "G" ACTION or GetExpressCheckoutDetails API call.
 
"G" ACTION request
 
USER=MERCHANTLOGIN
PWD=PASSWORD
VENDOR=MERCHANTLOGIN
PARTNER=PayPal
TRXTYPE=S
TENDER=P
ACTION=G
TOKEN=EC-4X323426LW1559921

"G" ACTION response
 
Array
(
[0] => RESULT=0
[1] => RESPMSG=Approved
[2] => AVSADDR=Y
[3] => AVSZIP=Y
[4] => TOKEN=EC-4X323426LW1559921
[5] => PAYERID=5X4X6FQUMKFVA
[6] => CORRELATIONID=366aff557d376
[7] => EMAIL=customer@domain.com
[8] => PAYERSTATUS=verified
[9] => PHONENUM=408-983-5678
[10] => FIRSTNAME=Nate
[11] => LASTNAME=Tester
[12] => SHIPTOBUSINESS=Nate's Test Acct
[13] => SHIPTOSTREET=1 Main St
[14] => SHIPTOCITY=San Jose
[15] => SHIPTOSTATE=CA
[16] => SHIPTOZIP=95131
[17] => SHIPTOCOUNTRY=US
[18] => SHIPTONAME=Nate's Test Acct
[19] => COUNTRYCODE=US
[20] => ADDRESSSTATUS=Y
)

You then parse out that information and display it to the user.

They click Confirm and you make the "D" ACTION call or DoExpressCheckoutPayment call:
 
"D" ACTION request
 
USER=MERCHANTLOGIN
PWD=PASSWORD
VENDOR=MERCHANTLOGIN
PARTNER=PayPal
TRXTYPE=S
TENDER=P
ACTION=D
TOKEN=EC-4X323426LW1559921
PAYERID=5X4X6FQUMKFVA
AMT=10.00
CURRENCY=USD
ORDERDESC=test order

"D" ACTION response
 
Array
(
[0] => RESULT=0
[1] => PNREF=E34P0A4153B8
[2] => RESPMSG=Approved
[3] => AVSADDR=Y
[4] => AVSZIP=Y
[5] => TOKEN=EC-4X323426LW1559921
[6] => PAYERID=5X4X6FQUMKFVA
[7] => PPREF=0BM04086WX4520323
[8] => CORRELATIONID=1b39c472948c5
[9] => FEEAMT=0.59
[10] => BAID=B-0LT60093PA8952305
[11] => PAYMENTTYPE=instant
[12] => PENDINGREASON=completed
)

In the API response for the "D" ACTION, you get a BAID, which you'll need to use to create the Recurring Billing Profile call.

To create the Recurring Billing Profile, you use an "A" ACTION to Add a Recurring Billing Profile. Use a TRXTYPE of R to specify "Recurring," and you'll pass the BAID as the Reference Point for the TENDER of P for "PayPal."
 
"A" ACTION request
 
USER=MERCHANTLOGIN
PWD=PASSWORD
VENDOR=MERCHANTLOGIN
PARTNER=PayPal
ACTION=A
TENDER=P
TRXTYPE=R
PROFILENAME=UserProfile
BAID=B-0LT60093PA8952305
AMT=1.00
START=03112011
TERM=0
PAYPERIOD=MONT
MAXFAILEDPAYMENTS=0
RETRYNUMDAYS=5
EMAIL=customer@domain.com
DESC=RecurringProfile
COMPANYNAME=CustomerCompany

"A" ACTION response
 
Array
(
[0] => RESULT=0
[1] => RPREF=R2550A40FC1D
[2] => PROFILEID=RT0000000006
[3] => RESPMSG=Approved
)

The PROFILEID is the PROFILE ID that you see in your https://manager.paypal.com account.

For more information, consult the Express Checkout for Payflow Guide.
We’re sorry, the page you’re looking for is no longer available. Please try your search again in our Help Center if you have a question or want to contact us.