Table of Contents Previous Next Index

Recurring Payments

Recurring Payments
Overview
PayPal Recurring Payments allows you to bill a buyer for a fixed amount of money on a fixed schedule. The buyer signs up for recurring payments during checkout from your site. Consider the following examples:
l
l
These examples represent payment transactions that reoccur periodically and are for a fixed amount.
IMPORTANT:
To use the recurring payments features described in this chapter, you must set the version parameter to at least 50.0 in your NVP or SOAP API calls.
How Recurring Payments Work
When you create recurring payments for a buyer, you create a recurring payments profile. The profile contains information about the recurring payments, including details for an optional trial period and a regular payment period. Each of these subscription periods contains information about the payment frequency and payment amounts, including shipping and tax, if applicable.
After a profile is created, PayPal automatically queues payments based on the billing start date, billing frequency, and billing amount, until the profile expires or is canceled by the merchant. The buyer can also cancel the recurring payment profile.
Note that the queued payments are funded using the normal funding source hierarchy within the buyer’s PayPal account.
After the recurring payments profile is created, you can view recurring payments details or cancel the recurring payments profile from your PayPal account.You can also access recurring payments reports from the PayPal Business Overview page.
Also, after creating a recurring payments profile, you can use the Recurring Payments API to do the following:
l
l
l
l
Limitations
The current release of the Recurring Payments API has the following limitations:
l
l
Recurring payments with Express Checkout also has the following limitations:
l
l
Recurring Payments Terms
Table 4.1 lists commonly used terms related to recurring payments.
Your record of a recurring transaction for a single customer. The profile includes all information required to automatically bill the buyer a fixed amount of money at a fixed interval.
For example, if the billing period is Month and the billing frequency is 2, the billing cycle will be two months. If the billing period is Week and the billing frequency is 6, the payments will be scheduled every 6 weeks.
The main subscription period for this profile, which defines a payment amount for each billing cycle. The regular payment period begins after the trial period, if a trial period is specified for the profile.
An optional subscription period before the regular payment period begins. A trial period may not have the same billing cycles and payment amounts as the regular payment period.
Recurring Payments With Express Checkout
Overview
During the Express Checkout flow, you can create one or more recurring payments. You can also mix recurring payments with other purchases in the same Express Checkout flow.
Creating Recurring Payments
The following diagram illustrates the typical processing flow to create recurring payments during checkout. The numbered steps in the figure are detailed in Table 4.2.
Figure 4.1
Recurring Payments Processing Flow
Table 4.2 details the steps shown in Figure 4.1, “Recurring Payments with Express Checkout API Flow.”
Calls SetExpressCheckout with one or more billing agreement details in the request
https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout
&token=<token returned by SetExpressCheckout>
Redirects buyer’s browser to returnURL passed to SetExpressCheckout if buyer agrees to payment description.
Calls GetExpressCheckoutDetails to get buyer information (optional).
Returns GetExpressCheckoutDetails response.
Calls DoExpressCheckoutPayment if the order includes one-time purchases as well as a recurring payment. Otherwise, skip this step.
Returns DoExpressCheckoutPayment response
Calls CreateRecurringPaymentsProfile one time for each recurring payment item included in the order.
Returns ProfileID in CreateRecurringPaymentsProfile response for each profile successfully created.
Initiating the Processing Flow With SetExpressCheckout
As in the Express Checkout flow, the SetExpressCheckout request notifies PayPal that you are initiating an order that can be either a one-time purchase, up to ten recurring payments, or a mixture of a one-time purchase and recurring payments.
Note:
You can also initiate the processing flow using SetCustomerBillingAgreement for orders that contain only a single recurring payment.
To include one or more recurring payments in the SetExpressCheckout request, you must set the following fields:
For recurring payments, this field must be RecurringPayments.
L_BILLINGAGREEMENT
DESCRIPTIONn
Description of goods or services associated with the billing agreement.
Note:
You must include these same values as part of the CreateRecurringPaymentsProfile request.
The SetExpressCheckout response provides a token that uniquely identifies the transaction for subsequent redirects and API calls.
Redirecting the Buyer’s Browser 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’s browser to it:
https://www.paypal.com/cgi‑bin/webscr?cmd=_express_checkout&
token=<value_from_SetExpressCheckoutResponse>
For redirecting the buyer’s browser to the PayPal login page, PayPal recommends that you use the HTTPS response 302 “Object Moved” with the URL above as the value of the Location header in the HTTPS response. Ensure that you use an SSL-enabled server to prevent browser warnings about a mix of secure and insecure graphics.
Getting Buyer Details Using GetExpressCheckoutDetails
The GetExpressCheckoutDetails method returns information about the buyer, including name and email address stored on PayPal. You can optionally call this API after PayPal redirects the buyer’s browser to the ReturnURL you specified in the SetExpressCheckout request.
The GetExpressCheckoutDetails request has one required parameter, TOKEN, which is the value returned in the SetExpressCheckout response.
Creating the Profiles With CreateRecurringPaymentsProfile
After your buyer has agreed to the recurring payments billing agreement on your confirmation page, you must call CreateRecurringPaymentsProfile to create the profile. If you are creating multiple recurring payments profiles, you must call CreateRecurringPaymentsProfile once for each profile to be created.
If the transaction includes a mixture of a one-time purchase and recurring payments profiles, call DoExpressCheckoutPayment to complete the one-time purchase transaction, and then call CreateRecurringPaymentsProfile for each recurring payment profile to be created.
IMPORTANT:
The recurring payments profile is not created until you receive a success response from the CreateRecurringPaymentsProfile call.
The CreateRecurringPaymentsProfile response contains a Profile ID, which is an encoded string that uniquely identifies the recurring payments profile.
For more options when creating a recurring payments profile, see “Options for Creating a Recurring Payments Profile”.
Options for Creating a Recurring Payments Profile
This section describes many of the different options that you have when you create a recurring payments profile.
l
l
l
l
Specifying the Regular Payment Period
Each recurring payments profile has a regular payment period that defines the amount and frequency of the payment. Table 4.4 lists the required fields for specifying the regular payment period.
RecurringPaymentsProfileDetails.
BillingStartDate
ScheduleDetails.
PaymentPeriod.
BillingPeriod
l
l
l
l
ScheduleDetails.
PaymentPeriod.
BillingFrequency
Note:
The combination of billing frequency and billing period must be less than or equal to one year.
Note:
If the billing period is SemiMonth., the billing frequency must be 1.
ScheduleDetails.
PaymentPeriod.
Amount
You can optionally include a value for TOTALBILLINGCYCLES (SOAP field ScheduleDetails.PaymentPeriod.TotalBillingCycles), which specifies the total number of billing cycles in the regular payment period. If no value is specified or if the value is 0, the payments continue until the profile is canceled or suspended. If the value is greater than 0, the regular payment period will continue for the specified number of billing cycles.
You can also specify an optional shipping amount or tax amount for the regular payment period.
Including an Optional Trial Period
You can optionally include a trial period in the profile by specifying the following fields in the CreateRecurringPaymentsProfile request. Table 4.5 lists the required fields for creating an optional trial period.
Specifying an Initial Payment
You can optionally specify an initial non-recurring payment when the recurring payments profile is created by including the following fields in the CreateRecurringPaymentsProfile request:
By default, PayPal will not activate the profile if the initial payment amount fails. You can override this default behavior by setting the FAILEDINITAMTACTION field to ContinueOnFailure, which indicates that if the initial payment amount fails, PayPal should add the failed payment amount to the outstanding balance due on this recurring payment profile.
If this field is not set or is set to CancelOnFailure, PayPal will create the recurring payment profile, but will place it into a pending status until the initial payment is completed. If the initial payment clears, PayPal will notify you by IPN that the pending profile has been activated. If the payment fails, PayPal will notify you by IPN that the pending profile has been canceled.
The buyer will receive an email stating that the initial payment cleared or that the pending profile has been canceled.
Other Profile Options
Maximum Number of Failed Payments
By including the MAXFAILEDPAYMENTS field in the CreateRecurringPaymentsProfile request, you set the number of failed payments allowed before the profile is automatically suspended. You receive an IPN message when the number of failed payments reaches the maximum number specified.
Billing the Outstanding Amount
If a payment fails due to any reason, the amount that was to be billed (including shipping and tax, if applicable) is added to the profile’s outstanding balance. Use the AUTOBILLOUTAMT field in the CreateRecurringPaymentsProfile request to specify whether or not the outstanding amount should be added to the payment amount for the next billing cycle.
Whether or not you choose to include the outstanding amount with the payment for the next billing cycle, you can also use the BillOutstandingAmount API to programmatically collect that amount at any time (see “Billing the Outstanding Amount of a Profile”).
Recurring Payments Profile Status
A recurring payments profile can have one of the following status values:
l
l
l
l
l
If the profile is successfully created, it has an ActiveProfile status. However, as described in “Specifying an Initial Payment”, if a non-recurring initial payment fails and FAILEDINITAMTACTION is set to CancelOnFailure in the CreateRecurringPaymentsProfile request, the profile is created with a status of PendingProfile until the initial payment either completes successfully or fails.
A profile has a status of ExpiredProfile when both the total billing cycles for both the optional trial period and the regular payment period have been completed.
You can suspend or cancel a profile by using the ManageRecurringPaymentsProfileStatus API. You can also reactivate a suspended profile.
For recurring payments profiles created with Express Checkout, the buyer receives an email about the change in status of their recurring payment.
Getting Recurring Payments Profile Information
Use the GetRecurringPaymentsProfileDetails API to get information about a profile. Along with the information that you specified in the CreateRecurringPaymentsProfile request, GetRecurringPaymentsProfileDetails also returns the following summary information about the profile:
l
l
l
l
l
l
l
l
l
l
l
 
Modifying a Recurring Payments Profile
Use the UpdateRecurringPaymentsProfile API to modify a recurring payments profile.
Note:
You can only modify specific information about the profile, including the following:
l
l
l
l
l
l
l
Note:
Note:
For recurring payments with Express Checkout, certain updates, such as billing amount, are not allowed within 3 days of the scheduled billing date, and an error is returned.
For complete details, see the Name-Value Pair Developer Guide and Reference or the SOAP API Reference.
Updating Addresses
When you update the subscriber shipping address, you must enter all of address fields, not just those that are changing:
For example, if you want to update the subscriber’s street address, you must specify all of the address fields listed in the Name-Value Pair Developer Guide and Reference or SOAP API Reference, not just the field for the street address.
Updating the Billing Amount
For profiles created using Express Checkout, the total amount of a recurring payment can only be increased 20% in a fixed 180-day interval after the profile is created. The 20% maximum is based on the total amount of the profile at the beginning of the 180-day interval, including any shipping or tax amount.
For example, if a profile is created on March 10 with a total amount of $100, then during the 180-day interval from March 10 to September 6, you can increase the payment amount to a maximum of $120 (120% of $100).
Suppose that during the first 180-day interval, you increased the payment amount to $110. Then during the next 180-day interval (starting on September 7 in this example), you can only increase the amount of the payment to a maximum of $132 (120% of $110).
Billing the Outstanding Amount of a Profile
Use the BillOutstandingAmount API to immediately bill the buyer for the current past due or outstanding amount for a recurring payments profile. To bill the outstanding amount:
l
l
l
l
The BillOutstandingAmount call cannot be within 24 hours of a regularly scheduled payment for this profile.
Note:
You will be informed by IPN about the success or failure of the outstanding payment. For profiles created using Express Checkout, the buyer will receive an email notification of the payment.
PayPal Notifications
Merchants are notified of certain events through IPN. For recurring payments profiles created using Express Checkout, buyers are also notified of specific events by email. Table 4.7 indicates when IPN or emails are generated.
Note:
API transactions such as ManangeRecurringPaymentsProfileStatus do not trigger IPN notification because the success or failure of the call is immediately provided by the API response.
 
Buyer Email