Skip to content

Booking Details API

Authenticated endpoint for retrieving comprehensive booking details including offer, product, and passenger information.

The Booking Details API provides an admin-only endpoint for accessing complete booking information scoped to specific markets and languages.

Authentication: Requires active admin session (web middleware + auth) and admin role.

Base URL Pattern: /api/{market}/{lang}/bookings/{booking_reference}

GET /api/{market}/{lang}/bookings/{booking_reference}

Section titled “GET /api/{market}/{lang}/bookings/{booking_reference}”

Get complete booking details by reference code.

Parameters:

NameInTypeRequiredDescription
marketpathstringYesMarket code (case-insensitive)
langpathstringYesLanguage code (e.g., “en”, “es”, “ca”)
booking_referencepathstringYesBooking reference code (e.g., “BK-ABC12345”)

Response: 200 OK

{
"data": {
"booking_reference": "BK-ABC12345",
"status": "confirmed",
"status_label": "Confirmed",
"total_amount": "2500.00",
"currency": "EUR",
"currency_symbol": "",
"booked_at": "2024-12-15T10:30:00+00:00",
"number_of_travelers": 2,
"offer": {
"id": 123,
"sku": "ES-5CMB10-CA1-2024-01-15",
"departure_date": "2024-01-15",
"final_price": "1298.00",
"marketing_price_per_pax": "649.00",
"room_type": "double",
"room_type_label": "Double Room",
"departure_airport": {
"iata_code": "BCN",
"name": "Barcelona-El Prat Airport",
"city": "Barcelona"
}
},
"product": {
"id": 10,
"sku": "ES-5CMB10-CA1",
"title": "Tour de Sri Lanka",
"subtitle": "Descobreix l'illa maragda",
"short_description": "Una aventura increible...",
"highlights": ["Sigiriya", "Kandy", "Yala"],
"itinerary": [{"day": 1, "title": "Arrival"}],
"hero_image": "https://cdn.example.com/images/sri-lanka.jpg",
"trip_duration_days": 10
},
"passengers": [
{
"id": 1,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"age_category": "adult",
"date_of_birth": "1985-03-15",
"is_lead_passenger": true,
"email": "john@example.com",
"phone": "+34612345678"
}
],
"hotels": [
{
"name": "Cinnamon Lodge Habarana",
"city": "Habarana",
"nights": 2,
"check_in": "2024-01-15",
"check_out": "2024-01-17",
"image_url": "https://cdn.example.com/hotels/cinnamon.jpg",
"is_upgrade": false
}
],
"flights": {
"cabin_class": "ECONOMY",
"outbound": {
"date": "2024-01-15",
"departure_time": "10:30",
"arrival_time": "23:45",
"departure_airport": { "iata_code": "BCN", "city": "Barcelona" },
"arrival_airport": { "iata_code": "CMB", "city": "Colombo" },
"segments": [
{
"flight_number": "EK186",
"airline_code": "EK",
"departure_airport": { "iata_code": "BCN", "city": "Barcelona" },
"arrival_airport": { "iata_code": "DXB", "city": "Dubai" },
"departure_time": "10:30",
"arrival_time": "20:15"
}
],
"stopovers": [
{ "airport": { "iata_code": "DXB", "city": "Dubai" }, "layover_minutes": 120 }
],
"total_duration_minutes": 795
},
"inbound": {
"date": "2024-01-25",
"departure_time": "01:30",
"arrival_time": "12:15",
"departure_airport": { "iata_code": "CMB", "city": "Colombo" },
"arrival_airport": { "iata_code": "BCN", "city": "Barcelona" },
"segments": [],
"stopovers": [],
"total_duration_minutes": 780
}
}
}
}
{
"message": "Unauthenticated."
}
{
"message": "Access denied. Admin role required."
}

Returned when booking does not exist, or does not belong to requested market/locale.

{
"success": false,
"error": "booking_not_found",
"message": "Booking with reference 'XYZ' not found."
}
{
"success": false,
"error": "language_not_supported",
"message": "Language 'de' is not supported by market 'ES'. Supported languages: es, ca"
}
ComponentFile
Controllerbackend/app/Http/Controllers/Api/BookingController.php
Booking Resourcebackend/app/Http/Resources/BookingDetailsResource.php
Offer Resourcebackend/app/Http/Resources/OfferSummaryResource.php
Passenger Resourcebackend/app/Http/Resources/PassengerSummaryResource.php
Routebackend/routes/api.php (market-scoped routes)