Skip to main content

POST /api/v2/register

Register a new user account with email, password, and phone number.

Headers

Content-Type
string
required
application/json

Query Parameters

platform
string
Platform identifier (“web” or “mobile”) - used for analytics

Request Body

email
string
required
User’s email address (must be valid format)
password
string
required
User’s password (will be hashed with bcrypt)
telephone
string
required
User’s mobile number (10 digits, validated)
firstname
string
required
User’s first name
lastname
string
User’s last name
gender
string
User’s gender
birthdate
string
User’s birthdate
referral_code
string
Referral code from another user (earns TSS Money rewards)
localcart
object
Local cart data to sync after registration
localwishlist
array
Local wishlist items to sync after registration

Response

access_token
string
JWT authentication token for the new user
username
string
User’s full name
status
integer
Registration status (1 = success)
ccnt
integer
Cart count
user_id
integer
Newly created user ID
cart
object
Synced cart data
wishlist
object
Synced wishlist data
is_first_time_login
boolean
Always true for new registrations

Error Responses

400 Bad Request (Already Registered)
{
  "title": "You are already registered with us"
}
400 Bad Request (Email Exists)
{
  "title": "Your email is already registered with us"
}
400 Bad Request (Invalid Email)
{
  "title": "Enter a valid email address"
}
400 Bad Request (Invalid Phone)
{
  "title": "Enter a valid mobile number"
}
400 Bad Request (Missing Fields)
{
  "title": "Enter all the required details"
}

Code Examples

curl -X POST "https://api.thesouledstore.com/api/v2/register?platform=web" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "SecurePass123!",
    "telephone": "9876543210",
    "firstname": "John",
    "lastname": "Doe",
    "gender": "Male",
    "referral_code": "ABC123",
    "localcart": {},
    "localwishlist": []
  }'

Referral Rewards

When a valid referral_code is provided:
  • New user receives TSS Money (configured in REFERRAL_EARNING_AMT)
  • Referral code owner receives rewards after the new user’s first order
  • Rewards expire based on REFERRAL_EARNING_EXPIRY setting

POST /api/v3/register

Register with Google reCAPTCHA verification (enhanced security endpoint).

Headers

Content-Type
string
required
application/json

Request Body

email
string
required
User’s email address
password
string
required
User’s password
telephone
string
required
Mobile number
firstname
string
required
First name
lastname
string
Last name
g-recaptcha-response
string
required
Google reCAPTCHA response token
referral_code
string
Referral code
localcart
object
Cart to sync
localwishlist
array
Wishlist to sync

Error Responses

400 Bad Request (Invalid Captcha)
{
  "title": "Invalid Captcha Please Try Again"
}
400 Bad Request (Missing Captcha)
{
  "title": "Please enter captcha details"
}

Code Examples

curl -X POST https://api.thesouledstore.com/api/v3/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "SecurePass123!",
    "telephone": "9876543210",
    "firstname": "Jane",
    "lastname": "Smith",
    "g-recaptcha-response": "03AGdBq27..."
  }'

POST /api/v2/register-otp

Initiate registration with OTP verification (step 1 of 2).

Headers

Content-Type
string
required
application/json

Query Parameters

platform
string
Platform: “web” or “mobile”

Request Body

email
string
required
Email address
telephone
string
required
Mobile number (10 digits)
firstname
string
required
First name
lastname
string
Last name
password
string
required
Password
gender
string
Gender
birthdate
string
Birthdate
referral_code
string
Referral code

Response

msg
string
“OTP sent successfully”
is_otp_sent
boolean
true if OTP was sent

Error Responses

400 Bad Request (Already Registered)
{
  "title": "Your email is already registered with us"
}
400 Bad Request (Phone Exists)
{
  "title": "Your mobile number is already registered with us"
}

Code Examples

curl -X POST "https://api.thesouledstore.com/api/v2/register-otp?platform=mobile" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "telephone": "9876543210",
    "firstname": "Alex",
    "lastname": "Johnson",
    "password": "MySecurePass123"
  }'

POST /api/v2/sendotp

Send OTP for registration (legacy endpoint). Deprecation Status: May be deprecated based on IS_REGISTER_API_DEPRECATED setting.

Request Body

telephone
string
required
Mobile number
email
string
Email address (checked for uniqueness)
is_register
boolean
Whether this is for registration

Response

data
string
“OTP sent successfully”

Error Responses

400 Bad Request (Phone Exists)
{
  "title": "This mobile number is already registered with us"
}
400 Bad Request (Rate Limited)
{
  "title": "We've already sent you an OTP. You can request a new one in 30 seconds"
}

POST /api/v2/verifyotp

Verify OTP sent to mobile number during registration.

Request Body

telephone
string
required
Mobile number that received the OTP
otp
string
required
4-digit OTP code

Response

Success (200)
{
  "message": "OTP verified successfully!"
}
Failure (400)
{
  "message": "Wrong OTP! Please enter correct OTP."
}
Not Found (400)
{
  "message": "OTP not found"
}

Code Examples

curl -X POST https://api.thesouledstore.com/api/v2/verifyotp \
  -H "Content-Type: application/json" \
  -d '{
    "telephone": "9876543210",
    "otp": "1234"
  }'

POST /api/v2/resendotp

Resend OTP for login or registration.

Request Body

telephone
string
required
Mobile number
platform
string
“login”, “register”, “enable_2fa”, “disable_2fa”, or “changemobile”
is_register
boolean
Whether this is for registration
previous_telephone
string
Previous phone number (for change mobile flow)
email
string
Email address (for 2FA flows)
localcart
object
Cart data (for login flow)
localwishlist
array
Wishlist data (for login flow)

Response

message
string
“OTP sent successfully”
is_otp_sent
boolean
true if successful

Error Responses

400 Bad Request (Rate Limited)
{
  "title": "We've already sent you an OTP. You can request a new one in 30 seconds"
}
400 Bad Request (Limit Exceeded)
{
  "title": "Maximum limit exceeded"
}
400 Bad Request (Send Failed)
{
  "title": "Error in sending OTP. Please try again"
}

Code Examples

curl -X POST https://api.thesouledstore.com/api/v2/resendotp \
  -H "Content-Type: application/json" \
  -d '{
    "telephone": "9876543210",
    "platform": "login"
  }'

Notes

  • OTP resend is rate-limited to prevent abuse (30 second cooldown)
  • Maximum resends per day limited by RESEND_COUNT configuration
  • Different OTP messages for web vs mobile platforms
  • OTP is stored in Redis with expiration

Build docs developers (and LLMs) love