Contact module
Last updated: Jan 14th, 2:27pm
Overview
The Contact Module helps buyers view and modify the contact information (email and phone number) shared with merchants for a given order. It offers greater flexibility and control to buyers, particularly for gift orders where buyers need to specify alternative contact details.
Key features
- Add contact information: Buyers can add new email addresses and phone numbers during checkout.
- Select existing contact information: Buyers can select from a list of previously added email addresses and phone numbers.
- Validation: Input validation ensures the provided email addresses and phone numbers follow appropriate formats.
- Merchant-provided data: If the merchant supplies contact information, the information is displayed but not editable during the transaction. The buyer can change contact information by returning to the merchant site.
- Profile contact integration: Shows the primary email and phone number from the buyer’s PayPal account by default.
- Localized support: Buyers from different countries can add and validate contact information according to regional standards.
Buyer benefits
- Personalization: Allows buyers to customize contact details for each transaction.
- Convenience: Buyers don’t need to update contact information outside the payment flow.
Merchant benefits
- Order fulfillment: Provides merchants with precise and complete contact details for seamless communication.
- Accuracy: Ensures merchants receive accurate and current contact information.
Buyer flows
Buyers can add or modify email addresses and phone numbers inside the PayPal checkout flow.
Add email
Select phone number
Collapsed view
In the collapsed view, the Contact Module shows the primary email and phone number from the buyer's profile. If the merchant does not provide information, the profile information is used by default.
Expanded view
When expanded, the Contact Module displays:
- In the collapsed view, the Contact Module shows the primary email and phone number from the buyer's profile. If the merchant does not provide information, the profile information is used by default.
- Options to add new email addresses or phone numbers.
- Inline validation for newly added contact information.
Attach buyer contact info
The Orders API provides contact information as part of the shipping
object in the purchase_units
field when an order is created.
Source buyer contact information from PayPal or the merchant site.
- Retrieve information if the PayPal button is on the cart or product page: Buyers begin PayPal checkout without entering information on the merchant site.
- Pass merchant information if the PayPal button appears after collecting information on the merchant site: Merchants can pass their information to pre-fill fields at PayPal checkout.
Use contact information from PayPal
When buyers check out with PayPal, merchants can call the Orders API to retrieve the contact information. This ensures that the merchant has access to the buyer's details as captured during PayPal checkout.
- Show order details request
- Response
1curl -v -X GET https://api-m.sandbox.paypal.com/v2/checkout/orders/ORDER-ID \2-H 'Authorization: Bearer ACCESS-TOKEN'
Use contact information from merchant site
Merchants may need to override the contact information captured by PayPal if the merchant collects the information. The merchant can include the buyer’s information in a create order request to ensure the information pre-fills in PayPal and overrides the PayPal-provided details.
- Create order with contact info request
- Response
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 "experience_context": {10 "shipping_preference": "SET_PROVIDED_ADDRESS",11 "user_action": "PAY_NOW",12 "return_url": "https://example.com/returnUrl",13 "cancel_url": "https://example.com/cancelUrl"14 }15 }16 },17 "purchase_units": [18 {19 "amount": {20 "currency_code": "USD",21 "value": "64.00"22 },23 "shipping": {24 "name": {25 "full_name": "Firstname Lastname"26 },27 "email_address": "payer@example.com",28 "phone_number": {29 "country_code": "1",30 "national_number": "5555555555"31 },32 "type": "SHIPPING",33 "address": {34 "address_line_1": "123 Main St.",35 "admin_area_2": "Anytown",36 "admin_area_1": "CA",37 "postal_code": "12345",38 "country_code": "US"39 }40 }41 }42 ]43}'
Merchants can include the email_address
and phone_number
fields within the shipping object to attach custom contact information.
Limitations
- Non-editable profile contact information: Profile-level email and phone numbers can't be edited during checkout.
- Non-editable merchant data: Contact information provided by merchants can’t be edited on the checkout page. Buyers can only edit contact info from the merchant’s website.
- Storage constraints: Buyers can add up to 100 unique email addresses or phone numbers.
- Transaction-specific updates: Updates made during checkout apply to the current transaction and don't affect profile-level information.