Skip to main content

User Registration

Create a new user account. Automatically logs in the user and returns an API token.
curl -X POST https://api.beanquick.com/api/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Juan Pérez",
    "email": "[email protected]",
    "password": "SecurePass123",
    "password_confirmation": "SecurePass123",
    "rol": "cliente"
  }'

Request Body

name
string
required
User’s full name. Maximum 255 characters. Cannot contain HTML/script tags (<, >, {, }, /).
email
string
required
User’s email address. Must be unique in the system.
password
string
required
User’s password. Must meet security requirements:
  • Minimum 8 characters
  • At least one uppercase letter
  • At least one lowercase letter
  • At least one number
password_confirmation
string
required
Password confirmation. Must match the password field.
rol
string
required
User’s role. Allowed values:
  • cliente - Regular customer
  • empresa - Business owner
  • admin - Administrator

Response

status
string
Response status. Returns success on successful registration.
user
object
Newly created user information.
token
string
Laravel Sanctum API token for immediate authentication.
redirectTo
string
Suggested redirect URL based on user role:
  • cliente: / (main store)
  • empresa: /empresa/panel (business dashboard)
  • admin: /admin/dashboard (admin panel)
message
string
Success message.
{
  "status": "success",
  "user": {
    "id": 43,
    "name": "Juan Pérez",
    "email": "[email protected]",
    "rol": "cliente"
  },
  "token": "2|xyz789abc456def123ghi890jkl567mno234pqr901stu678vwx345",
  "redirectTo": "/",
  "message": "Cuenta creada y protegida correctamente"
}
Upon successful registration, a welcome email is automatically sent to the user’s email address.

Business Registration Request

Submit a business registration request. This is the first step for businesses to join BeanQuick. Admin approval is required before the business can be activated.
This endpoint accepts multipart/form-data for file uploads. Set the appropriate Content-Type header or let your HTTP client handle it automatically.
curl -X POST https://api.beanquick.com/api/solicitud-empresa \
  -F "nombre=Café del Sol" \
  -F "[email protected]" \
  -F "nit=900123456-7" \
  -F "telefono=+57 310 1234567" \
  -F "direccion=Calle 123 #45-67, Bogotá" \
  -F "descripcion=Café de especialidad con granos de origen colombiano" \
  -F "logo=@/path/to/logo.jpg" \
  -F "foto_local=@/path/to/store-photo.jpg"

Request Body (multipart/form-data)

nombre
string
required
Business name. Maximum 255 characters.
correo
string
required
Business contact email. Must be unique (not already submitted).
nit
string
Tax identification number (NIT). Maximum 50 characters. Optional.
telefono
string
Business phone number. Maximum 50 characters. Optional.
direccion
string
Business physical address. Maximum 255 characters. Optional.
descripcion
string
Business description. Optional.
Business logo image. Allowed formats: jpeg, png, jpg, webp. Maximum size: 2MB. Optional but recommended.
foto_local
file
Store/location photo. Allowed formats: jpeg, png, jpg, webp. Maximum size: 4MB. Optional.

Response

status
string
Response status. Returns success when request is submitted successfully.
message
string
Confirmation message.
solicitud_id
integer
Unique identifier for the submitted request.
{
  "status": "success",
  "message": "Tu solicitud fue enviada correctamente. Nuestro equipo la revisará pronto.",
  "solicitud_id": 12
}
The request is created with status pendiente (pending) and awaits admin approval. Once approved by an admin, an activation email with a unique token will be sent to the business email.

Validate Activation Token

Validate a business activation token and retrieve the associated request details. This endpoint is used before displaying the activation form.
curl -X GET https://api.beanquick.com/api/empresa/validar-token/abc123xyz789token456 \
  -H "Content-Type: application/json"

Path Parameters

token
string
required
Activation token sent to the business email after admin approval.

Response

status
string
Response status. Returns success if token is valid.
solicitud
object
Business request details.
{
  "status": "success",
  "solicitud": {
    "id": 12,
    "nombre": "Café del Sol",
    "correo": "[email protected]",
    "nit": "900123456-7",
    "telefono": "+57 310 1234567",
    "direccion": "Calle 123 #45-67, Bogotá",
    "descripcion": "Café de especialidad con granos de origen colombiano",
    "logo": "solicitudes/logos/cafe-del-sol-logo.jpg",
    "foto_local": "solicitudes/locales/cafe-del-sol-store.jpg",
    "logo_url": "https://api.beanquick.com/storage/solicitudes/logos/cafe-del-sol-logo.jpg",
    "foto_local_url": "https://api.beanquick.com/storage/solicitudes/locales/cafe-del-sol-store.jpg",
    "estado": "aprobado",
    "token": "abc123xyz789token456"
  }
}

Activate Business Account

Complete the business activation by creating a user account and business profile. This endpoint processes the final step after admin approval.
curl -X POST https://api.beanquick.com/api/empresa/activar/abc123xyz789token456 \
  -H "Content-Type: application/json" \
  -d '{
    "password": "SecurePass123",
    "password_confirmation": "SecurePass123"
  }'

Path Parameters

token
string
required
Activation token received via email after admin approval.

Request Body

password
string
required
Account password. Must be at least 8 characters.
password_confirmation
string
required
Password confirmation. Must match the password field.

Response

status
string
Response status. Returns success on successful activation.
message
string
Confirmation message.
user
object
Created user account information.
{
  "status": "success",
  "message": "Cuenta creada exitosamente. Ya puedes iniciar sesión.",
  "user": {
    "id": 25,
    "name": "Café del Sol",
    "email": "[email protected]",
    "rol": "empresa"
  }
}
This endpoint performs multiple operations in a database transaction:
  1. Creates a user account with role empresa
  2. Creates a business profile (Empresa) linked to the user
  3. Moves uploaded files from temporary to permanent storage
  4. Updates the request status to completada
  5. Invalidates the activation token
If any step fails, all changes are rolled back.

Business Registration Flow

The complete business registration process follows these steps:
1

Submit Registration Request

Business submits initial request via POST /api/solicitud-empresa with business details and images. Request status is set to pendiente.
2

Admin Review

Admin reviews the request in the admin dashboard (/admin/solicitudes) and either approves or rejects it.
3

Approval Notification

If approved, admin triggers POST /admin/aprobar/{id} which:
  • Updates request status to aprobado
  • Generates a unique activation token
  • Sends activation email to the business with a link containing the token
4

Token Validation

Business clicks the link and frontend calls GET /api/empresa/validar-token/{token} to verify the token and display request details.
5

Account Activation

Business sets their password and submits POST /api/empresa/activar/{token} to create their account and business profile.
6

Login

Business can now login via POST /api/login using their email and password.

Error Responses

400 Bad Request

Returned when required file uploads are missing or invalid.
{
  "error": "Laravel no detecta el archivo logo. Revisa el Body en Thunder."
}

404 Not Found

Returned when activation token is invalid or already used.
{
  "message": "El enlace de activación no es válido o ya fue usado."
}

422 Unprocessable Entity

Returned when validation fails or business logic prevents the operation.
{
  "message": "Ya existe una cuenta con este correo."
}
{
  "message": "The email has already been taken.",
  "errors": {
    "email": [
      "The email has already been taken."
    ]
  }
}

500 Internal Server Error

Returned when an unexpected error occurs during activation.
{
  "error_real": "Detailed error message",
  "linea": 78
}

Public Catalog Endpoints

These endpoints are accessible without authentication and are used to browse the public catalog.

Get Product Categories

curl https://api.beanquick.com/api/categorias
Returns all product categories available on the platform. Response Returns an array of category objects:
id
integer
Category ID
nombre
string
Category name (e.g., “Bebidas”, “Comida”, “Postres”)
created_at
string
Creation timestamp
updated_at
string
Last update timestamp
Example Response
[
  {
    "id": 1,
    "nombre": "Bebidas",
    "created_at": "2026-01-01T00:00:00.000000Z",
    "updated_at": "2026-01-01T00:00:00.000000Z"
  },
  {
    "id": 2,
    "nombre": "Comida",
    "created_at": "2026-01-01T00:00:00.000000Z",
    "updated_at": "2026-01-01T00:00:00.000000Z"
  }
]
This endpoint is public and does not require authentication.
curl https://api.beanquick.com/api/productos/destacados
Returns the top 4 products with the highest average ratings across the platform. Response Returns an array of product objects with ratings:
id
integer
Product ID
nombre
string
Product name
descripcion
string
Product description
precio
number
Product price
stock
integer
Available stock quantity
imagen_url
string
Full URL to product image
promedio_calificacion
number
Average rating (1-5 stars)
total_calificaciones
integer
Total number of ratings received
empresa
object
Business information
Example Response
[
  {
    "id": 15,
    "nombre": "Cappuccino Premium",
    "descripcion": "Rich espresso with steamed milk",
    "precio": 4.50,
    "stock": 100,
    "imagen_url": "https://api.beanquick.com/storage/productos/cappuccino.jpg",
    "promedio_calificacion": 4.8,
    "total_calificaciones": 45,
    "empresa": {
      "id": 3,
      "nombre": "Coffee House"
    }
  }
]
This endpoint returns a maximum of 4 products sorted by rating. Products must have at least one rating to appear in featured products.

Build docs developers (and LLMs) love