Advanced Features Guide

Table Of Contents
Reference Transactions
Initiating a Payment Using a Reference Transaction
4
60 April 2012 Express Checkout Advanced Features Guide
1. Call SetExpressCheckout and pass a BillingAgreementDetails element that
contains the following information:
A billing type. PayPal recommends that you use
MerchantInitiatedBillingSingleAgreement if you need only one billing
agreement between you and the buyer. Use MerchantInitiatedBilling to create a
billing agreement between you and the buyer each time you call
DoExpressCheckoutPayment.
A description of the goods or services associated with the agreement.
Optionally, the kind of PayPal payment you require.
Optionally, a string that you can use for any purpose.
2. PayPal returns a token, which you use in the subsequent steps.
3. Redirect the buyers browser to PayPal, which allows the buyer to log in or set up an
account to pay for the purchase. PayPal presents the buyer with a confirmation page.
4. PayPal redirects the buyers browser to your return page.
5. Call GetExpressCheckoutDetails to obtain information about the buyer and the
buyers checkout status. PayPal returns checkout details.
6. Call DoExpressCheckoutPayment to initiate the purchase.
7. If the buyer accepts the billing agreement, PayPal returns information about the purchase
and a billing agreement ID. Save the ID for reference transactions or recurring payments.
To obtain a billing agreement ID without also initiating a purchase, modify the previous
procedure as follows:
In step 1, specify 0 for the amount of purchase in the payment details.
(Optional) Set MAXAMT to the expected average transaction amount (default is 25.00).
PayPal uses the value to validate the buyers payment method for future payments.
Skip step 5.
In step 6, call CreateBillingAgreement instead of DoExpressCheckoutPayment.
If you offer a store account, you can control whether PayPal creates the billing agreement
based on buyer signup. To skip the creation of a billing agreement ID if the buyer does not sign
up, set SKIPBACREATION to true in the call to DoExpressCheckout.
The numbered steps correspond to the circled numbers. Your site must take the specified
actions at each step, as follows:
Initiating a Payment Using a Reference Transaction
After you establish a billing agreement, you can initiate a payment, which withdraws funds
from the buyers PayPal account without manual intervention. Call
DoReferenceTransaction to use a reference transaction.