Skip to main content

List All Businesses

curl -X GET https://api.beanquick.com/api/admin/empresas \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json"
[
  {
    "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",
    "usuario": {
      "id": 2,
      "name": "Coffee Shop Owner",
      "email": "[email protected]",
      "rol": "empresa",
      "created_at": "2026-01-10T07:30:00.000000Z",
      "updated_at": "2026-01-10T07:30:00.000000Z"
    }
  },
  {
    "id": 2,
    "user_id": 3,
    "nombre": "Artisan Bakery",
    "nit": "987654321",
    "direccion": "456 Oak Ave",
    "telefono": "555-0200",
    "descripcion": "Fresh baked goods daily",
    "logo": "logos/bakery-logo.jpg",
    "foto_local": "stores/bakery-front.jpg",
    "is_open": false,
    "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-02-15T09:00:00.000000Z",
    "updated_at": "2026-03-05T10:30:00.000000Z",
    "usuario": {
      "id": 3,
      "name": "Bakery Manager",
      "email": "[email protected]",
      "rol": "empresa",
      "created_at": "2026-02-15T08:45:00.000000Z",
      "updated_at": "2026-02-15T08:45:00.000000Z"
    }
  }
]
root
array
Array of business objects with associated user information
The response includes full image URLs (logo_url and foto_local_url) automatically appended by the Empresa model for easier frontend integration.

Update Business

curl -X PUT https://api.beanquick.com/api/admin/empresas/1 \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Premium Coffee Shop",
    "nit": "123456789",
    "telefono": "555-0150",
    "direccion": "123 Main Street, Suite 200"
  }'
{
  "message": "Empresa actualizada con éxito",
  "empresa": {
    "id": 1,
    "user_id": 2,
    "nombre": "Premium Coffee Shop",
    "nit": "123456789",
    "direccion": "123 Main Street, Suite 200",
    "telefono": "555-0150",
    "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-03-05T12:00:00.000000Z",
    "usuario": {
      "id": 2,
      "name": "Coffee Shop Owner",
      "email": "[email protected]",
      "rol": "empresa",
      "created_at": "2026-01-10T07:30:00.000000Z",
      "updated_at": "2026-01-10T07:30:00.000000Z"
    }
  }
}
id
integer
required
The ID of the business to update
nombre
string
required
Business name (max 255 characters)
nit
string
required
Tax identification number (must be unique)
telefono
string
required
Contact phone number
direccion
string
required
Business address
message
string
Success message
empresa
object
Updated business object with associated user information
The NIT must be unique across all businesses, except for the current business being updated. The response includes the associated user account information to help frontends maintain complete state.

Delete Business

curl -X DELETE https://api.beanquick.com/api/admin/empresas/1 \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json"
{
  "message": "Empresa eliminada correctamente."
}
id
integer
required
The ID of the business to delete
message
string
Success or error message
Deleting a business is a permanent operation. If your database has cascade delete configured, all associated products will also be deleted automatically.
Ensure you have proper backups before deleting businesses, as this operation cannot be undone.

Build docs developers (and LLMs) love