API: Get Booking Details

Request

Retrieve detailed booking information by booking ID:

GET /bookings/{id}

Sample Request:

GET /bookings/5

Sample Response (200 OK):


{
  "status": "success",
  "code": 200,
  "message": "Booking retrieved successfully",
  "data": {
    "booking": {
      "id": 5,
      "pnr_number": "L2DB92GFBG",
      "trip_id": 1,
      "date": "2025-08-18",
      "time": "10:00:00",
      "route_id": 1,
      "boarding_id": 1,
      "dropping_id": 2,
      "total_price": 3000,
      "total_discount": 50,
      "total_amount": 2950,
      "created_at": "2025-08-18T10:30:00.000000Z"
    },
    "customer": {
      "id": 1,
      "name": "John Doe",
      "mobile": "01712345678",
      "email": "john@example.com",
      "gender": "Male",
      "age": 30,
      "address": "123 Main Street, Dhaka",
      "passport_no": null,
      "nid": "1234567890123",
      "nationality": "Bangladeshi"
    },
    "boarding_info": {
      "id": 1,
      "trip_id": 1,
      "time": "08:00:00",
      "counter_id": 1,
      "counter_name": "Kallyanpur Counter",
      "counter_location": "Near Kallyanpur Bus Stand",
      "district_name": "Dhaka"
    },
    "dropping_info": {
      "id": 2,
      "trip_id": 1,
      "time": "14:00:00",
      "counter_id": 2,
      "counter_name": "GEC Counter",
      "counter_location": "GEC Circle",
      "district_name": "Chittagong"
    },
    "trip_details": {
      "trip_id": 1,
      "trip_date": "2025-08-18",
      "status": 1,
      "coach_type": 1,
      "coach_type_name": "AC",
      "coach": {
        "id": 1,
        "coach_no": "101",
        "status": 1
      },
      "bus": {
        "id": 1,
        "registration_number": "DH-123456",
        "manufacturer_company": "Volvo",
        "model_year": 2020
      },
      "route": {
        "id": 1,
        "start_id": 1,
        "end_id": 2,
        "distance": 264,
        "duration": "06:00"
      },
      "schedule": {
        "id": 1,
        "name": "10:00"
      },
      "seat_plan": {
        "id": 1,
        "name": "AC Business",
        "floor": 1,
        "rows": 10,
        "cols": 4
      },
      "driver": {
        "id": 1,
        "name": "Driver Name",
        "contact": "01712345678",
        "license": "DL123456"
      },
      "supervisor": {
        "id": 1,
        "name": "Supervisor Name",
        "contact": "01712345679"
      }
    },
    "booked_seats": [
      {
        "id": 3,
        "booking_id": 5,
        "seat_inventory_id": 1,
        "seat_id": 1,
        "price": "1500.00",
        "discount": "50.00",
        "amount": "1450.00",
        "seat": {
          "id": 1,
          "seat_number": "A1",
          "row_position": 1,
          "col_position": 1,
          "seat_type": "window"
        }
      },
      {
        "id": 4,
        "booking_id": 5,
        "seat_inventory_id": 2,
        "seat_id": 2,
        "price": "1500.00",
        "discount": "0.00",
        "amount": "1500.00",
        "seat": {
          "id": 2,
          "seat_number": "A2",
          "row_position": 1,
          "col_position": 2,
          "seat_type": "middle"
        }
      }
    ]
  }
}
                

Response Structure:

  • booking - Core booking information including PNR, dates, and totals
  • customer - Complete customer details
  • boarding_info - Pickup point details with counter information
  • dropping_info - Drop-off point details with counter information
  • trip_details - Comprehensive trip information including coach, bus, route, schedule
  • booked_seats - Array of all booked seats with pricing and seat details

Key Information:

  • PNR Number - Unique booking identifier for customer reference
  • Total Calculations - Shows price, discount, and final amount
  • Boarding/Dropping Points - Includes counter names, locations, and timing
  • Seat Details - Complete information about each booked seat
  • Trip Information - Full details about the journey including driver and supervisor

Use Cases:

  • Customer Service - Retrieve booking details for customer inquiries
  • Check-in Process - Verify booking information at boarding points
  • Trip Management - View passenger details for trip planning
  • Billing Inquiries - Access pricing and discount information
  • Ticket Verification - Confirm booking validity using PNR

Error Responses:

404 Not Found - Booking Not Found

{
  "status": "error",
  "code": 404,
  "message": "Booking not found",
  "data": null
}
                

Notes:

  • The booking ID is required in the URL to specify which booking to retrieve
  • Response includes complete trip information loaded from partitioned trip instances
  • Boarding and dropping info includes counter details and district information
  • Driver and supervisor information is included when available
  • Seat details include position information for seat map display