Skip to main content

Documentation Index

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

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

This page covers two closely related flows: account verification (required after registration before first login) and password recovery (for users who have forgotten their password). Both flows rely on a 5-digit numeric code delivered to the user’s registered email address.
All verification and recovery codes are 5-digit strings where each digit is a value from 1 to 5 (generated server-side with Math.ceil(Math.random() * 5), so 0 never appears). Codes are single-use and should be submitted promptly.

Verify Account

POST /api/user/verify-account

After registering, every account starts with an Inactivo (inactive) status. This endpoint activates the account by validating the 5-digit code that was emailed at registration. No authentication token is required. Method: POST
Path: /api/user/verify-account
Auth required: No

Request Body

email
string
required
The email address used to register the account.
code
string
required
The 5-digit verification code that was sent to the email address at the time of registration.

Response — 200 OK

On success, the account’s login_code_confirmed field is set to the verified code and the activation status is updated to { name: "Activado", value: "1" }. The user may now log in.
msj
string
A human-readable confirmation message.
status
boolean
Always true on success.

Example Request

curl -X POST https://your-api-domain.com/api/user/verify-account \
  -H "Content-Type: application/json" \
  -d '{
    "email": "carlos.reyes@example.com",
    "code": "34251"
  }'

Example Response

{
  "msj": "Tu cuenta ha sido confirmada. Inicia sesión",
  "status": true
}

Error Responses

Status CodeMeaning
203The provided code does not match the one on file for this account.
500An unexpected server error occurred.

Password Recovery Flow

Recovering a forgotten password is a two-step process: first request a recovery code, then submit that code along with the new password.
1

Request a recovery code — POST /api/user/recovery-password

Call this endpoint with the account’s email address. The server generates a 5-digit code_newpass and sends it to that address. No authentication token is required.Method: POST
Path: /api/user/recovery-password
Auth required: No

Request Body

email
string
required
The email address associated with the account that needs password recovery.

Response — 200 OK

Returns a success message confirming that the recovery email was sent.

Example Request

curl -X POST https://your-api-domain.com/api/user/recovery-password \
  -H "Content-Type: application/json" \
  -d '{
    "email": "carlos.reyes@example.com"
  }'

Error Responses

Status CodeMeaning
203No account was found for the provided email address.
2

Set a new password — POST /api/user/update-password

Once you have the recovery code from your email, submit it together with the desired new password. The server verifies the code against code_newpass, hashes the new password with bcrypt, and clears both code_newpass and code_confirm_pass on the account. No authentication token is required.Method: POST
Path: /api/user/update-password
Auth required: No

Request Body

email
string
required
The email address of the account being recovered.
code_confirm_pass
string
required
The 5-digit recovery code that was emailed in Step 1.
newPassword
string
required
The new password to set for the account. Will be stored as a bcrypt hash.

Response — 200 OK

Returns a success message confirming the password has been updated. The user can now log in with the new password.

Example Request

curl -X POST https://your-api-domain.com/api/user/update-password \
  -H "Content-Type: application/json" \
  -d '{
    "email": "carlos.reyes@example.com",
    "code_confirm_pass": "31425",
    "newPassword": "NewSecurePass456!"
  }'

Error Responses

Status CodeMeaning
203The recovery code is incorrect or does not match the account.
404No account was found for the provided email address.
Recovery codes are tied to a specific account and are invalidated once a successful password update is completed. If the code is lost or expired, restart the flow by calling POST /api/user/recovery-password again.

Build docs developers (and LLMs) love