Login
Authentication
Login
Authenticate user and receive JWT token
POST
Login
Endpoint
Authentication
No authentication required.Request Body
string
required
User’s email address. Must be a valid email format.
string
required
User’s password.
Response
boolean
Indicates whether the login was successful.
string
Human-readable message describing the result.
string
JWT authentication token. Expires in 7 days by default.
object
User information including profile details.
string
User’s unique identifier.
string
User’s email address.
string
User’s full name.
string
User’s role (“seller” or “admin”).
boolean
Whether the user’s email has been verified.
object
Seller-specific profile information. Null for admin users.
string
URL or identifier for the seller’s identity document.
string
URL to the seller’s selfie image.
string
Verification status: “pending”, “verified”, or “rejected”.
string
Method used for verification: “manual” or “automatic”.
string
ISO 8601 timestamp of when verification was completed.
boolean
Whether the seller has a verified badge displayed.
Example Request
Example Response
200 Success
Error Responses
error
Bad Request - Validation error.
error
Unauthorized - Invalid credentials or inactive account.
error
Server Error - Internal server error.
Notes
- Email is normalized and converted to lowercase before authentication
- Only active users (
is_active: true) can log in - The
last_logintimestamp is automatically updated upon successful login - Password comparison is done securely using bcrypt
- The JWT token contains the user’s ID and role, and should be included in the
Authorizationheader for protected endpoints - Store the token securely (e.g., httpOnly cookies or secure storage) and never expose it in URLs or logs

