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

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

You can use Recurring Billing with the Payflow API for 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 Checkout, you must set up the transaction.
  • In the PayPal API, use the SetExpressCheckout method.
  • In Payflow, use the "S" ACTION Request.

Note: You can't create 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 shown in the code sample, a return Token is appended 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 for recurring billings from your service, where Your Business Name is the business name on your PayPal account. When the user clicks Agree and Continue, 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 also 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 parse out the response 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 Checkout for Payflow Guide.
Was this article helpful?

More ways we can help

How are we doing?
Take our survey

If you accept cookies, we'll use them to improve and customise your experience and enable our partners to show you personalised PayPal ads when you visit other sites. Manage cookies and learn more