API Testing Dashboard

Live

Test and verify all endpoints with real-time dummy API responses

10Total Endpoints
7Server Actions
3API Routes
All SystemsOperational

All Endpoints (10)

Complete list of server actions and API routes

Get Dashboard Stats

GET
Server Action

Fetches key performance indicators for the dashboard

getDashboardStats()

Expected Response

{
  "total_inventory_count": 45,
  "total_inventory_value": 1250000,
  "projected_profit": 185000,
  "leads_this_month": 28
}

Get Inventory Stats

GET
Server Action

Returns inventory breakdown by status

getInventoryStats()

Expected Response

[
  {
    "status": "Active",
    "count": 32
  },
  {
    "status": "Sold",
    "count": 156
  },
  {
    "status": "Inactive",
    "count": 8
  }
]

Get Revenue Data

GET
Server Action

Returns monthly revenue trends for charts

getRevenueData()

Expected Response

[
  {
    "month": "Jan",
    "revenue": 125000
  },
  {
    "month": "Feb",
    "revenue": 145000
  },
  {
    "month": "Mar",
    "revenue": 168000
  },
  {
    "month": "Apr",
    "revenue": 152000
  },
  {
    "month": "May",
    "revenue": 178000
  },
  {
    "month": "Jun",
    "revenue": 195000
  }
]

Get Recent Leads

GET
Server Action

Fetches most recent leads with customer info

getRecentLeads(limit)

Request Example

{
  "limit": 5
}

Expected Response

[
  {
    "id": "1",
    "status": "In Progress",
    "created_at": "2024-01-15T10:30:00Z",
    "customer": {
      "name": "John Smith",
      "phone": "555-0123"
    }
  },
  {
    "id": "2",
    "status": "Qualified",
    "created_at": "2024-01-14T15:45:00Z",
    "customer": {
      "name": "Sarah Johnson",
      "phone": "555-0456"
    }
  }
]

Get Financial Transactions

GET
Server Action

Returns financial ledger with sales and expenses

getFinancialTransactions()

Expected Response

[
  {
    "id": "sale-1",
    "date": "2024-01-15T10:00:00Z",
    "type": "sale",
    "description": "2022 Honda Civic (VIN: ABC123)",
    "amount": 25000
  },
  {
    "id": "expense-1",
    "date": "2024-01-10T14:30:00Z",
    "type": "expense",
    "description": "Vehicle Purchase: Toyota Camry (XYZ789)",
    "amount": 18000
  }
]

Check Database Integrity

GET
Server Action

Performs system health checks on all database tables

checkDatabaseIntegrity()

Expected Response

{
  "inventory": "OK",
  "crm": "OK",
  "finance": "OK",
  "latency": "45ms",
  "orphanLeads": 0,
  "orphanTestDrives": 0,
  "corruptedRecords": 0
}

Get Table Counts

GET
Server Action

Returns record counts for all database tables

getTableCounts()

Expected Response

{
  "vehicles": 196,
  "leads": 342,
  "invoices": 156,
  "users": 12,
  "test_drives": 89,
  "sales_deals": 156
}

AI Chat

POST
API Route

AI-powered chat assistant (currently disabled)

/api/chat

Request Example

{
  "messages": [
    {
      "role": "user",
      "content": "How many vehicles do we have in stock?"
    }
  ]
}

Expected Response

{
  "error": "AI chat temporarily disabled - being fixed"
}

Cron: Cleanup Leads

POST
API Route

Automated job to mark stale leads as lost

/api/cron/cleanup-leads

Request Example

{}

Expected Response

{
  "success": true,
  "message": "Updated 5 stale leads to 'Lost' status",
  "updated": 5
}

Facebook Post

POST
API Route

Posts a vehicle to Facebook Marketplace

/api/facebook/post

Request Example

{
  "vehicleId": "vehicle-123"
}

Expected Response

{
  "success": true,
  "postId": "fb-post-456",
  "message": "Successfully posted to Facebook"
}