The Ordervista authentication API handles customer self-registration and session management for all user roles. Registration automatically assigns the customer role (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ytabeloved/ordervista/llms.txt
Use this file to discover all available pages before exploring further.
id_rol: 3). Login returns a signed JWT that must be included as a Bearer token in the Authorization header for every protected endpoint. Logout is stateless — the server responds with a confirmation message and the client is responsible for discarding the token.
POST /api/auth/register
Creates a new customer account. The new user is automatically assigned the customer role (id_rol: 3). Passwords are stored as bcrypt hashes.
Auth required: No
Request body
First name of the user.
Last name (surname) of the user.
Email address. Must be unique across all accounts. Used as the login identifier.
Plain-text password. Hashed with bcrypt (salt rounds: 10) before storage.
Optional phone number. Stored as a string up to 20 characters.
Response 201 Created
Confirmation message:
"Usuario registrado correctamente".The auto-generated primary key of the newly created user.
Error responses
| Status | mensaje | Cause |
|---|---|---|
400 | "Debe completar los datos obligatorios" | One or more required fields are missing. |
400 | "El correo ya se encuentra registrado" | The email address already exists in the system. |
500 | "Error al registrar usuario" | Unexpected server-side error. |
POST /api/auth/login
Authenticates a user and returns a signed JWT. The token encodesid_usuario, nombre, apellido, email, and id_rol, and must be sent as Authorization: Bearer <token> on all protected requests.
Auth required: No
Request body
Registered email address of the user.
Plain-text password. Compared against the stored bcrypt hash.
Response 200 OK
Confirmation message:
"Inicio de sesión correcto".Signed JWT for use in subsequent
Authorization: Bearer headers.Authenticated user summary object.
Error responses
| Status | mensaje | Cause |
|---|---|---|
400 | "Debe ingresar correo y contraseña" | email or password field is missing. |
401 | "Credenciales inválidas" | Email not found or password does not match. |
500 | "Error al iniciar sesión" | Unexpected server-side error. |
POST /api/auth/logout
Ends the current session. Because Ordervista uses stateless JWTs, the server simply returns a confirmation message. The client is responsible for deleting the stored token. Auth required: NoRequest body
None.Response 200 OK
Confirmation message:
"Sesión cerrada correctamente".Error responses
This endpoint has no documented error states. It always returns200 OK.