Notice of non-liability:
PayPal, Inc. is providing the information i n this document t o you “AS-IS” with all faults. PayPal, Inc. makes no warranties of any kind (whether express,
implied or statutory) with respect to the information co ntained herein. PayPal, Inc. assumes no liability for damages (whether direct or indirect), caused
by errors or omissions, or resulting from the use of this document or the information contained in this document or resulting f rom the application or use
of the product or service described herein. PayPal, Inc. reserves the right to make changes to any information herein without further notice.
Setting Up Web Pages to Invoke the Embedded Payment Flow Using a Lightbox . . . 55
Setting Up Web Pages to Invoke the Embedded Payment Flow Using a Minibrowser . 57
Adaptive Payments is intended for developers implementing payment solutions with PayPal’s
Adaptive Payments API. Check out what’s new in the current release.
1.8.1 Features
Version 1.8.1 of the Adaptive Payments API adds a new new fields related to tax ID details for
Brazil (shown below). Also a new BANK_MANAGED_WITHDRAWAL value has been
added to the paymentType field.
NOTE: Changes to API operations are backward-compatible.
SenderIdentifier Fields
FieldDescription
useCredentialsxs:boolean
If true, credentials identify the sender; default is false.
taxIdDetailsap:TaxIdDetails
T ax ID details (For Brazil only)
TaxIdDetails Fields
FieldDescription
taxIdxs:string
Tax ID of the Merchant (For Brazil only)
taxIdTypexs:string
Type of the Tax ID. Either CPF or CNPJ (For Brazil only)
Adaptive Payments Developer GuideAugust 7, 201215
1.8.1 Features
16August 7, 2012Adaptive Payments Developer Guide
Introducing Adaptive Payments
1
The Adaptive Payments API enables you to send money in many different scenarios, from
simple to complex. For example, you might build a small send money application for a social
networking site or a robust payroll system.
Adaptive Payments Actors and Objects
Adaptive payments handles payments between a sender of a payment and one or more
receivers of the payment. You are an application owner, such as a merchant that owns a
website, the owner of a widget on a social networking site, the provider of a payment
application on mobile phones, and so on. Your application is the caller of Adaptive Payments
API operations.
NOTE:The application owner must have a PayPal Business account. Senders and
receivers can have any PayPal account type. Senders and receivers are not
required to have PayPal accounts initially. PayPal prompts a sender to create
an account before a payment can be completed. A receiver must create an
account to receive the funds after the payment completes.
With many applications, you may be both the application owner and a receiver. For example,
as the owner of a website, you are the receiver of payments from the senders who are your
customers. The following diagram shows the relationship between a sender, you as a receiver,
and PayPal:
Adaptive Payments Developer GuideAugust 7, 201217
Introducing Adaptive Payments
Adaptive Payments Actors and Objects
You are not required to be a receiver. For example, if you own a shopping cart, you are not
required to receive payments directly. You can facilitate payments between the sender and
receivers that provide the actual goods. The following diagram shows the relationship between
a sender, you as an application owner that directs payments to receivers, and PayPal:
This diagram shows a payment in which the sender pays multiple receivers in a parallel
payment. With parallel payments, the sender can see the transaction to each receiver.
The following diagram shows the relationship between a sender, you as an application owner
that directs payments to receivers, and PayPal in a chained payment:
In a chained payment, the sender pays the primary receiver an amount, from which the
primary receiver pays secondary receivers. The sender only knows about the primary receiver ,
not the secondary receivers. The secondary receivers only know about the primary receiver,
not the sender.
The following diagram shows the relationship between you as both the sender and the
application owner that directs payments to receivers:
18August 7, 2012Adaptive Payments Developer Guide
For example, you might use this configuration in a sales commission application that transfers
funds owed for commissions from your account to the accounts of your sales force.
Simple, Parallel, and Chained Payments
Introducing Adaptive Payments
Simple, Parallel, and Chained Payments
Adaptive Payments provides several kinds of payment: simple, parallel, and chained
payments. You create each kind of payment with the Pay API.
Simple payments enable a sender to send a single payment to a single receiver.
For example, your website can use an Adaptive Payments payment flow to transfer money
resulting from a sale from your customer’s PayPal account to your own account. This is the
traditional kind of payment.
Parallel payments enable a sender to send a single payment to multiple receivers.
For example, your application might be a shopping cart that enables a buyer to pay for
items from several merchants with one payment. Your shopping cart allocates the payment
to merchants that actually provided the items. PayPal then deducts money from the
sender’s account and deposits it in the receivers’ accounts.
Chained payments enable a sender to send a single payment to a primary receiver. The
primary receiver keeps part of the payment and pays secondary receivers the remainder.
For example, your application could be an online travel agency that handles bookings for
airfare, hotel reservations, and car rentals. The sender sees only you as the primary
receiver. You allocate the payment for your commission and the actual cost of services
provided by other receivers. PayPal then deducts money from the sender’s account and
deposits it in both your account and the secondary receivers’ accounts.
NOTE: Chained payments also include delayed chained payments, in which payments to
secondary receivers can be delayed for up to 90 days.
Adaptive Payments Developer GuideAugust 7, 201219
Introducing Adaptive Payments
Simple, Parallel, and Chained Payments
Simple Payments
Simple payments enable a sender to send a single payment to a single receiver. This is
sometimes considered a traditional payment, such as a payment from a buyer to a seller.
Scenarios involving simple payments might include the following scenarios:
Buyer makes a payment on a merchant’s website.
Buyer makes a single payment for a cart of items from the same merchant.
Person on a social networking site makes a payment for a purchase to the receiver. For
example, a sender sends money to pay for lunch at a restaurant.
In these cases, the sender sends a payment to a single receiver. The following example shows a
sender making a simple payment:
Parallel Payments
A parallel payment is a payment from a sender that is split directly among 2-6 receivers.
Technically, a parallel payment is a set of multiple payments made in a single Pay request.
Parallel payments are useful in cases when a buyer intends to make a single payment for items
from multiple sellers. Examples include the following scenarios:
a single payment for multiple items from different merchants, such as a combination of
items in your inventory and items that partners drop ship for you.
purchases of items related to an event, such as a trip that requires airfare, car rental, and a
hotel booking.
In these cases, the sender knows the receivers and the amount paid to each one. The following
example shows a sender paying 3 receivers in a single parallel payment:
20August 7, 2012Adaptive Payments Developer Guide
Introducing Adaptive Payments
Simple, Parallel, and Chained Payments
NOTE: This scenario is an example only and does not take PayPal fees into account.
Chained Payments
A chained payment is a payment from a sender that is indirectly split among multiple
receivers. It is an extension of a typical payment from a sender to a receiver, in which a
receiver, known as the primary receiver, passes part of the payment to other receivers, who are
called secondary receivers.
NOTE: The API caller must get permission from PayPal to use chained payments.
You can have at most one primary receiver and 1-5 secondary receivers. Chained payments are
useful in cases when the primary receiver acts as an agent for other receivers. The sender deals
only with the primary receiver and does not know about the secondary receivers, including
how a payment is split among receivers. The following example shows a sender making a
payment of $100:
Adaptive Payments Developer GuideAugust 7, 201221
Introducing Adaptive Payments
Payment Approval
In this example, the primary receiver receives $100 from the sender ’s perspective. The
primary receiver actually receives only $10 and passes a total of $90 to secondary receivers,
Receiver 2 and Receiver 3.
NOTE: This scenario is an example only and does not take PayPal fees into account.
Delayed Chained Payments
By default, payments to all receivers in a chained payment are immediate. However, you can
choose to delay a payment to a secondary receiver. For example, as primary receiver, you may
require secondary receivers to perform some action, such as shipping goods or waiting for
expiration of a return period, before making payment. To complete the payment, you must
explicitly execute a payment to secondary receivers after the sender pays you. The payment
must occur within 90 days, after which you cannot complete the payment as part of the
original chained payment.
Payment Approval
The sender of a payment must approve the transfer. The sender can log in to paypal.com to
approve each payment, preapprove payments, or when the sender is your application, be
implicitly approved to make payments.
NOTE: Preapproval requests require permission from PayPal.
There are 3 kinds of payment approvals:
Explicit approval payments, in which the sender logs in to paypal.com to approve each
payment.
Explicitly approving payments is the traditional way to pay with PayPal. This method is the
only option unless the sender has set up a preapproval agreement or you, the API caller, are
also the sender.
22August 7, 2012Adaptive Payments Developer Guide
Adaptive Payments Service Permissions
Preapproved payments, in which a sender logs in to PayPal and sets up preapprovals that
approve future payments or set up a preapproval during the embedded payment flow.
The sender logs in to paypal.com once to set up the preapproval. After the sender agrees to
the preapproval, specific approval is unnecessary.
Implicit approval payments, in which your application is both the sender of a payment and
the caller of the Adaptive Payments Pay API.
In this case, PayPal makes the payment from your own account, which eliminates the need
for approval.
Adaptive Payments Service Permissions
Adaptive Payments services are divided into 2 categories: standard services that do not require
specific permission to use and advanced services that require permission from PayPal to use.
You obtain permission to use a service when you submit an application to PayPal.
You can use the following standard services without requesting specific permission:
Introducing Adaptive Payments
Making simple or parallel payments that require explicit approval of the sender
Getting payment details
Making refunds
Performing currency conversions
To use any other service, you must receive permission from PayPal to use the service when
you submit your application. For example, if your application makes chained payments, whi ch
is an advanced service, you request permission when you submit your application. Later, if
you modify your application to support preapprovals, which is also an advanced service, you
must resubmit your application to obtain permission from PayPal to use the service.
IMPORTANT:If you allow a third party to PayPal to execute an application on your behalf,
the third party becomes the API caller because the party is now calling the
Adaptive Payments API. The third party must also have permission from
PayPal to use the advanced service. For example, if an application supports
chained payments, both you and the third party must have permission to use
the service.
Explicit Approval Payment Flow
Explicit approval payments require the sender to log in to paypal.com to approve the payment.
You control the interaction between your application and PayPal by specifying URLs for
redirection in various situations.
Adaptive Payments Developer GuideAugust 7, 201223
Introducing Adaptive Payments
Explicit Approval Payment Flow
The following diagram shows the basic flow of control for a payment (such as payment for
items in a shopping cart at a web store) that requires the sender to log in to paypal.com to
approve the payment:
The following items correspond to the circled numbers in the diagram:
1. Your site or device sends a Pay request to PayPal on behalf of a sender.
2. PayPal responds with a key that you use when you direct the sender to PayPal.
3. You redirect your sender’s browser to paypal.com.
4. After the sender authorizes the transfer of funds, PayPal redirects your sender’s browser to
the location you specify.
NOTE: The cancel operation is not shown in the diagram. Cancellation is handled by a
separate cancellation URL to which PayPal redirects the sender’s browser any time
the sender cancels while on paypal.com.
In addition to these steps, PayPal notifies you and the sender of the payment.
24August 7, 2012Adaptive Payments Developer Guide
Preapproved Payments Flow
Preapproved payments require the sender to log in to paypal.com to set up the payment
agreement with a particular vendor. You control the interaction between your application and
PayPal by specifying URLs for redirection in various situations.
The sender logs in to paypal.com and sets up the preapproval, which includes setting the
following information:
duration of the preapproval, from the start date to the end date, inclusive
the maximum amount being preapproved
the maximum number of payments
The following diagram shows the basic flow of control during a preapproval operation:
Introducing Adaptive Payments
Preapproved Payments Flow
The following items correspond to the circled numbers in the diagram:
1. Your site or device sends a Preapproval request to PayPal on behalf of a sender.
Adaptive Payments Developer GuideAugust 7, 201225
Introducing Adaptive Payments
Preapproved Payments Flow
2. PayPal responds with a key, called a preapproval key, that you use when you direct the
sender to PayPal, and once the preapproval has been established, whenever you
automatically complete a payment on behalf of the sender.
3. You redirect your sender’s browser to PayPal.
4. After the sender logs in to paypal.com and sets up the preapproval, PayPal redirects the
sender’s browser to a location you specify.
NOTE: The cancel operation is not shown in the above diagram. Cancellation is handled by a
separate cancellation URL to which PayPal redirects the sender’s browser any time
the sender cancels while on paypal.com.
In addition to the steps shown above, PayPal sends an email notifying you and the sender that
the preapproval has been created.
After the sender sets up the approval, you can make payments on the sender’s behalf directly.
The sender is no longer required to log in to PayPal to complete the payment. The following
diagram shows the basic flow of control during a Pay operation:
The following items correspond to the circled numbers in the diagram:
1. Your site or device sends a Pay request to PayPal on behalf of a sender. You can require the
sender to provide a personal identification number (PIN); however, logging in to
paypal.com is no longer required.
NOTE: You must provide a preapproval key that identifies the agreement.
2. PayPal still responds with a payment key that you can use for other API operations, such as
for obtaining details of the payment or for issuing a refund.
26August 7, 2012Adaptive Payments Developer Guide
Implicit Approval Payments Flow
Implicit approval payments are payments where the sender and the API caller are using the
same account. Because PayPal draws the funds for the payment from your own account, there
is no approval necessary, and as such there is no visible flow for implicit approval payments.
The following diagram shows the basic flow of control during an implicitly approved payment
operation:
Introducing Adaptive Payments
Implicit Approval Payments Flow
The following items correspond to the circled numbers in the diagram:
1. Your site or device sends a Pay request to PayPal.
NOTE: A web flow is not required.
2. PayPal responds with a key that you use for other API operations.
Embedded Payments
An embedded payment is a payment that initiates a visual presentation of the Adaptive
Payments payment flow in which the sender appears to never leave your checkout or payment
page. Embedded payments make it easier for a sender to make a payment because PayPal may
allow the sender to bypass the PayPal login step.
The ability to bypass the login relies on a remember me cookie, which is stored in the sender’s
browser when the sender chooses to take advantage of being remembered. Opting in reduces
the number of steps to purchase goods or services without significantly increasing the risk that
the sender’s account might be misused. After the initial login, PayPal bypasses the login step if
subsequent payments meet specific criteria, such as a subsequent payment for a small amount.
Adaptive Payments Developer GuideAugust 7, 201227
Introducing Adaptive Payments
Embedded Payments
Embedded Payment Flow Presentations
PayPal provides the following kinds of visual presentations for the embedded payment flow:
The payment flow can be embedded as a lightbox on your web page, which gives the
impression that the payment is handled completely within your website:
The payment flow can appear in a minibrowser window that appears in front of your web
page, which does not require an IFRAME:
28August 7, 2012Adaptive Payments Developer Guide
Introducing Adaptive Payments
Embedded Payments
The payment flow can be embedded as a lightbox in an IFRAME on your web page, which
gives the impression that the payment is handled completely within your website:
Adaptive Payments Developer GuideAugust 7, 201229
Introducing Adaptive Payments
Embedded Payments
You choose your preferred visual presentation when you invoke the embedded payment flow.
In some cases, PayPal may override your choice to use a lightbox; for example, when the
sender is required to log into PayPal for the initial payment.