Skip to main content

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.

Headers

Authorization
string
required
Bearer token for authentication

Query Parameters

platform
string
Platform identifier (e.g., ‘web’, ‘mobile’)

Response

user_id
integer
Unique identifier for the user
firstname
string
User’s first name
lastname
string
User’s last name
email
string
User’s email address
telephone
string
User’s phone number
gender
string
User’s gender
birthdate
string
User’s date of birth (format: YYYY-MM-DD)
cashback
number
Available cashback balance (rounded to 2 decimals)
tss_money
number
Available TSS Money balance (rounded to 2 decimals)
tss_points
number
Available TSS Points balance (rounded to 2 decimals)
next_Tss_Money_To_Expire
number
Amount of TSS Money expiring next
tss_money_expiry
string
Expiry date for next TSS Money (null if none expiring)
next_Tss_Point_To_Expire
number
Amount of TSS Points expiring next
tss_point_expiry
string
Expiry date for next TSS Points (null if none expiring)
order_count
integer
Total number of orders placed by user
total_spending
number
Total amount spent by user
successful_orders
integer
Number of successfully completed orders
disable_birthdate
boolean
Whether birthdate editing is disabled
has_password
integer
Whether user has set a password (1 = yes, 0 = no)
is_two_fa
integer
Whether two-factor authentication is enabled
referal_code
string
User’s referral code
{
  "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.

Headers

Authorization
string
required
Bearer token for authentication

Body Parameters

firstname
string
required
User’s first name (will be sanitized)
lastname
string
required
User’s last name (will be sanitized)
gender
string
required
User’s gender
birthdate
string
required
User’s date of birth (YYYY-MM-DD format, use ‘0000-00-00’ to skip)
telephone
string
required
User’s phone number (must be unique)
email
string
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

firstname
string
required
User’s first name
lastname
string
required
User’s last name
gender
string
required
User’s gender
birthdate
string
required
User’s date of birth (YYYY-MM-DD)
telephone
string
required
User’s phone number
is_two_fa
boolean
required
Enable or disable two-factor authentication
email
string
User’s email address

Response

telephone
string
Updated phone number
is_otp_sent
boolean
Whether OTP was sent (true if phone/2FA changed)
message
string
Status message
disable_birthdate
boolean
Whether birthdate editing is disabled
is_profile_updated
boolean
Whether profile was updated without OTP
valid_token_count
integer
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

telephone
string
required
Phone number where OTP was sent
otp
string
required
One-time password received

Response

Returns updated user profile with new access token if phone number changed.
access_token
string
New JWT access token
valid_token_count
integer
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

old_password
string
required
Current password for verification
password
string
required
New password to set

Response

msg
string
Success message
{
  "msg": "Password Updated"
}

Build docs developers (and LLMs) love