Pass a buyer identifier to streamline buyer login
Last updated: Jan 13th, 10:49am
You can pass a buyer’s email address as the buyer identifier to PayPal through the Create Order request. During one-time checkout, PayPal uses this email address to prefill the buyer's PayPal login page. This streamlines and quickens the buyer authentication process for an effortless login.
How it works
In your app, when you Create an order, as part of the request body, send the buyer’s email address in the payment_source.paypal.email_address
field. For more information, see Create Order API request.
1curl -v -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders \2-H 'Content-Type: application/json' \3-H 'PayPal-Request-Id: REQUEST-ID' \4-H 'Authorization: Bearer ACCESS-TOKEN' \5-d '{6 "intent": "CAPTURE",7 "payment_source": {8 "paypal": {9 "email_address": "customer@example.com",10 "experience_context": {11 "shipping_preference": "GET_FROM_FILE",12 "user_action": "PAY_NOW",13 "return_url": "https://example.com/returnUrl",14 "cancel_url": "https://example.com/cancelUrl"15 }16 }17 },18 "purchase_units": [19 {20 "invoice_id": "005384",21 "amount": {22 "currency_code": "USD",23 "value": "40.00"24 }25 }26 ]27}'
After a successful request, the passed email address is used to prepopulate the PayPal login page when the buyer pays with PayPal.