Skip to main content

List Pending Approvals

curl -X GET https://api.beanquick.com/api/admin/solicitudes \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json"
{
  "usuarios": [
    {
      "id": 1,
      "name": "John Doe",
      "email": "[email protected]",
      "rol": "cliente",
      "created_at": "2026-01-15T10:30:00.000000Z",
      "updated_at": "2026-01-15T10:30:00.000000Z"
    }
  ],
  "empresas": [
    {
      "id": 1,
      "user_id": 2,
      "nombre": "Coffee Shop",
      "nit": "123456789",
      "direccion": "123 Main St",
      "telefono": "555-0100",
      "descripcion": "Best coffee in town",
      "logo": "logos/coffee-shop.jpg",
      "foto_local": "stores/coffee-interior.jpg",
      "is_open": true,
      "logo_url": "http://api.beanquick.com/storage/logos/coffee-shop.jpg",
      "foto_local_url": "http://api.beanquick.com/storage/stores/coffee-interior.jpg",
      "created_at": "2026-01-10T08:00:00.000000Z",
      "updated_at": "2026-01-10T08:00:00.000000Z"
    }
  ],
  "pedidos": [
    {
      "id": 1,
      "user_id": 1,
      "empresa_id": 1,
      "total": 25.50,
      "estado": "pendiente",
      "created_at": "2026-03-05T09:00:00.000000Z",
      "cliente": {
        "id": 1,
        "name": "John Doe",
        "email": "[email protected]"
      },
      "empresa": {
        "id": 1,
        "nombre": "Coffee Shop"
      }
    }
  ],
  "solicitudes": [
    {
      "id": 1,
      "nombre": "New Bakery",
      "correo": "[email protected]",
      "nit": "987654321",
      "telefono": "555-0200",
      "direccion": "456 Oak Ave",
      "descripcion": "Fresh baked goods daily",
      "logo": "logos/bakery-logo.jpg",
      "foto_local": "stores/bakery-front.jpg",
      "estado": "pendiente",
      "token": null,
      "logo_url": "http://api.beanquick.com/storage/logos/bakery-logo.jpg",
      "foto_local_url": "http://api.beanquick.com/storage/stores/bakery-front.jpg",
      "created_at": "2026-03-04T14:30:00.000000Z",
      "updated_at": "2026-03-04T14:30:00.000000Z"
    }
  ]
}
usuarios
array
List of all registered users (excluding business users)
empresas
array
List of all active businesses
pedidos
array
List of all orders with customer and business details
solicitudes
array
List of pending business registration requests

Approve Business Request

curl -X POST https://api.beanquick.com/api/admin/aprobar/1 \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json"
{
  "message": "Solicitud aprobada y correo de activación enviado.",
  "solicitud": {
    "id": 1,
    "nombre": "New Bakery",
    "correo": "[email protected]",
    "nit": "987654321",
    "telefono": "555-0200",
    "direccion": "456 Oak Ave",
    "descripcion": "Fresh baked goods daily",
    "logo": "logos/bakery-logo.jpg",
    "foto_local": "stores/bakery-front.jpg",
    "estado": "aprobado",
    "token": "abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstu",
    "logo_url": "http://api.beanquick.com/storage/logos/bakery-logo.jpg",
    "foto_local_url": "http://api.beanquick.com/storage/stores/bakery-front.jpg",
    "created_at": "2026-03-04T14:30:00.000000Z",
    "updated_at": "2026-03-05T10:15:00.000000Z"
  }
}
id
integer
required
The ID of the business request to approve
message
string
Success or error message
solicitud
object
Updated business request with approval details
When a business request is approved, a 60-character activation token is generated and an email is sent to the business owner with a link to complete registration at http://localhost:5173/empresa/activar/{token}.

Reject Business Request

curl -X POST https://api.beanquick.com/api/admin/rechazar/1 \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json"
{
  "message": "Solicitud rechazada.",
  "solicitud": {
    "id": 1,
    "nombre": "New Bakery",
    "correo": "[email protected]",
    "nit": "987654321",
    "telefono": "555-0200",
    "direccion": "456 Oak Ave",
    "descripcion": "Fresh baked goods daily",
    "logo": "logos/bakery-logo.jpg",
    "foto_local": "stores/bakery-front.jpg",
    "estado": "rechazado",
    "token": null,
    "logo_url": "http://api.beanquick.com/storage/logos/bakery-logo.jpg",
    "foto_local_url": "http://api.beanquick.com/storage/stores/bakery-front.jpg",
    "created_at": "2026-03-04T14:30:00.000000Z",
    "updated_at": "2026-03-05T10:20:00.000000Z"
  }
}
id
integer
required
The ID of the business request to reject
message
string
Confirmation message
solicitud
object
Updated business request with rejection status
Rejected requests will no longer appear in the pending approvals list.

Category Management

Admins can create and delete product categories that businesses use to organize their products.

Create Category

curl -X POST https://api.beanquick.com/api/admin/categorias \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Bebidas"
  }'
Creates a new product category for the platform. Request Body
nombre
string
required
Category name (e.g., “Bebidas”, “Comida”, “Postres”)
Response
id
integer
Category ID
nombre
string
Category name
created_at
string
Creation timestamp

Delete Category

curl -X DELETE https://api.beanquick.com/api/admin/categorias/5 \
  -H "Authorization: Bearer {token}"
Permanently deletes a category. Products using this category will need to be reassigned to another category. Path Parameters
id
integer
required
Category ID to delete
Response
{
  "message": "Categoría eliminada correctamente"
}
Deleting a category may affect products that use it. Ensure products are reassigned to valid categories before deletion.

Build docs developers (and LLMs) love