> ## Documentation Index
> Fetch the complete documentation index at: https://docs.learnway.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Wallet PIN

> Set, verify, and reset security PINs for on-chain transactions and off-ramp operations.

# Wallet PIN

To safeguard sensitive on-chain interactions (such as reward claiming, off-ramping, or token transfers), users must configure a 4-to-6-digit security PIN.

***

## Set Wallet PIN

Sets an initial security PIN on the user's account.

### Endpoint

```http theme={null}
POST /api/v2/auth/set-wallet-pin
```

### Headers

```http theme={null}
Authorization: Bearer <jwt_access_token>
```

### Request Body

| Field | Type     | Required | Description              |
| :---- | :------- | :------- | :----------------------- |
| `pin` | `string` | **Yes**  | 4-6 digit numeric string |

```json theme={null}
{
  "pin": "1234"
}
```

### Response (200 OK)

```json theme={null}
{
  "success": true,
  "message": "Wallet PIN set successfully"
}
```

***

## Verify Wallet PIN

Verifies the user's entered PIN before initiating a secure transaction.

### Endpoint

```http theme={null}
POST /api/v2/auth/verify-wallet-pin
```

### Headers

```http theme={null}
Authorization: Bearer <jwt_access_token>
```

### Request Body

| Field | Type     | Required | Description                 |
| :---- | :------- | :------- | :-------------------------- |
| `pin` | `string` | **Yes**  | User's numeric security PIN |

```json theme={null}
{
  "pin": "1234"
}
```

### Response (200 OK)

```json theme={null}
{
  "success": true,
  "data": {
    "verified": true,
    "pinToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  },
  "message": "Wallet PIN verified"
}
```

***

## Reset Wallet PIN

Allows requesting and confirming a PIN reset via email OTP verification.

### Endpoints

1. `POST /api/v2/auth/reset-wallet-pin-otp` – Sends PIN reset OTP to user email.
2. `POST /api/v2/auth/verify-wallet-pin-reset-otp` – Verifies OTP and sets new PIN.

```json theme={null}
{
  "otpCode": "492019",
  "newPin": "5678"
}
```
