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.

The registration endpoint creates a new user account with an inactive status by default. After a successful registration, a 5-digit numeric verification code is sent to the user’s email address. The account must be verified before it can be used to log in. No authentication token is required for this endpoint.

Endpoint

Method: POST
Path: /api/user/register
Auth required: No

Request Body

firstName
string
required
The user’s first name.
lastName
string
required
The user’s last name.
email
string
required
A unique, valid email address. Used for login and account verification. Registration will be rejected if this address is already associated with an existing account.
password
string
required
The account password. Stored as a bcrypt hash — never in plain text.
phone
string
required
The user’s contact phone number.
sex
string
required
The user’s sex. Must be one of the following values:
  • Masculino
  • Femenino
  • Otro
document
string
required
The user’s identification document number.
documentType
string
required
The type of identification document. Must be one of the following values:
  • CC — Cédula de Ciudadanía
  • CE — Cédula de Extranjería
  • Pasaporte — Passport
birthdate
string
required
The user’s date of birth (e.g. "1990-05-20").

Response — 200 OK

A successful registration returns the saved user object along with a confirmation message. The new account is automatically assigned the role Usuario (value "1") and an Inactivo (value "2") activation status.
msj
string
A human-readable confirmation message.
status
boolean
Always true on success.
savedUser
object
The newly created user document.

Example Request

curl -X POST https://your-api-domain.com/api/user/register \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Carlos",
    "lastName": "Reyes",
    "email": "carlos.reyes@example.com",
    "password": "SecurePass123!",
    "phone": "3001234567",
    "sex": "Masculino",
    "document": "1023456789",
    "documentType": "CC",
    "birthdate": "1992-08-15"
  }'

Example Response

{
  "msj": "Cuenta creada exitosamente. Te hemos enviado un código de 5 dígitos a tu correo para verificar tu cuenta, por favor no lo compartas",
  "status": true,
  "savedUser": {
    "firstName": "Carlos",
    "lastName": "Reyes",
    "email": "carlos.reyes@example.com",
    "phone": "3001234567",
    "sex": "Masculino",
    "document": "1023456789",
    "documentType": "CC",
    "birthdate": "1992-08-15",
    "roles": [{ "name": "Usuario", "value": "1" }],
    "activate": [{ "name": "Inactivo", "value": "2" }]
  }
}
After registration, a 5-digit verification code is sent to the provided email. Each digit is a value from 1 to 5 (the server uses Math.ceil(Math.random() * 5), so 0 never appears). You must call POST /api/user/verify-account with that code before the account can be used to log in.

Error Responses

Status CodeMeaning
202An account with the provided email address already exists.
203One or more required body fields are missing from the request.
500An unexpected server error occurred.

Build docs developers (and LLMs) love