---
page_title: PayPal
product: EC Headless
platform: Android
page_source: https://juspay.io/in/docs/ec-headless/android/additional-features/paypal
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/ec-headless/llms.txt
---


# PayPal Wallet




### Step 1.1. Substep


**Prerequisites** 

All prerequisites and authorization required for Paypal shall be completed by merchant.

* Account creation with Paypal
* Configure the merchant ID, Client ID and Secret Key provided by Paypal on Juspay Dashboard
* Get the latest SDK from Paypal

**Dependencies** 

Ensure that dependency is added for the Paypal SDK.

**User Experience for Paypal Link & Pay** 

* First time transaction:**** The user will be redirected to Paypal page on Chrome custom tab/ CCT. The user shall login into paypal account, add his/her credit or debit card , get redirected to the bank page and enter the OTP for payment completion.
* Recurring Transaction (Credit card linked):**** If the user has completed the login and added a credit card, the repeat transaction will directly debit the credit card. Login step and OTP step shall be skipped. Applicable only for transactions for amount less than Rs.2000
* Recurring Transaction (Debit card linked):**** If the user has completed the login and added a debit card, the repeat transaction will skip the login step. However users will have to enter the OTP in case of debit cards.




### Step 1.1. Key integration changes for integrating Paypal via Hyper SDK


**Step 1 - Customer context creation** 

[Create](https://docs.juspay.in/ec-headless/android/base-sdk-integration/createcustomer) or [Get](https://docs.juspay.in/ec-headless/android/base-sdk-integration/getcustomer) Customer on the Juspay Server. It is recommended to make this API call before opening the payment page.

**Step 2 - Order creation** 

[Create Order](https://docs.juspay.in/ec-headless/android/base-sdk-integration/create-order-api) on the Juspay Server. Kindly ensure that

* metadata.PAYPAL:direct_wallet_version:v2 is passed during order creation
* More Paypal specific metadata parameters to be passed during order creation.
* Customer ID to be passed during order creation

**Step 3 - Refresh wallet balances** 

Use the refreshWalletBalances call to get the list of wallets available for the user. The response shall provide information on:

* Whether Paypal wallet is already linked for the customer
* The direct wallet token obtained in the response shall be used in the walletTxn call.

**Step 4 - Initiate wallet transaction** 

Use walletTxn operation to initiate Paypal transaction. Please note to send the below three parameters for the walletTxn operation.

* paymentMethod :: PAYPAL
* shouldLink :: true (if the wallet needs to be linked)
* sdkPresent :: ANDROID_PAYPAL
* directWalletToken :: Required for recurring transactions
  
  > **Note**
  > Please refer to Wallet Txn - SDK flows for request payload corresponding to the required flow (Direct debit and First time linking)The request payload given here is for **Redirection flow**



## Sample Code Snippets:
### Sample Request:

#### PAYPAL Code Snippet:

```paypal
{
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "service": "in.juspay.hyperapi",
    "payload": {
        "action": "walletTxn",
        "orderId": "hyperorder45314",
        "paymentMethod": "PAYPAL",
        "sdkPresent": "ANDROID_PAYPAL",
        "clientAuthToken": "tkn_0e37edc631d647fdb606ab48ccfc4213"
    }
}
```

### Sample Response:

#### PAYPAL:
```json
{
    "service": "in.juspay.hyperapi",
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "payload": {
        "action": "walletTxn",
        "status": "CHARGED",
        "orderId": "hyperorder45314"
    },
    "errorMessage": "",
    "errorCode": "",
    "error": false
}
```



---

## See Also

- [User Payment Profile Management](https://juspay.io/in/docs/ec-headless/android/additional-features/user payment-profile-management)
- [NFC Card Reader](https://juspay.io/in/docs/ec-headless/android/additional-features/nfc-card-reader)
