Login and Get Roles
Authenticates a user with email and password, returning all available roles for the account.Request Body
User’s registered email address
User’s password
Response
Unique identifier for the user account
User’s email address
List of roles assigned to this account (e.g., [“Customer”], [“Customer”, “Seller”])
Response Codes
200 OK- Authentication successful400 Bad Request- Invalid request format403 Forbidden- Account locked or disabled404 Not Found- Email not found or incorrect password500 Internal Server Error- Server error
Examples
Success Response Example
Error Response Examples
Invalid Credentials (404 Not Found):Get Token by Role
After receiving available roles, select a specific role to get a JWT token.Request Body
Account ID received from the login/roles endpoint
Role to authenticate as (must be one of the roles returned from /api/account/roles)
Response
JWT authentication token for the selected role
Response Codes
200 OK- Token generated successfully400 Bad Request- Invalid role or account ID403 Forbidden- User doesn’t have the requested role404 Not Found- Account not found
Examples
Success Response Example
Next Steps
After successful login:- Store the JWT token securely
- Include the token in the Authorization header for subsequent requests
- Use role-specific endpoints based on your selected role
Users can have multiple roles. Call the token endpoint again with a different role to switch contexts.