Advanced Features Guide

Table Of Contents
Handling Recurring Payments
Recurring Payments With the Express Checkout API
3
50 April 2012 Express Checkout Advanced Features Guide
DoExpressCheckoutPayment request. If, however, you set the amount of the payment to 0
in the SetExpressCheckout request, you can create a billing agreement without initiating a
payment.
NOTE: To create a billing agreement without purchase, use Version 54.0 or higher, of the
PayPal API.
To set up one or more billing agreements for recurring payments, modify the
SetExpressCheckout request as follows:
1. Add an L_BILLINGTYPEn field for each billing agreement you want to create; n is a value
in the range of 0 to 9, inclusive. Set the value of each field to RecurringPayments.
L_BILLINGTYPE0=RecurringPayments
2. Add an L_BILLINGAGREEMENTDESCRIPTIONn field to correspond to each
L_BILLINGTYPEn field you pass; n is a value in the range of 0 to 9, inclusive. Set the
value of each field to the description of the goods or services associated with that billing
agreement, for example:
L_BILLINGAGREEMENTDESCRIPTION0=Time Magazine subscription
3. If there is no associated purchase, set PAYMENTREQUEST_0_AMT to 0.
PAYMENTREQUEST_0_AMT=0
4. (Optional) Set MAXAMT to the average expected transaction amount.
PayPal uses the value you pass to validate the buyer’s payment method for recurring
payments. If you do not specify a value, the default is 25.00.
The SetExpressCheckout response provides a token that uniquely identifies the transaction
for subsequent redirects and API calls.
Redirecting the Buyer to PayPal
After you receive a successful response from SetExpressCheckout, add the TOKEN from
the SetExpressCheckout response as a name/value pair to the following URL, and redirect
your buyer to it:
https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&
token=<value_returned_by_SetExpressCheckoutResponse>
When redirecting the buyer to PayPal, PayPal recommends that you use the HTTPS response
302 “Object Moved” with the URL as the value of the Location header in the HTTPS
response. Make sure that you use an SSL-enabled server to prevent browser warnings about a
mix of secure and insecure graphics.