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​
- User enters phone number → Call Send OTP API
- If phone exists → Send OTP via SMS
- If phone doesn't exist → Show "Phone number not registered" error
- User enters OTP → Call Verify OTP API
- If OTP valid → Proceed to new PIN input
- If OTP invalid → Show error, allow retry
- User enters new PIN → Validate format and confirmation
- Call Change PIN API → Reset PIN to new value
- If change succeeds → Show success message
- If change fails → Show error message
This workflow provides a secure way to recover forgotten PINs through phone verification and OTP authentication.