Register User
curl -X POST https://api.miscompras.com/php/registro.php \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "nombre=Juan Pérez" \
-d "[email protected] " \
-d "contrasena=securePassword123"
Register a new user account in the Mis Compras platform.
Request Parameters
User’s email address. Must be unique in the system.
User’s password. Will be hashed using bcrypt before storage.
Response
Indicates whether the registration was successful
Human-readable message about the registration result
Success Response
Error - Duplicate Email
Error - Missing Fields
{
"success" : true ,
"message" : "🎉 ¡Registro exitoso!"
}
The password is automatically hashed using PASSWORD_DEFAULT (bcrypt) before being stored in the database.
Login User
curl -X POST https://api.miscompras.com/php/login.php \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "[email protected] " \
-d "contrasena=securePassword123"
Authenticate a user and create a session.
Request Parameters
User’s registered email address
Response
Indicates whether the login was successful
Human-readable message about the login result
User information (only returned on successful login)
Success Response
Error - Invalid Password
Error - User Not Found
Error - Missing Fields
{
"éxito" : true ,
"mensaje" : "Inicio de sesión exitoso" ,
"usuario" : {
"id" : 1 ,
"nombre" : "Juan Pérez"
}
}
A successful login creates a PHP session with id_usuario and nombre stored in $_SESSION.
Get User Details
GET /php/obtener_usuario.php
curl -X GET "https://api.miscompras.com/php/obtener_usuario.php?id=1"
Retrieve detailed information about a specific user.
Query Parameters
The unique identifier of the user to retrieve
Response
Indicates whether the request was successful
Error message (only present on failure)
User information (only present on success) Registration date in DD/MM/YYYY format
Success Response
Error - User Not Found
Error - Missing ID
{
"exito" : true ,
"usuario" : {
"id_usuario" : 1 ,
"nombre" : "Juan Pérez" ,
"email" : "[email protected] " ,
"fecha_registro" : "15/01/2024"
}
}
Register User (Node.js)
POST /api/usuarios/registro
curl -X POST https://api.miscompras.com/api/usuarios/registro \
-H "Content-Type: application/json" \
-d '{
"nombre": "María García",
"correo": "[email protected] ",
"contraseña": "securePass456"
}'
Alternative Node.js-based registration endpoint.
This endpoint is part of the Express.js backend located in bakend/routes/usuarios.js.
Request Body
User’s password (will be hashed with bcrypt)
Response
Indicates whether the registration was successful
Human-readable success message
Error message (only present on failure)
Success Response
Error Response
{
"success" : true ,
"message" : "Usuario registrado con éxito"
}
Ensure you send the request with Content-Type: application/json header for the Node.js endpoint.
Get Seller Profile
GET /php/obtener_vendedor.php
curl -X GET "https://api.miscompras.com/php/obtener_vendedor.php?id=17"
Retrieves detailed seller profile information including ratings and verification status.
Parameters
Response
Seller profile information Seller profile description
Customer service information
Whether the seller is verified
Average seller rating (0-5)
Number of ratings received
Success Response
Error - Seller Not Found
Error - Missing ID
{
"success" : true ,
"vendedor" : {
"id_usuario" : 17 ,
"nombre" : "frank" ,
"email" : "[email protected] " ,
"fecha_registro" : "2025-11-12 00:35:50" ,
"descripcion" : "Vendedor confiable de productos tecnológicos" ,
"imagen" : "perfil_17.jpg" ,
"telefono" : "+57 300 1234567" ,
"ubicacion" : "Bogotá, Colombia" ,
"politica_envios" : "Envíos a todo el país" ,
"garantia" : "30 días de garantía en todos los productos" ,
"metodos_pago" : "Efectivo, Tarjeta, Transferencia" ,
"atencion_cliente" : "Lunes a Viernes 9am - 6pm" ,
"verificado" : 1 ,
"rating" : "4.5" ,
"valoraciones" : 12
}
}
This endpoint requires the usuario_vendedor and valoraciones tables which are not included in the base database schema. You will need to create these tables before using this endpoint. The endpoint code exists in the source but the required database tables must be added manually.