Skip to main content

Forgot PIN Flow

📋 Overview​

Complete workflow for recovering a forgotten login PIN through phone number verification, OTP authentication, and PIN reset process.

🔄 Workflow Steps​

Step 1: Phone Number Verification​

  • User enters their registered phone number
  • System calls the Send OTP API to verify the phone number
  • OTP is sent to the user's phone via SMS
  • If phone number doesn't exist, show error message

Step 2: OTP Verification​

  • User receives OTP on their phone
  • User enters the OTP code in the application
  • System calls the Verify OTP API to validate the OTP
  • If OTP verification is successful, proceed to PIN reset
  • If OTP verification fails, show error message and allow retry

Step 3: New PIN Input​

  • After successful OTP verification, user enters new PIN
  • User confirms the new PIN by entering it again
  • Frontend validates that both PINs match and meet format requirements

Step 4: PIN Reset​

  • Once new PIN is confirmed, system calls the Change PIN API
  • Include the new PIN in the request body
  • Use the authentication from OTP verification

📡 API References​

Step 1: Send OTP​

  • API: Send OTP API
  • Purpose: Verify phone number and send OTP for authentication
  • OTP Type: FORGOT LOGIN PIN

Step 2: Verify OTP​

  • API: Verify OTP API
  • Purpose: Validate the OTP code sent to user's phone
  • Returns: Authentication confirmation on successful verification

Step 3: Change PIN​

  • API: Change Login PIN API
  • Purpose: Reset the user's PIN to a new value
  • Authentication: Uses verification from OTP step

Note: For complete API details, request/response formats, and error codes, please refer to the individual API documentation pages linked above.

🔄 Flow Logic​

  1. User enters phone number → Call Send OTP API
  2. If phone exists → Send OTP via SMS
  3. If phone doesn't exist → Show "Phone number not registered" error
  4. User enters OTP → Call Verify OTP API
  5. If OTP valid → Proceed to new PIN input
  6. If OTP invalid → Show error, allow retry
  7. User enters new PIN → Validate format and confirmation
  8. Call Change PIN API → Reset PIN to new value
  9. If change succeeds → Show success message
  10. If change fails → Show error message

This workflow provides a secure way to recover forgotten PINs through phone verification and OTP authentication.