Skip to content

Register User

Register a new user account. An OTP will be sent to the provided email for verification.

Endpoint

POST /v1/accounts/register/user/

Authentication

Not required (public endpoint)

Request Body

{
  "first_name": "John",
  "last_name": "Doe",
  "email": "john.doe@example.com",
  "phone": "+994501234567",
  "password": "SecurePass123!",
  "confirm_password": "SecurePass123!",
  "preferred_language": "az"
}

Parameters

Field Type Required Description Validation
first_name string Yes User's first name Not empty
last_name string Yes User's last name Not empty
email string Yes User's email address Valid email format
phone string Yes User's phone number Valid phone format
password string Yes User's password Min 8 chars, uppercase, lowercase, number, symbol
confirm_password string Yes Password confirmation Must match password
preferred_language string Yes Preferred language code One of: "az", "en", "es", "de"

Response

Success (200 OK)

{
  "message": "Activation link send to email!"
}

An OTP code is sent to the provided email address. The user must verify the OTP using the Check OTP User endpoint.

Error Responses

Email Already Exists (404)

{
  "error": "Email Already Exists"
}

Password Mismatch (400)

{
  "error": "Confirm Password Is Not Correct!"
}

Validation Errors (400)

{
  "message": "Email not Send!"
}

or

{
  "message": "Is not correct email format!"
}

or

{
  "error": "No available language"
}

Example Request

curl -X POST "https://api.luxmart.site/v1/accounts/register/user/" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@example.com",
    "phone": "+994501234567",
    "password": "SecurePass123!",
    "confirm_password": "SecurePass123!",
    "preferred_language": "az"
  }'

Notes

  • The user account is created with is_active: false until OTP verification
  • OTP is sent asynchronously via email
  • Password is hashed before storage
  • User role is automatically set to "1" (User)