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


# Lazypay Paylater




### Step 1.1. Prerequisites


Please write to Lazypay account manager at Lazypay to get the Lazypay credentials. Just like any other payment method, Lazypay can be enabled directly by the merchant using the dashboard.

**Juspay Dashboard** 

Ensure that you are using the latest Juspay Express Checkout dashboard. Links below for reference

[Sandbox(Testing Environment)](https://dashboard.sandbox.juspay.in/)

[Production(Live Environment)](https://dashboard.expresscheckout.juspay.in/)




### Step 1.1. API Reference


**Create Customer** 

The merchant has to first call the create customer API from their server to create a customer at Juspay. Mobile number is mandatory for creating customer.

For specific details, please refer the documentation provided [here](https://docs.juspay.in/api-reference/docs/express-checkout/createcustomer).

**Get Customer** 

Get customer API will return all the customer-related information for previously added customers.

For specific details, please refer the documentation provided [here.](https://docs.juspay.in/api-reference/docs/express-checkout/getcustomer)

**Create Order** 

Create an order that is a representation of your shopping cart. The order contains important information like amount, customer details, shipping address, billing address, etc. Only after an order is created, payment can be started. 

For specific details, please refer the documentation provided [here.](https://docs.juspay.in/api-reference/docs/express-checkout/create-order-api)

**Check eligibility** 

Eligibility API is required to check if the user is eligible for using the respective wallet. Based on the response from Eligibility API, the merchant can show the wallet option in the UI. The operation checks the eligibility for the number present in the create customer API. Order id or amount is mandatory for eligibility check.

For specific details, please refer the documentation provided [here](https://docs.juspay.in/api-reference/docs/express-checkout/eligibility-api).


| Scenario | User experience handling |
|---|---|
| When the user has LazyPay account with the contact number provided, there is a success response | LazyPay should be shown on UI |
| When the user doesn’t have LazyPay account with the contact number provided, there is a failure response | Disable Lazypay option with appropriate user messaging |
|  When the user try to do a transaction with the amount more than credit limit | Disable LazyPay option with appropriate user messaging |


**Refresh wallet balances** 

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

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

For specific details, please refer the documentation provided [here.](https://docs.juspay.in/api-reference/docs/express-checkout/refresh-all-wallets)




### Step 1.1. SDK Calls


**Create Wallet** 

This is to be called when the response received in the eligibility call is Success. It will also authenticate the user and send the OTP to the mobile number that is passed during the create customer API call. the customer will receive the OTP which has to be passed while calling the link wallet API in the next step.

This can be a SDK call. Please find the Payload on the Payload section. 

**Link Wallet** 

The OTP that the customer has received needs to be passed while calling this API. The linked = True in the response field says that the wallet has been linked and the token has been generated which will be used to make the transaction.

This can be a SDK call. Please find the Payload on the Payload section. 

**Transaction initiation** 

1. If a wallet account is present, obtain the wallet direct debit token from the refreshWalletBalances call response and call the operation walletTxn. Refer code snippets on the right for reference.
2. First time users where the wallet account is not created at Juspay, there won’t be any wallets listed in refreshWalletBalances. Then call the transaction without the direct debit token. Refer code snippets on the right for reference.
   
   > **Note**
   > If the wallet account exists and the direct debit token is not passed then the transaction fails.
   
   
   
   The user will now be redirected to the SIMPL page where the user has to link the account by entering the OTP as shown below. Now the transaction would be Successful and redirects back to the merchant app.




### Step 1.1. Wallet Management


**Delink wallet** 

This is an optional feature. On your user’s payment profile page you may include this feature for your user to delink any linked wallet. Refer code snippets on the right for reference.



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

#### Order Create Req Code Snippet:

```order create req
curl --location --request POST 'https://sandbox.juspay.in/orders' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'version: 2020-02-17' \
--header 'Authorization: Basic apikeyvalue' \
--data-urlencode 'order_id=1676534303' \
--data-urlencode 'amount=10' \
--data-urlencode 'currency=INR' \
--data-urlencode 'customer_id=7760250078' \
--data-urlencode 'customer_email=aa@aa.com' \
--data-urlencode 'return_url=https://requestbin.juspay.net' \
--data-urlencode 'product_id=123' \
--data-urlencode 'quantity=1' \
--data-urlencode 'metadata.SIMPL:session_start_time=06/09/2022 12:12:12' \
--data-urlencode 'metadata.SIMPL:coupon_code=SIMPLPARTY' \
--data-urlencode 'metadata.SIMPL:additional_order_id=123456789ABC'' \
--data-urlencode 'metadata.SIMPL:discount=0' \
--data-urlencode 'metadata.SIMPL:initial_cart_value=200' \
--data-urlencode 'billing_address_line1=test' \
--data-urlencode 'billing_address_line2=test' \
--data-urlencode 'billing_address_city=test' \
--data-urlencode 'billing_address_state=test' \
--data-urlencode 'billing_address_country=India' \
--data-urlencode 'billing_address_postal_code=400095' \
--data-urlencode 'shipping_address_line1=Juspay' \
--data-urlencode 'shipping_address_line2=tech' \
--data-urlencode 'shipping_address_city=test' \
--data-urlencode 'shipping_address_state=Karnataka' \
--data-urlencode 'shipping_address_country=India' \
--data-urlencode 'shipping_address_postal_code=400095'

```

#### Create Wallet  Code Snippet:

```create wallet 
{"success":false,"message":"Failed to fetch snippet"}
```

#### Wallet Transaction with direct debit  Code Snippet:

```wallet transaction with direct debit 
{
  "requestId": "68579cc4-b585-48d4-a1c2-73030fecf78c",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "walletTxn",
    "orderId": "hyperorder45314",
    "paymentMethod": "LAZYPAY",
    "directWalletToken": "tkn_nvtQf8DP1A2oGoZu",
    "clientAuthToken": "tkn_0e37edc631d647fdb606ab48ccfc4213",
    "showLoader": true
  }
}

```

#### Link Wallet Request Code Snippet:

```link wallet request
{
  "requestId": "3a15a4bf-f576-49d8-866d-86c2d77a3823",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "linkWallet",
    "walletId": "wlt_a72g4HXTjcyzXcN5",
    "otp": "472243",
    "walletName": "LAZYPAY",
    "clientAuthToken": "tkn_0e37edc631d647fdb606ab48ccfc4213",
    "showLoader": true
  }
}

```

### Sample Response:

#### First time User Txn Response:
```plaintext
{
    "service": "in.juspay.hyperapi",
    "requestId": "87df247f-7b84-43a3-ac5d-1c5523dd26af",
    "payload": {
        "action": "walletTxn",
        "status": "CHARGED",
        "orderId": "hyperorder45314"
    },
    "errorMessage": "",
    "errorCode": "",
    "error": false
}

```

#### Create Wallet Response:
```plaintext
{"success":false,"message":"Failed to fetch snippet"}
```

#### Link Wallet Response:
```plaintext
{
  "wallet": "LAZYPAY",
  "token": "tkn_b22e0d11c62d49a982a418280c3e5708",
  "object": "wallet_account",
  "linked": true,
  "last_refreshed": null,
  "id": "wlt_a72g4HXTjcyzXcN5",
  "current_balance": null
}

```



---

## See Also

- [Tata Neu Wallet](https://juspay.io/in/docs/ec-headless/android/additional-features/tata-neu-wallet)
- [Safe 2.0](https://juspay.io/in/docs/ec-headless/android/additional-features/safe-20)
