Skip to main content
This endpoint authenticates a user with their email or mobile number and password and returns a Bearer access token along with user state information (verification status, missing profile data, cart count, role, and approval status). Use it as the entry point for any client that needs to make authenticated API calls.

Endpoint

Required role: None (public endpoint). Parent accounts are not permitted.

Required Headers

Optional Headers

The system auto-resolves device information from the request body or the headers. If neither is provided and the request comes from a web client, a UUID is generated and tracked on the server.

Request Body

string
required
The user’s email address or mobile number.
string
required
The user’s password.
string
Unique token for the device. Can also be passed as the device_token header.
string
Descriptive name for the device. Can also be passed as the device-name header.

Example Request

Response

200 OK

Returns the Bearer access token and a set of user state flags. Use the access_token value in the Authorization: Bearer <token> header on subsequent requests.
Response fields:

Validation Error Responses (422)

The API returns a 422 status when required fields are missing or malformed.

Error Responses

Send device_type, device_token, and device-name on every login so device limits and per-device restrictions are enforced accurately. If you omit them from a web request, the server assigns a UUID for tracking.