API Ecommerce uses two distinct login endpoints — one for admins and one for customers — to enforce strict role separation at authentication time. Both endpoints accept an email and password, authenticate against theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSCaicedo/Api-Ecommerce/llms.txt
Use this file to discover all available pages before exploring further.
users table filtered by type_user, and return a signed JWT bearer token along with basic user details. All auth routes are rate-limited to 10 requests per minute.
Admin Login
type_user = 1 (administrators). If the credentials are valid but the account is not an admin, a 401 Unauthorized is returned.
Request Body
The admin account’s email address.
The admin account’s password.
Example Request
Customer Login
type_user = 2 (customers). In addition to valid credentials, the customer’s email must be verified (email_verified_at must not be null). Unverified accounts receive a 401 Unauthorized response.
Request Body
The customer account’s email address.
The customer account’s password.
Example Request
Token Response
Both login endpoints return identical token payloads on success.The signed JWT bearer token to include in subsequent authenticated requests via the
Authorization: Bearer <token> header.Always
"bearer".Token lifetime in seconds, calculated as
TTL * 60 from the JWT configuration.The authenticated user’s full name (
name + surname concatenated).The authenticated user’s email address.
The authenticated user’s first name.
Example Token Response
Token Refresh
Authorization: Bearer <token> header.
Logout (Current Session)
auth('api')->logout() and permanently removes its record from the user_tokens table. After this call the token is no longer accepted.
Authentication: Requires a valid Authorization: Bearer <token> header.
Response
Logout Specific Device
404 if the token is not found in user_tokens.
Authentication: Requires a valid Authorization: Bearer <your_current_token> header.
Request Body
The JWT token string of the session to revoke.