Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/ecommerce-delivery/llms.txt

Use this file to discover all available pages before exploring further.

After registration, each new account stays in a Pendiente de confirmacion state until the user confirms ownership of their email address. This endpoint accepts the email and the 6-digit code that was dispatched automatically on sign-up. On success, the account status is updated to usuario activo.

Verify Account

POST /api/user/verify-account
Authentication: None required

Request Body

email
string
required
The email address associated with the account to be verified.
code
string
required
The 6-digit verification code received in the registration email.

Response

200 — Account confirmed

msj
string
"Cuenta confirmada correctamente. Iniciar sesion para poder disfrutar mas de nuestro contenido"
status
boolean
true on success.

203 — Incorrect code

Returned when the supplied code does not match the stored codeActivate for that email, or when the email does not exist.
{
  "msj": "Codigo de verificacion incorrecto",
  "status": false
}

400 — Already verified

Returned when the account has already been confirmed (checked before the expiry window).
{
  "msj": "Esta cuenta ya ha sido verificada y está activa. Puedes iniciar sesion",
  "status": false,
  "alreadyVerified": true
}

400 — Code expired

Returned when the verification code’s 24-hour window has passed. A new code must be requested via POST /api/user/resend-code.
{
  "msj": "El codigo de verificacion ha expirado. Solicita uno nuevo",
  "status": false
}
The verification code expires 24 hours after registration (or after the last time it was resent). If it has expired, use POST /api/user/resend-code to get a fresh code before calling this endpoint again.

Example

curl -X POST https://your-api.com/api/user/verify-account \
  -H "Content-Type: application/json" \
  -d '{
    "email": "maria@example.com",
    "code": "748291"
  }'
Response:
{
  "msj": "Cuenta confirmada correctamente. Iniciar sesion para poder disfrutar mas de nuestro contenido",
  "status": true
}

Resend Verification Code

If the original code has expired or was not received, request a new one with this endpoint. A new 6-digit code is generated, saved, and emailed to the address provided.
POST /api/user/resend-code
Authentication: None required

Request Body

email
string
required
The email address of the account requiring a new verification code.

Response

200 — Code resent

msj
string
"Código reenviado exitosamente. Revisa tu correo"
status
boolean
true on success.
data
object
The updated user document with the new codeActivate and codeActivateExpires values.

404 — Email not found

{
  "msj": "No se encontro ningun usuario con este correo",
  "status": false
}

400 — Account already active

Returned when the account is already confirmed and no new code is needed.
{
  "msj": "Esta cuenta ya ha sido verificada y está activa",
  "status": false
}

Example

curl -X POST https://your-api.com/api/user/resend-code \
  -H "Content-Type: application/json" \
  -d '{
    "email": "maria@example.com"
  }'
Response:
{
  "msj": "Código reenviado exitosamente. Revisa tu correo",
  "status": true,
  "data": {
    "_id": "664a1f2e9b1c4a001f2e3d44",
    "email": "maria@example.com",
    "codeActivate": "319047",
    "codeActivateExpires": "2024-05-21T09:00:00.000Z"
  }
}

Build docs developers (and LLMs) love