Skip to main content

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

nombre
string
required
User’s full name
email
string
required
User’s email address. Must be unique in the system.
contrasena
string
required
User’s password. Will be hashed using bcrypt before storage.

Response

success
boolean
Indicates whether the registration was successful
message
string
Human-readable message about the registration result
{
  "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

email
string
required
User’s registered email address
contrasena
string
required
User’s password

Response

éxito
boolean
Indicates whether the login was successful
mensaje
string
Human-readable message about the login result
usuario
object
User information (only returned on successful login)
{
  "é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

curl -X GET "https://api.miscompras.com/php/obtener_usuario.php?id=1"
Retrieve detailed information about a specific user.

Query Parameters

id
integer
required
The unique identifier of the user to retrieve

Response

exito
boolean
Indicates whether the request was successful
mensaje
string
Error message (only present on failure)
usuario
object
User information (only present on success)
{
  "exito": true,
  "usuario": {
    "id_usuario": 1,
    "nombre": "Juan Pérez",
    "email": "[email protected]",
    "fecha_registro": "15/01/2024"
  }
}

Register User (Node.js)

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

nombre
string
required
User’s full name
correo
string
required
User’s email address
contraseña
string
required
User’s password (will be hashed with bcrypt)

Response

success
boolean
Indicates whether the registration was successful
message
string
Human-readable success message
error
string
Error message (only present on failure)
{
  "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

curl -X GET "https://api.miscompras.com/php/obtener_vendedor.php?id=17"
Retrieves detailed seller profile information including ratings and verification status.

Parameters

id
integer
required
Seller’s user ID

Response

success
boolean
Request success status
vendedor
object
Seller profile information
{
  "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.

Build docs developers (and LLMs) love