Skip to main content

Documentation Index

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

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

This endpoint creates a new customer account (type_user = 2) in the API Ecommerce platform. Upon successful registration, a verification email is automatically dispatched to the provided address. The account remains inactive — and cannot be used to log in — until the customer completes email verification via POST /api/auth/verified_auth.

Method and Path

POST /api/auth/register

Authentication

None required. This endpoint is publicly accessible.

Rate Limit

10 requests per minute (applied to the entire /api/auth route group via Laravel’s throttle:10,1 middleware).

Request Body

name
string
required
The customer’s first name.
surname
string
required
The customer’s last name / surname.
phone
string
required
The customer’s phone number.
email
string
required
A valid, unique email address. Registration fails if this email already exists in the users table.
password
string
required
Account password. Minimum 8 characters. Stored as a bcrypt hash.

Responses

201 — Created

Returns the newly created user object as JSON.
{
  "id": 42,
  "name": "Jane",
  "surname": "Doe",
  "phone": "+1-555-0100",
  "type_user": 2,
  "email": "jane.doe@example.com",
  "uniqd": "6659f3e2b4c7a",
  "email_verified_at": null,
  "created_at": "2024-06-01T12:00:00.000000Z",
  "updated_at": "2024-06-01T12:00:00.000000Z"
}

400 — Validation Error

Returned when one or more request fields fail validation. The response body is a JSON-encoded string of field-level error messages.
{
  "email": ["The email has already been taken."],
  "password": ["The password must be at least 8 characters."]
}

503 — Service Unavailable

Returned when the site is in maintenance mode (vista_mantenimiento is active).
{
  "message": "El sitio está en mantenimiento"
}

Example Request

curl --request POST \
  --url https://your-domain.com/api/auth/register \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Jane",
    "surname": "Doe",
    "phone": "+1-555-0100",
    "email": "jane.doe@example.com",
    "password": "securePass123"
  }'

Example Response

{
  "id": 42,
  "name": "Jane",
  "surname": "Doe",
  "phone": "+1-555-0100",
  "type_user": 2,
  "email": "jane.doe@example.com",
  "uniqd": "6659f3e2b4c7a",
  "email_verified_at": null,
  "created_at": "2024-06-01T12:00:00.000000Z",
  "updated_at": "2024-06-01T12:00:00.000000Z"
}

After registering, the account is not active until the customer clicks the verification link sent by email. That link hits POST /api/auth/verified_auth with the unique code_user parameter, which stamps email_verified_at and allows the customer to log in via POST /api/auth/login_ecommerce.

Build docs developers (and LLMs) love