Get User Profile
curl -X GET "https://api.example.com/api/user/profile" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
Retrieves complete user profile information including personal details, wallet balances, reward points, and order statistics.
Bearer token for authentication
Query Parameters
Platform identifier (e.g., ‘web’, ‘mobile’)
Response
Unique identifier for the user
User’s date of birth (format: YYYY-MM-DD)
Available cashback balance (rounded to 2 decimals)
Available TSS Money balance (rounded to 2 decimals)
Available TSS Points balance (rounded to 2 decimals)
Amount of TSS Money expiring next
Expiry date for next TSS Money (null if none expiring)
Amount of TSS Points expiring next
Expiry date for next TSS Points (null if none expiring)
Total number of orders placed by user
Total amount spent by user
Number of successfully completed orders
Whether birthdate editing is disabled
Whether user has set a password (1 = yes, 0 = no)
Whether two-factor authentication is enabled
{
"user_id": 12345,
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"telephone": "9876543210",
"gender": "male",
"birthdate": "1990-05-15",
"cashback": 150.50,
"tss_money": 500.00,
"tss_points": 1250.00,
"next_Tss_Money_To_Expire": 100.00,
"tss_money_expiry": "2026-04-30",
"next_Tss_Point_To_Expire": 250.00,
"tss_point_expiry": "2026-05-15",
"order_count": 25,
"total_spending": 45000.00,
"successful_orders": 23,
"disable_birthdate": false,
"has_password": 1,
"is_two_fa": 1,
"referal_code": "JOHN2024"
}
Update User Profile
curl -X POST "https://api.example.com/api/user/profile" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"firstname": "John",
"lastname": "Doe",
"gender": "male",
"birthdate": "1990-05-15",
"telephone": "9876543210"
}'
Updates user profile information. Changing phone number requires OTP verification if two-factor authentication is enabled.
Bearer token for authentication
Body Parameters
User’s first name (will be sanitized)
User’s last name (will be sanitized)
User’s date of birth (YYYY-MM-DD format, use ‘0000-00-00’ to skip)
User’s phone number (must be unique)
User’s email (only updatable if no email exists or temporary email)
Response
Returns updated user profile object with same fields as GET request.
{
"user_id": 12345,
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"telephone": "9876543210",
"gender": "male",
"birthdate": "1990-05-15",
"cashback": 150.50,
"tss_money": 500.00,
"tss_points": 1250.00
}
Update Profile with Two-Factor Authentication
curl -X POST "https://api.example.com/api/user/profile/2fa" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"firstname": "John",
"lastname": "Doe",
"gender": "male",
"birthdate": "1990-05-15",
"telephone": "9876543210",
"is_two_fa": true
}'
Updates user profile with two-factor authentication support. Sends OTP when phone number or 2FA status changes.
Body Parameters
User’s date of birth (YYYY-MM-DD)
Enable or disable two-factor authentication
Response
Whether OTP was sent (true if phone/2FA changed)
Whether birthdate editing is disabled
Whether profile was updated without OTP
Number of valid active tokens
{
"telephone": "9876543210",
"is_otp_sent": true,
"message": "OTP Sent successfully!",
"disable_birthdate": false
}
Verify Two-Factor OTP (Profile)
curl -X POST "https://api.example.com/api/user/profile/verify-otp" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"telephone": "9876543210",
"otp": "123456"
}'
Verifies OTP sent during profile update and completes the update process.
Body Parameters
Phone number where OTP was sent
One-time password received
Response
Returns updated user profile with new access token if phone number changed.
Number of valid active sessions
{
"user_id": 12345,
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"telephone": "9876543210",
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"valid_token_count": 2,
"is_two_fa": 1
}
Change Password
curl -X POST "https://api.example.com/api/user/change-password" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"old_password": "OldPassword123",
"password": "NewPassword456"
}'
Changes user password. Validates old password before updating. Logs out user from all other devices except current.
Body Parameters
Current password for verification
Response
{
"msg": "Password Updated"
}