---
page_title: Link Wallet
product: API Reference
page_source: https://juspay.io/in/docs/api-reference/docs/express-checkout/link-wallet
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fapi-reference%2Fdocs%2Fexpress-checkout%2Flink-wallet
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/api-reference/llms.txt
---

## API Version: default


# Link Wallet



Completes the authentication and linking process of the wallet with the customer account. OTP received from the `authenticate` API call is forwarded to Juspay using this API for linking the wallet. On successful verification of the OTP, the wallet is linked with the customer object. If failed, then `linked` attribute will remain to be `false`.

Returns the wallet object. ## Endpoints:
- Sandbox: https://sandbox.juspay.in/wallets/{wallet_id}

- Production: https://api.juspay.in/wallets/{wallet_id}

## Request Type: 
POST

## Authorization:

#### Basic Auth:
Consists of two parts.

* Username: API Key obtained from Juspay dashboard
* Password: Empty string
- Value:     <p>Example:- <br> Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==</p>
- Tags: Base64 Encoded Username:Password, Mandatory
## Headers:

#### Content-Type:
application/x-www-form-urlencoded
- Tags: String, Mandatory

#### x-routing-id:
We recommend passing the customer_id as the x-routing-id. If the customer is checking out as a guest, you can pass an alternative ID that helps track the payment session lifecycle. For example, this could be an Order ID or Cart ID.

> **Warning**
> This ID is associated with the customer. It plays a key role in ensuring consistency and maintaining connections across different systems. If you fail to pass the same x-routing-id for the same customer in all related API calls, it could lead to issues with API functionality. Therefore, it’s crucial that you use the same x-routing-id for all requests tied to the same customer.


- Value: customer_1122
- Tags: String, Required
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl -X POST https://api.juspay.in/wallets/$wallet_id \
-u your_api_key: \
-H 'x-routing-id: customer_1122'\
-d "command=link"
-d "otp=345678"

```

### Sample Response:

#### Response:
```json
{
  "id": "wlt_q23xzki3pazgtezo",
  "object": "wallet_account",
  "wallet": "MOBIKWIK",
  "token": "tok_winysteev9eftrwcv6me",
  "current_balance": 250,
  "linked": true,
  "last_refreshed": "2016-08-01T08:07:52+0000"
}
```

#### Response - Wallet Linking Error:
```plaintext
{
  "error_message": "OTP is required while linking wallet.",
  "status": "Invalid Request",
  "error_code": "Invalid"
}

```

## Path Parameters:

#### wallet_id:
Wallet Id of the wallet
- Tags: String, Mandatory
## Body Parameters:
### Parameters:

#### command:
- Description: Send it as `link` if you want to complete the authentication/linking process.
- Tags: string, Required

#### otp:
- Description: OTP sent by the provider to the customer’s registered mobile number.
- Tags: string
## API Responses:
### 200:

#### id:
- Description: wlt_q23xzki3pazgtezo
- Tags: string

#### object:
- Description: wallet_account
- Tags: string

#### wallet:
- Description: MOBIKWIK
- Tags: string

#### token:
- Description: tok_winysteev9eftrwcv6me
- Tags: string

#### current_balance:
- Tags: integer

#### linked:
- Tags: boolean

#### last_refreshed:
- Description: 2016-08-01T08:07:52+0000
- Tags: string
### 400:

#### object:
- Description: {}
- Tags: object


---

## See Also

- [Authenticate](https://juspay.io/in/docs/api-reference/docs/express-checkout/authenticate)
- [Delink Wallet](https://juspay.io/in/docs/api-reference/docs/express-checkout/delink-wallet)
