Skip to content

List Bookings

Retrieve a comprehensive list of all bookings across the agency or partner's fleet. This endpoint is the central hub for booking management, allowing staff to monitor reservations, track active rentals, and review booking history.

The booking list provides powerful filtering capabilities for different operational needs:

  • Operations Staff: Filter by active status to monitor ongoing rentals
  • Customer Service: Search by client name or booking reference to assist customers
  • Fleet Managers: Filter by vehicle to see a specific car's booking history
  • Revenue Analysis: Filter by date range for financial reporting

The response includes aggregate statistics in the meta section, giving a quick overview of booking distribution across statuses.

Permission Required

This endpoint requires the bookings.view permission.

Endpoint

INFO

GET /api/v1/dashboard/bookings

Headers

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer {token}Yes

Query Parameters

ParameterTypeDefaultDescription
agency_idinteger-Filter by agency
vehicle_idinteger-Filter by vehicle
user_idinteger-Filter by client
statusstring-Filter: upcoming, active, completed, cancelled
start_datedate-Filter by start date (from)
end_datedate-Filter by end date (to)
searchstring-Search by booking ID, client name, plate number
pageinteger1Page number
per_pageinteger15Items per page

Example Request

bash
curl -X GET "https://api.daakey.com/api/v1/dashboard/bookings?agency_id=1&status=active" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}"

Response

Success (200)

json
{
  "success": true,
  "message": "Bookings retrieved",
  "data": [
    {
      "id": 1,
      "reference": "BK-2024-00001",
      "status": "active",
      "start_date": "2024-01-15T10:00:00Z",
      "end_date": "2024-01-15T18:00:00Z",
      "actual_start": "2024-01-15T10:05:00Z",
      "actual_end": null,
      "client": {
        "id": 1,
        "name": "John Doe",
        "email": "john@example.com",
        "phone": "+1234567890"
      },
      "vehicle": {
        "id": 1,
        "plate_number": "ABC-123",
        "brand": "Toyota",
        "model": "Corolla"
      },
      "agency": {
        "id": 1,
        "name": "Downtown Branch"
      },
      "pricing": {
        "subtotal": 64.00,
        "tax": 6.40,
        "total": 70.40,
        "currency": "USD",
        "payment_status": "paid"
      },
      "created_at": "2024-01-10T00:00:00Z"
    },
    {
      "id": 2,
      "reference": "BK-2024-00002",
      "status": "upcoming",
      "start_date": "2024-01-20T09:00:00Z",
      "end_date": "2024-01-22T17:00:00Z",
      "actual_start": null,
      "actual_end": null,
      "client": {
        "id": 2,
        "name": "Jane Smith",
        "email": "jane@example.com",
        "phone": "+0987654321"
      },
      "vehicle": {
        "id": 2,
        "plate_number": "XYZ-789",
        "brand": "Honda",
        "model": "CR-V"
      },
      "agency": {
        "id": 1,
        "name": "Downtown Branch"
      },
      "pricing": {
        "subtotal": 220.00,
        "tax": 22.00,
        "total": 242.00,
        "currency": "USD",
        "payment_status": "authorized"
      },
      "created_at": "2024-01-12T00:00:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 10,
    "per_page": 15,
    "total": 145,
    "stats": {
      "upcoming": 25,
      "active": 12,
      "completed": 100,
      "cancelled": 8
    }
  },
  "request_id": "uuid",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

Booking Status Values

StatusDescription
upcomingConfirmed, not yet started
activeCurrently in progress
completedSuccessfully finished
cancelledCancelled by client or admin

Payment Status Values

StatusDescription
pendingAwaiting payment
authorizedPayment authorized, not captured
paidPayment captured
refundedFull refund issued
partial_refundPartial refund issued

Daakey Car Sharing Platform