How to Create a PayPal Account Using Adaptive Accounts
Important: Adaptive Accounts is no longer available for new integrations. PayPal provides this documentation to support existing integrations.
To enable a customer to create a new PayPal account with Adaptive Accounts:
- Set up the account.
- Redirect the customer for account creation.
For additional information about the subjects covered below, see the following:
- For API credentials and endpoints, see Apps 101.
- For Adaptive Accounts, see Introducing Adaptive Accounts.
Note: Please see Go Live with Your App regarding the review process for applications.
Step 1: Set Up the Account
To prompt a customer to create a new account, use the CreateAccount
call with the unique email address for the account. This email address is displayed to the customer during account-creation, and is used for future payments.
The date-of-birth value is optional in most countries; for the required and optional parameters, and their descriptions, see the CreateAccount API Operation.
The CreateAccount
response contains a redirectURL
field. In Step 2, you will redirect the customer to the URL in this field, so the customer can start the account-creation flow.
The following HTTP POST request includes cURL syntax.
HTTP Headers
------------
-H "X-PAYPAL-SECURITY-USERID: ⋘Caller-UID⋙" # UserID from the Caller account
-H "X-PAYPAL-SECURITY-PASSWORD: ⋘Caller-Pswd⋙" # Password from the Caller account
-H "X-PAYPAL-SECURITY-SIGNATURE: ⋘Caller-Sig⋙" # Signature from the Caller account
-H "X-PAYPAL-REQUEST-DATA-FORMAT: JSON"
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: JSON"
-H "X-PAYPAL-SANDBOX-EMAIL-ADDRESS: ⋘Caller-Sandbox-Email-Address⋙"
-H "X-PAYPAL-DEVICE-IPADDRESS: 192.0.2.0"
-H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" # Standard Sandbox App ID
Endpoint
--------
https://svcs.sandbox.paypal.com/AdaptiveAccounts/CreateAccount
Input Parameters
----------------
-d "{
"sandboxEmailAddress": "sender_per@example.com",
"accountType": "PERSONAL",
"name": {
"firstName": "Lenny",
"lastName": "Riceman"
},
"address": {
"line1": "123 Main St.",
"city": "Austin",
"state": "TX",
"postalCode": "78759",
"countryCode": "US"
},
"citizenshipCountryCode": "US",
"contactPhoneNumber": "512-555-5555",
"dateOfBirth": "1968-01-01Z",
"currencyCode": "USD",
"emailAddress": "lr12345@example.com",
"preferredLanguageCode": "en_US",
"registrationType": "Web",
"requestEnvelope": {
"errorLanguage": "en_US"
}
}"
Response
--------
{
"responseEnvelope": {
"timestamp": "2014-09-23T12:35:07.442-07:00",
"ack": "Success",
"correlationId": "73e9513e3812c",
"build": "12670835"
},
"createAccountKey": "AA-9GG80569J45735316",
"execStatus": "COMPLETED",
"redirectURL": "https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_hostedua-flow&encrypted_second_auth_code=⋘Code⋙&encrypted_id=⋘Id⋙",
"accountId": "RCAHW8QAUHZAW"
}
Step 2: Redirect the Customer for Account Creation
With the URL from the redirectURL
output field (from the CreateAccount
response in Step 1), redirect the customer to PayPal. If the account is brand new, the customer can start the account-creation flow, which includes setting up a password. In the case of an existing account, the customer is presented with a login page.
After the customer sets up a new account, you can use the account's email address (which you specified in the CreateAccount
request in Step 1) to initiate a payment.