Skip to main content

Get User Profile

Retrieves the authenticated user’s profile information.

Headers

string
required
Bearer token for authentication

Response

string
Indicates if the request was successful
object
User profile information

Update Profile Picture

Uploads and updates the user’s profile picture. Uses multipart/form-data with multer middleware.

Headers

string
required
Bearer token for authentication
string
required
Must be multipart/form-data

Body Parameters

file
required
Image file for the profile picture. Uploaded using multer with diskStorage configuration. Files are temporarily stored in the uploads/ directory with a unique filename format: profilePic-{timestamp}-{random}.{ext}

Response

string
Success message
string
Public URL of the uploaded profile picture

Implementation Details

  • Multer storage configuration uses diskStorage with unique filename generation
  • Old profile picture is deleted from Devload storage before uploading new one
  • File is uploaded to Devload CDN and public URL is stored in database
  • Local temporary file is automatically cleaned up after upload
  • Updates both profilePic (URL) and profilefileid (storage reference) fields

Error Responses


Update Full Name

Updates the user’s full name.

Headers

string
required
Bearer token for authentication
string
required
Must be application/json

Body Parameters

string
required
New full name for the user

Response

boolean
Indicates if the update was successful

Error Responses


Initialize Email Verification Payment

Initiates a Razorpay payment order for email verification. Users must pay ₹99 to verify their email address.

Headers

string
required
Bearer token for authentication

Response

string
Razorpay order ID
number
Payment amount in paise (9900 = ₹99)
string
Currency code (INR)
string
Order receipt ID

Implementation Details

  • Creates a Razorpay order with amount ₹99 (9900 paise)
  • Customer details (email, name) are automatically included
  • Creates a VerifyuserPayment record with status pending
  • Order ID is stored for verification

Error Responses


Verify Email Verification Payment

Verifies the Razorpay payment signature and marks the user’s email as verified.

Headers

string
required
Bearer token for authentication
string
required
Must be application/json

Body Parameters

string
required
Payment ID from Razorpay checkout
string
required
Order ID from the init endpoint
string
required
HMAC signature from Razorpay for verification

Response

boolean
Indicates if verification was successful
boolean
Indicates if the user is now verified

Implementation Details

  • Verifies payment signature using HMAC-SHA256
  • Checks if order exists and matches user
  • Prevents duplicate verification (checks if status is already completed)
  • Updates user’s verified field to true
  • Sets verifiedAt timestamp
  • Updates order status to completed

Error Responses

The signature verification is critical for security. Never skip this step or accept unverified payments.