{
    "openapi": "3.0.3",
    "info": {
        "title": "Tripanda Unified WebService API (V1 Legacy & V2 Normalized Sabre & Dida Hotels)",
        "description": "Unified multi-vendor travel distribution gateway providing high-performance Sabre Flight shopping, booking, ticketing (supporting V1 EDIFACT and V2 Normalized Multi-Source & NDC), and Dida Travel Hotel search, pricing, and reservation services.",
        "version": "1.1.0",
        "contact": {
            "name": "Tripanda Engineering",
            "email": "dev@tripanda.com"
        }
    },
    "servers": [
        {
            "url": "http://127.0.0.1:8000",
            "description": "Local Development Server"
        },
        {
            "url": "https://webservices.tripanda.com",
            "description": "Production WebService Gateway"
        }
    ],
    "tags": [
        {
            "name": "User Authentication & Sessions",
            "description": "Admin and client authentication, session tokens, and identity inspection"
        },
        {
            "name": "Authentication & Session",
            "description": "Sabre REST OAuth and SOAP XML Session management"
        },
        {
            "name": "Shopping & Search",
            "description": "Bargain Finder Max flight search and itinerary revalidation"
        },
        {
            "name": "Booking & Ticketing",
            "description": "PNR creation and air ticket issuance"
        },
        {
            "name": "Fares & Rules",
            "description": "Fare rules and LLSRQ queries"
        },
        {
            "name": "Audit & Logs",
            "description": "Transaction and ticket issuance audit trails"
        },
        {
            "name": "Hotel - Discovery & Suggestions",
            "description": "Realtime hotel search, instant suggestions, and query autocomplete"
        },
        {
            "name": "Hotel - Pricing & Confirmation",
            "description": "Multi-hotel pricing, lowest price rate shopping, and real-time rate confirmation"
        },
        {
            "name": "Hotel - Booking & Reservations",
            "description": "Pre-booking verification, reservation creation, and booking cancellation"
        },
        {
            "name": "Hotel - Dictionaries & Catalogs",
            "description": "Standardized room categories, bed types, amenities, country catalogs, and destination indexes"
        },
        {
            "name": "Sabre Flights V2 (Normalized Multi-Source & NDC)",
            "description": "Unified V2 distribution API combining ATPCO (EDIFACT), LCC, and New Distribution Capability (NDC) with standardized response schema"
        },
        {
            "name": "System Health & Diagnostics",
            "description": "Real-time telemetry, service latency, and database health probes"
        },
        {
            "name": "Payment Gateway (Billplz)",
            "description": "Online FPX, card, and e-wallet checkout integration powered by Billplz API v3"
        }
    ],
    "paths": {
        "/api/v2/sabre/flights/search": {
            "post": {
                "tags": [
                    "Sabre Flights V2 (Normalized Multi-Source & NDC)"
                ],
                "summary": "Multi-Source Flight Shopping (ATPCO + NDC)",
                "description": "Searches flights across both traditional GDS (ATPCO/EDIFACT) and NDC direct-connect airlines in a single normalized response.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "tripType",
                                    "from",
                                    "to",
                                    "departureDate"
                                ],
                                "properties": {
                                    "tripType": {
                                        "type": "string",
                                        "enum": [
                                            "oneWay",
                                            "return",
                                            "multiCity"
                                        ],
                                        "example": "oneWay"
                                    },
                                    "from": {
                                        "type": "string",
                                        "example": "KUL"
                                    },
                                    "to": {
                                        "type": "string",
                                        "example": "LHR"
                                    },
                                    "departureDate": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-11-01"
                                    },
                                    "arrivalDate": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-11-10"
                                    },
                                    "adult": {
                                        "type": "integer",
                                        "default": 1,
                                        "example": 1
                                    },
                                    "child": {
                                        "type": "integer",
                                        "default": 0,
                                        "example": 0
                                    },
                                    "infant": {
                                        "type": "integer",
                                        "default": 0,
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Standardized Normalized Flights",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "status": "OK",
                                    "data": {
                                        "total_options": 15,
                                        "flights": [
                                            {
                                                "id": "FLIGHT-0001",
                                                "source": "NDC",
                                                "is_ndc": true,
                                                "offer_id": "NDCOFFER-MH-12345",
                                                "pricing": {
                                                    "currency": "MYR",
                                                    "base_fare": 1250.0,
                                                    "taxes": 180.5,
                                                    "total": 1430.5
                                                },
                                                "legs": []
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/sabre/flights/price": {
            "post": {
                "tags": [
                    "Sabre Flights V2 (Normalized Multi-Source & NDC)"
                ],
                "summary": "Verify & Revalidate Flight Price",
                "description": "Dynamically verifies flight price routing to /v1/offers/price for NDC or RevalidateItineraryRQ for ATPCO.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "is_ndc": {
                                        "type": "boolean",
                                        "description": "Set true for NDC offer, false for ATPCO revalidation",
                                        "example": false
                                    },
                                    "offer_id": {
                                        "type": "string",
                                        "description": "Required if is_ndc is true",
                                        "example": "NDCOFFER-MH-12345"
                                    },
                                    "originDestinationInformation": {
                                        "type": "array",
                                        "description": "Required if is_ndc is false (ATPCO physical segments)",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "OriginLocation": {
                                                    "type": "object",
                                                    "properties": {
                                                        "LocationCode": {
                                                            "type": "string",
                                                            "example": "KUL"
                                                        }
                                                    }
                                                },
                                                "DestinationLocation": {
                                                    "type": "object",
                                                    "properties": {
                                                        "LocationCode": {
                                                            "type": "string",
                                                            "example": "JED"
                                                        }
                                                    }
                                                },
                                                "DepartureDateTime": {
                                                    "type": "string",
                                                    "example": "2026-11-01T00:00:00"
                                                },
                                                "Flights": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "flightNo": {
                                                                "type": "string",
                                                                "example": "831"
                                                            },
                                                            "marketing": {
                                                                "type": "string",
                                                                "example": "OD"
                                                            },
                                                            "typeForFirstLeg": {
                                                                "type": "string",
                                                                "example": "Y"
                                                            },
                                                            "origin": {
                                                                "type": "string",
                                                                "example": "KUL"
                                                            },
                                                            "destination": {
                                                                "type": "string",
                                                                "example": "JED"
                                                            },
                                                            "departureDateFlight": {
                                                                "type": "string",
                                                                "example": "2026-11-01T11:00:00"
                                                            },
                                                            "arrivalDateFlight": {
                                                                "type": "string",
                                                                "example": "2026-11-01T16:00:00"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "adults": {
                                        "type": "integer",
                                        "default": 1,
                                        "example": 1
                                    },
                                    "children": {
                                        "type": "integer",
                                        "default": 0,
                                        "example": 0
                                    },
                                    "infants": {
                                        "type": "integer",
                                        "default": 0,
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Revalidated Price Response",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "source": "ATPCO",
                                    "message": "Price revalidated successfully against live Sabre GDS inventory.",
                                    "data": {
                                        "total_options": 1,
                                        "flights": []
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/sabre/bookings/create": {
            "post": {
                "tags": [
                    "Sabre Flights V2 (Normalized Multi-Source & NDC)"
                ],
                "summary": "Create Normalized Booking (ATPCO PNR or NDC Order)",
                "description": "Uses Sabre Booking Management API (/v1/trip/orders/createBooking) to create reservations across all airline channels.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Booking created"
                    }
                }
            }
        },
        "/api/v2/sabre/bookings/fulfill": {
            "post": {
                "tags": [
                    "Sabre Flights V2 (Normalized Multi-Source & NDC)"
                ],
                "summary": "Fulfill Tickets or Orders",
                "description": "Fulfills e-tickets or NDC orders using /v1/orders/fulfilFlightTickets.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "confirmationId"
                                ],
                                "properties": {
                                    "confirmationId": {
                                        "type": "string",
                                        "example": "ABCDEF"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Tickets fulfilled"
                    }
                }
            }
        },
        "/api/v2/sabre/bookings/{id}": {
            "get": {
                "tags": [
                    "Sabre Flights V2 (Normalized Multi-Source & NDC)"
                ],
                "summary": "Retrieve Booking by ID / PNR",
                "description": "Retrieves booking details using Sabre Booking Management API.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "example": "ABCDEF"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Booking details"
                    }
                }
            }
        },
        "/api/v2/sabre/bookings/{id}/cancel": {
            "post": {
                "tags": [
                    "Sabre Flights V2 (Normalized Multi-Source & NDC)"
                ],
                "summary": "Cancel Booking by ID / PNR",
                "description": "Cancels reservation using Sabre Booking Management cancelBooking API.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "example": "ABCDEF"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Booking cancelled"
                    }
                }
            }
        },
        "/api/v1/product_sabre/airports": {
            "get": {
                "tags": [
                    "Flight Search & Availability"
                ],
                "summary": "Search Global Airports Directory",
                "description": "Search 6,900+ global airports by IATA code, city name, airport name, or country.",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "required": false,
                        "description": "Airport search term (e.g. KUL, London, Jeddah)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of results to return (default: 50, max: 200)",
                        "schema": {
                            "type": "integer",
                            "default": 50
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of matching airports",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "code": {
                                                        "type": "string",
                                                        "example": "KUL"
                                                    },
                                                    "iata": {
                                                        "type": "string",
                                                        "example": "KUL"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Kuala Lumpur International Airport"
                                                    },
                                                    "city": {
                                                        "type": "string",
                                                        "example": "Kuala Lumpur"
                                                    },
                                                    "country": {
                                                        "type": "string",
                                                        "example": "MY"
                                                    },
                                                    "state": {
                                                        "type": "string",
                                                        "example": "Selangor"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/product_sabre/airlines": {
            "get": {
                "tags": [
                    "Flight Search & Availability"
                ],
                "summary": "Search Global Airlines Directory",
                "description": "Search 250+ world airlines by 2-letter IATA carrier code or airline name.",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "required": false,
                        "description": "Carrier code or name query (e.g. MH, Emirates)",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of matching airlines",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "code": {
                                                        "type": "string",
                                                        "example": "MH"
                                                    },
                                                    "iata": {
                                                        "type": "string",
                                                        "example": "MH"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Malaysia Airlines"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/product_sabre/session_token": {
            "get": {
                "tags": [
                    "Authentication & Session"
                ],
                "summary": "Check or Refresh Sabre Session Token",
                "description": "Retrieves the active cached token from database or triggers a fresh authentication if expired.",
                "responses": {
                    "200": {
                        "description": "Active Sabre session token string",
                        "content": {
                            "text/plain": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/product_sabre/auth/getToken": {
            "get": {
                "tags": [
                    "Authentication & Session"
                ],
                "summary": "Force Request New Sabre OAuth Token",
                "description": "Performs client_credentials OAuth authentication against Sabre REST endpoint and updates the database token store.",
                "responses": {
                    "200": {
                        "description": "New bearer token string",
                        "content": {
                            "text/plain": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/product_sabre/token_soap": {
            "post": {
                "tags": [
                    "Authentication & Session"
                ],
                "summary": "Create Sabre SOAP Session (BinarySecurityToken)",
                "description": "Sends a SessionCreateRQ SOAP envelope to Sabre XML platform and returns the BinarySecurityToken.",
                "responses": {
                    "200": {
                        "description": "SOAP BinarySecurityToken string"
                    }
                }
            }
        },
        "/api/v1/product_sabre/bargain_max": {
            "post": {
                "tags": [
                    "Shopping & Search"
                ],
                "summary": "Bargain Finder Max Flight Search",
                "description": "Searches for flight itineraries and fares using Sabre OTA_AirLowFareSearchRQ v6.8.0.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "tripType",
                                    "from",
                                    "to",
                                    "departureDate",
                                    "adult"
                                ],
                                "properties": {
                                    "tripType": {
                                        "type": "string",
                                        "enum": [
                                            "oneWay",
                                            "return",
                                            "multiCity"
                                        ]
                                    },
                                    "from": {
                                        "type": "string",
                                        "example": "KUL"
                                    },
                                    "to": {
                                        "type": "string",
                                        "example": "JED"
                                    },
                                    "departureDate": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-11-01"
                                    },
                                    "arrivalDate": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-11-15"
                                    },
                                    "adult": {
                                        "type": "integer",
                                        "default": 1
                                    },
                                    "child": {
                                        "type": "integer",
                                        "default": 0
                                    },
                                    "infant": {
                                        "type": "integer",
                                        "default": 0
                                    },
                                    "cabin": {
                                        "type": "string",
                                        "example": "Y"
                                    },
                                    "stop": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Grouped itinerary search results"
                    }
                }
            }
        },
        "/api/v1/product_sabre/revalidate_itinerary": {
            "post": {
                "tags": [
                    "Shopping & Search"
                ],
                "summary": "Revalidate Selected Itinerary",
                "description": "Validates flight schedule, seat availability, and fare before booking.",
                "responses": {
                    "200": {
                        "description": "Revalidated itinerary results"
                    }
                }
            }
        },
        "/api/v1/product_sabre/create_pnr": {
            "post": {
                "tags": [
                    "Booking & Ticketing"
                ],
                "summary": "Create Passenger Name Record (PNR)",
                "description": "Creates an official passenger booking with Sabre GDS via CreatePassengerNameRecordRQ v2.5.0. Commits itinerary flight segments, traveler details, SSR contacts (CTCM/CTCE), and optional passport data. Note: Do not pass the raw search envelope ('flightDetails'); extract selected segments into 'originDestinationInformation', format traveler details into 'passengers', and attach 'contact'.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "contact",
                                    "passengers",
                                    "originDestinationInformation"
                                ],
                                "properties": {
                                    "contact": {
                                        "type": "object",
                                        "required": [
                                            "phone",
                                            "email"
                                        ],
                                        "properties": {
                                            "phone": {
                                                "type": "string",
                                                "example": "+60123456789",
                                                "description": "Customer contact mobile phone number (used for Sabre CTCM SSR)"
                                            },
                                            "email": {
                                                "type": "string",
                                                "format": "email",
                                                "example": "booking@tripanda.com",
                                                "description": "Customer contact email address (used for Sabre CTCE SSR)"
                                            }
                                        }
                                    },
                                    "passengers": {
                                        "type": "array",
                                        "description": "List of passenger travelers",
                                        "items": {
                                            "type": "object",
                                            "required": [
                                                "type",
                                                "givenName",
                                                "surname"
                                            ],
                                            "properties": {
                                                "type": {
                                                    "type": "string",
                                                    "enum": [
                                                        "ADT",
                                                        "CNN",
                                                        "INF"
                                                    ],
                                                    "example": "ADT",
                                                    "description": "Passenger code: ADT (Adult), CNN (Child), INF (Infant)"
                                                },
                                                "givenName": {
                                                    "type": "string",
                                                    "example": "MUHAMMAD MRS",
                                                    "description": "Given Name including title suffix"
                                                },
                                                "surname": {
                                                    "type": "string",
                                                    "example": "SHAM",
                                                    "description": "Family surname"
                                                },
                                                "dob": {
                                                    "type": "string",
                                                    "format": "date",
                                                    "example": "1990-05-15",
                                                    "description": "Date of birth in YYYY-MM-DD format (mandatory for CNN/INF)"
                                                },
                                                "gender": {
                                                    "type": "string",
                                                    "enum": [
                                                        "M",
                                                        "F",
                                                        "MI",
                                                        "FI"
                                                    ],
                                                    "example": "M",
                                                    "description": "Gender code"
                                                },
                                                "passport": {
                                                    "type": "object",
                                                    "properties": {
                                                        "number": {
                                                            "type": "string",
                                                            "example": "A12345678"
                                                        },
                                                        "expirationDate": {
                                                            "type": "string",
                                                            "format": "date",
                                                            "example": "2030-05-15"
                                                        },
                                                        "issueCountry": {
                                                            "type": "string",
                                                            "example": "MYS"
                                                        },
                                                        "nationalityCountry": {
                                                            "type": "string",
                                                            "example": "MYS"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "originDestinationInformation": {
                                        "type": "array",
                                        "description": "Flight itinerary legs to book",
                                        "items": {
                                            "type": "object",
                                            "required": [
                                                "Flights"
                                            ],
                                            "properties": {
                                                "Flights": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "required": [
                                                            "departureDateFlight",
                                                            "flightNo",
                                                            "marketing",
                                                            "origin",
                                                            "destination",
                                                            "typeForFirstLeg"
                                                        ],
                                                        "properties": {
                                                            "departureDateFlight": {
                                                                "type": "string",
                                                                "example": "2026-11-27T08:15:00",
                                                                "description": "Departure date and time in ISO format YYYY-MM-DDTHH:mm:ss"
                                                            },
                                                            "flightNo": {
                                                                "type": "string",
                                                                "example": "1326",
                                                                "description": "Flight number (numeric or with airline code)"
                                                            },
                                                            "marketing": {
                                                                "type": "string",
                                                                "example": "MH",
                                                                "description": "2-letter IATA marketing carrier code"
                                                            },
                                                            "origin": {
                                                                "type": "string",
                                                                "example": "KUL",
                                                                "description": "3-letter IATA origin airport code"
                                                            },
                                                            "destination": {
                                                                "type": "string",
                                                                "example": "TGG",
                                                                "description": "3-letter IATA destination airport code"
                                                            },
                                                            "typeForFirstLeg": {
                                                                "type": "string",
                                                                "example": "O",
                                                                "description": "ResBookDesigCode / Booking class / RBD"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "PNR confirmation reference and booking details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "PNR created successfully."
                                        },
                                        "pnr": {
                                            "type": "string",
                                            "example": "ABC123PNR"
                                        },
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/product_sabre/ticket_issue": {
            "post": {
                "tags": [
                    "Booking & Ticketing"
                ],
                "summary": "Issue Electronic Airline Ticket",
                "description": "Executes AirTicketRQ v1.3.0 against a confirmed PNR, issues 13-digit e-ticket numbers, logs records in sabre_ticketIssue, and dispatches the official Tripanda E-Ticket Receipt email directly to the passenger.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "pnr"
                                ],
                                "properties": {
                                    "pnr": {
                                        "type": "string",
                                        "description": "6-character Sabre alphanumeric Record Locator / PNR",
                                        "example": "PYDRQX"
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "description": "Optional custom recipient email address for the e-ticket receipt (defaults to booking contact email)",
                                        "example": "passenger@tripanda.com"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Ticket issued successfully and official e-ticket receipt dispatched to passenger",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "object",
                                            "properties": {
                                                "success": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "example": 200
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "example": "Ticket issued successfully (Ticket #8164884612057 sent to passenger@tripanda.com)"
                                                }
                                            }
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "pnr": {
                                                    "type": "string",
                                                    "example": "PYDRQX"
                                                },
                                                "airline_pnr": {
                                                    "type": "string",
                                                    "example": "PTJTHH"
                                                },
                                                "ticket_number": {
                                                    "type": "string",
                                                    "example": "8164884612057"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "example": "ISSUED"
                                                },
                                                "passenger_name": {
                                                    "type": "string",
                                                    "example": "SYAZWAN NOR"
                                                },
                                                "recipient_email": {
                                                    "type": "string",
                                                    "example": "passenger@tripanda.com"
                                                },
                                                "email_sent": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "total_amount": {
                                                    "type": "string",
                                                    "example": "482.00"
                                                },
                                                "currency": {
                                                    "type": "string",
                                                    "example": "MYR"
                                                },
                                                "tickets": {
                                                    "type": "array"
                                                },
                                                "flight_segments": {
                                                    "type": "array"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/product_sabre/fare": {
            "post": {
                "tags": [
                    "Fares & Rules"
                ],
                "summary": "Retrieve Fare Rules",
                "description": "Queries OTA_AirRulesLLSRQ via SOAP XML for detailed fare rules and paragraph breakdown.",
                "responses": {
                    "200": {
                        "description": "Fare rule details"
                    }
                }
            }
        },
        "/api/v1/product_sabre/view-log": {
            "post": {
                "tags": [
                    "Audit & Logs"
                ],
                "summary": "View Sabre API Transaction Logs",
                "description": "Paginated list of Sabre API requests and responses from sabre_log.",
                "responses": {
                    "200": {
                        "description": "Paginated log entries"
                    }
                }
            }
        },
        "/api/v1/product_sabre/ticket-issued": {
            "post": {
                "tags": [
                    "Audit & Logs"
                ],
                "summary": "View Ticket Issuance Records",
                "description": "Paginated list of issued tickets from sabre_ticketIssue.",
                "responses": {
                    "200": {
                        "description": "Paginated ticket issuance list"
                    }
                }
            }
        },
        "/api/v1/hotel/search/suggestions": {
            "get": {
                "tags": [
                    "Hotel - Discovery & Suggestions"
                ],
                "summary": "Hotel & Destination Autocomplete Suggestions",
                "description": "Provides instant auto-suggest results for hotel names and destinations with normalized text matching.",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "Kuala Lumpur"
                        },
                        "description": "Keyword search query (minimum 2 characters)"
                    },
                    {
                        "name": "countryCode",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "MY"
                        },
                        "description": "Two-letter ISO country code"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation with standardized Tripanda envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "Code": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "Message": {
                                            "type": "string",
                                            "example": "Success"
                                        },
                                        "Data": {
                                            "type": "object"
                                        },
                                        "ExtraInfo": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/hotel/search/realtime": {
            "post": {
                "tags": [
                    "Hotel - Discovery & Suggestions"
                ],
                "summary": "Realtime Hotel Search",
                "description": "Executes real-time availability and dynamic pricing lookup across candidate hotels with Redis caching.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "CheckInDate",
                                    "CheckOutDate",
                                    "HotelIDList"
                                ],
                                "properties": {
                                    "CheckInDate": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-11-01"
                                    },
                                    "CheckOutDate": {
                                        "type": "string",
                                        "format": "date",
                                        "example": "2026-11-04"
                                    },
                                    "HotelIDList": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "example": [
                                            10001,
                                            10002
                                        ]
                                    },
                                    "Nationality": {
                                        "type": "string",
                                        "example": "MY"
                                    },
                                    "Currency": {
                                        "type": "string",
                                        "example": "MYR"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation with standardized Tripanda envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "Code": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "Message": {
                                            "type": "string",
                                            "example": "Success"
                                        },
                                        "Data": {
                                            "type": "object"
                                        },
                                        "ExtraInfo": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/hotel/dida/search-hotel-prices": {
            "post": {
                "tags": [
                    "Hotel - Pricing & Confirmation"
                ],
                "summary": "Search Hotel Prices Multi",
                "description": "Batch searches dynamic hotel rates and room plans across multiple hotel IDs.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "CheckInDate",
                                    "CheckOutDate",
                                    "HotelIDList"
                                ],
                                "properties": {
                                    "CheckInDate": {
                                        "type": "string",
                                        "example": "2026-11-01"
                                    },
                                    "CheckOutDate": {
                                        "type": "string",
                                        "example": "2026-11-03"
                                    },
                                    "HotelIDList": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "example": [
                                            10001
                                        ]
                                    },
                                    "NumOfRooms": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "Nationality": {
                                        "type": "string",
                                        "example": "MY"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation with standardized Tripanda envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "Code": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "Message": {
                                            "type": "string",
                                            "example": "Success"
                                        },
                                        "Data": {
                                            "type": "object"
                                        },
                                        "ExtraInfo": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/hotel/dida/confirm-price": {
            "post": {
                "tags": [
                    "Hotel - Pricing & Confirmation"
                ],
                "summary": "Confirm Live Hotel Rate Before Booking",
                "description": "Re-verifies rate plan availability and pricing with Dida prior to booking creation.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "RatePlanID",
                                    "CheckInDate",
                                    "CheckOutDate",
                                    "HotelID"
                                ],
                                "properties": {
                                    "RatePlanID": {
                                        "type": "string",
                                        "example": "RP-1001"
                                    },
                                    "CheckInDate": {
                                        "type": "string",
                                        "example": "2026-11-01"
                                    },
                                    "CheckOutDate": {
                                        "type": "string",
                                        "example": "2026-11-03"
                                    },
                                    "HotelID": {
                                        "type": "integer",
                                        "example": 10001
                                    },
                                    "NumOfRooms": {
                                        "type": "integer",
                                        "example": 1
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation with standardized Tripanda envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "Code": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "Message": {
                                            "type": "string",
                                            "example": "Success"
                                        },
                                        "Data": {
                                            "type": "object"
                                        },
                                        "ExtraInfo": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/hotel/dida/pre-booking": {
            "post": {
                "tags": [
                    "Hotel - Booking & Reservations"
                ],
                "summary": "Create Hotel Pre-Booking",
                "description": "Initializes a provisional reservation record and generates a pre-booking token.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "HotelID",
                                    "RatePlanID",
                                    "CheckInDate",
                                    "CheckOutDate",
                                    "GuestList"
                                ],
                                "properties": {
                                    "HotelID": {
                                        "type": "integer",
                                        "example": 10001
                                    },
                                    "RatePlanID": {
                                        "type": "string",
                                        "example": "RP-1001"
                                    },
                                    "CheckInDate": {
                                        "type": "string",
                                        "example": "2026-11-01"
                                    },
                                    "CheckOutDate": {
                                        "type": "string",
                                        "example": "2026-11-03"
                                    },
                                    "GuestList": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "FirstName": {
                                                    "type": "string",
                                                    "example": "Ahmad"
                                                },
                                                "LastName": {
                                                    "type": "string",
                                                    "example": "Razak"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation with standardized Tripanda envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "Code": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "Message": {
                                            "type": "string",
                                            "example": "Success"
                                        },
                                        "Data": {
                                            "type": "object"
                                        },
                                        "ExtraInfo": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/hotel/dida/booking-confirm": {
            "post": {
                "tags": [
                    "Hotel - Booking & Reservations"
                ],
                "summary": "Confirm Final Hotel Booking",
                "description": "Finalizes the hotel reservation and commits the booking with Dida.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "PreBookingID"
                                ],
                                "properties": {
                                    "PreBookingID": {
                                        "type": "string",
                                        "example": "PB-20261001-001"
                                    },
                                    "CustomerReference": {
                                        "type": "string",
                                        "example": "TP-REF-9988"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation with standardized Tripanda envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "Code": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "Message": {
                                            "type": "string",
                                            "example": "Success"
                                        },
                                        "Data": {
                                            "type": "object"
                                        },
                                        "ExtraInfo": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/hotel/dida/bed-type": {
            "post": {
                "tags": [
                    "Hotel - Dictionaries & Catalogs"
                ],
                "summary": "Query Standard Bed Types",
                "description": "Retrieves the standard bed type dictionary from Dida Travel.",
                "responses": {
                    "200": {
                        "description": "Successful operation with standardized Tripanda envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "Code": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "Message": {
                                            "type": "string",
                                            "example": "Success"
                                        },
                                        "Data": {
                                            "type": "object"
                                        },
                                        "ExtraInfo": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/hotel/dida/breakfast-type": {
            "post": {
                "tags": [
                    "Hotel - Dictionaries & Catalogs"
                ],
                "summary": "Query Standard Breakfast Types",
                "description": "Retrieves the standard breakfast type classification.",
                "responses": {
                    "200": {
                        "description": "Successful operation with standardized Tripanda envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "Code": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "Message": {
                                            "type": "string",
                                            "example": "Success"
                                        },
                                        "Data": {
                                            "type": "object"
                                        },
                                        "ExtraInfo": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/hotel/dida/meal-type": {
            "post": {
                "tags": [
                    "Hotel - Dictionaries & Catalogs"
                ],
                "summary": "Query Standard Meal Types",
                "description": "Retrieves meal plan options (e.g. Room Only, Bed & Breakfast, Half Board, All Inclusive).",
                "responses": {
                    "200": {
                        "description": "Successful operation with standardized Tripanda envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "Code": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "Message": {
                                            "type": "string",
                                            "example": "Success"
                                        },
                                        "Data": {
                                            "type": "object"
                                        },
                                        "ExtraInfo": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/hotel/dida/countries": {
            "get": {
                "tags": [
                    "Hotel - Dictionaries & Catalogs"
                ],
                "summary": "List Available Countries",
                "description": "Returns ISO country catalog for destination search and filtering.",
                "responses": {
                    "200": {
                        "description": "Successful operation with standardized Tripanda envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "Code": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "Message": {
                                            "type": "string",
                                            "example": "Success"
                                        },
                                        "Data": {
                                            "type": "object"
                                        },
                                        "ExtraInfo": {
                                            "type": "object",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/auth/login": {
            "post": {
                "tags": [
                    "User Authentication & Sessions"
                ],
                "summary": "User & Admin Login",
                "description": "Authenticate user credentials against staging/production database and return a session token.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "email",
                                    "password"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "admin@tripanda.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "password123"
                                    },
                                    "remember": {
                                        "type": "boolean",
                                        "example": true
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Authentication successful with session token and user profile",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Login successful."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "token": {
                                                    "type": "string",
                                                    "example": "xW9Q272B7CG8o11YUJbEqgLS4BR0QrSi..."
                                                },
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer",
                                                            "example": 1
                                                        },
                                                        "name": {
                                                            "type": "string",
                                                            "example": "Tripanda Administrator"
                                                        },
                                                        "email": {
                                                            "type": "string",
                                                            "example": "admin@tripanda.com"
                                                        },
                                                        "role": {
                                                            "type": "string",
                                                            "example": "Operations Administrator"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Invalid credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Invalid email or password."
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many login attempts. Rate limited."
                    }
                }
            }
        },
        "/api/v1/auth/me": {
            "get": {
                "tags": [
                    "User Authentication & Sessions"
                ],
                "summary": "Get Authenticated User Profile",
                "description": "Returns current logged in user details using Bearer session token.",
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Current user profile",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer",
                                                            "example": 1
                                                        },
                                                        "name": {
                                                            "type": "string",
                                                            "example": "Tripanda Administrator"
                                                        },
                                                        "email": {
                                                            "type": "string",
                                                            "example": "admin@tripanda.com"
                                                        },
                                                        "role": {
                                                            "type": "string",
                                                            "example": "Operations Administrator"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated or invalid token"
                    }
                }
            }
        },
        "/api/v1/auth/logout": {
            "post": {
                "tags": [
                    "User Authentication & Sessions"
                ],
                "summary": "Logout & Invalidate Session",
                "description": "Invalidates the current session token.",
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Logout successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Successfully logged out."
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/auth/sessions": {
            "get": {
                "tags": [
                    "User Authentication & Sessions"
                ],
                "summary": "List Active Devices & Sessions",
                "description": "Returns list of all active devices currently logged into this user account.",
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of active devices",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "allow_multiple_devices": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "sessions": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "device_name": {
                                                                "type": "string",
                                                                "example": "Windows (Chrome)"
                                                            },
                                                            "ip_address": {
                                                                "type": "string",
                                                                "example": "127.0.0.1"
                                                            },
                                                            "is_current": {
                                                                "type": "boolean",
                                                                "example": true
                                                            },
                                                            "last_activity_at": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/auth/logout-other-devices": {
            "post": {
                "tags": [
                    "User Authentication & Sessions"
                ],
                "summary": "Revoke All Other Devices",
                "description": "Logs out all other devices logged into this user account except the current device.",
                "security": [
                    {
                        "BearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Other devices successfully revoked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Successfully logged out 2 other device(s)."
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "revoked_count": {
                                                    "type": "integer",
                                                    "example": 2
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/health": {
            "get": {
                "tags": [
                    "System Health & Diagnostics"
                ],
                "summary": "System Diagnostic Health Check",
                "description": "Returns real-time operational status, database latency, Sabre GDS endpoint connectivity, and memory cache diagnostics.",
                "responses": {
                    "200": {
                        "description": "Comprehensive health status JSON envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "healthy"
                                        },
                                        "app_name": {
                                            "type": "string",
                                            "example": "Tripanda Webservice"
                                        },
                                        "environment": {
                                            "type": "string",
                                            "example": "production"
                                        },
                                        "sabre_env": {
                                            "type": "string",
                                            "example": "prod"
                                        },
                                        "latency_ms": {
                                            "type": "number",
                                            "example": 12.45
                                        },
                                        "services": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/product_sabre/resend_eticket": {
            "post": {
                "tags": [
                    "Booking & Ticketing"
                ],
                "summary": "Resend E-Ticket Email",
                "description": "Calls Sabre Update Passenger Name Record REST API (v1.1.0) with PostProcessing.EndTransaction.EmailInd=true to send or resend official passenger e-ticket itinerary email with all confirmed ticket numbers.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/XOriginEnv"
                    },
                    {
                        "$ref": "#/components/parameters/XOriginDomain"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "pnr"
                                ],
                                "properties": {
                                    "pnr": {
                                        "type": "string",
                                        "description": "6-character Sabre alphanumeric Record Locator / PNR",
                                        "example": "SAYQKU"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "E-Ticket email queued and dispatched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "status": {
                                            "type": "object",
                                            "properties": {
                                                "success": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "code": {
                                                    "type": "integer",
                                                    "example": 200
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "example": "E-Ticket email resent successfully for PNR SAYQKU"
                                                }
                                            }
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "pnr": {
                                                    "type": "string",
                                                    "example": "SAYQKU"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "example": "Complete"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failure (missing PNR parameter)"
                    },
                    "502": {
                        "description": "Sabre upstream error or failure to commit email delivery"
                    }
                }
            }
        },
        "/api/v1/product_sabre/get_pnr": {
            "post": {
                "tags": [
                    "Booking & Ticketing"
                ],
                "summary": "Get Live PNR / Booking Details",
                "description": "Retrieves real-time Sabre booking and ticket status via /v1/trip/orders/getBooking with passenger, flight segment, and electronic ticket details.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/XOriginEnv"
                    },
                    {
                        "$ref": "#/components/parameters/XOriginDomain"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "pnr"
                                ],
                                "properties": {
                                    "pnr": {
                                        "type": "string",
                                        "description": "Sabre confirmation code / PNR",
                                        "example": "SKFLTT"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Live PNR booking details retrieved successfully"
                    },
                    "404": {
                        "description": "PNR not found in Sabre"
                    }
                }
            }
        },
        "/api/v1/product_sabre/cancel_pnr": {
            "post": {
                "tags": [
                    "Booking & Ticketing"
                ],
                "summary": "Cancel Live PNR Booking",
                "description": "Cancels active reservation segments in Sabre via /v1/trip/orders/cancelBooking and updates local status.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/XOriginEnv"
                    },
                    {
                        "$ref": "#/components/parameters/XOriginDomain"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "pnr"
                                ],
                                "properties": {
                                    "pnr": {
                                        "type": "string",
                                        "description": "Sabre confirmation code / PNR to cancel",
                                        "example": "SKFLTT"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "PNR cancelled successfully in Sabre"
                    },
                    "404": {
                        "description": "Booking not found in Sabre"
                    }
                }
            }
        },
        "/api/v1/hotel/dida/test": {
            "post": {
                "tags": [
                    "Hotel - Dictionaries & Catalogs",
                    "System Health & Diagnostics"
                ],
                "summary": "Test & Diagnose Dida API Gateway Connection",
                "description": "Executes a live network and credential diagnostic test against Dida Travel API Gateway (/api/v1/region/countries). Validates TLS handshake, HTTP status code, latency, and Dida authentication.",
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "env": {
                                        "type": "string",
                                        "example": "staging",
                                        "description": "Target environment: staging, live, or sandbox"
                                    },
                                    "base_url": {
                                        "type": "string",
                                        "example": "https://static-apiint.didatravel.com",
                                        "description": "Custom gateway base URL"
                                    },
                                    "client_id": {
                                        "type": "string",
                                        "example": "AndalusiaMY",
                                        "description": "Optional Client ID override"
                                    },
                                    "license_key": {
                                        "type": "string",
                                        "example": "your-dida-license-key",
                                        "description": "Optional License Key override"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Dida gateway reached and authentication successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "Code": {
                                            "type": "integer",
                                            "example": 200
                                        },
                                        "Message": {
                                            "type": "string",
                                            "example": "Dida Travel API gateway connection successful (staging)"
                                        },
                                        "Data": {
                                            "type": "object",
                                            "properties": {
                                                "connected": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "authenticated": {
                                                    "type": "boolean",
                                                    "example": true
                                                },
                                                "latency_ms": {
                                                    "type": "number",
                                                    "example": 124.5
                                                },
                                                "status_code": {
                                                    "type": "integer",
                                                    "example": 200
                                                },
                                                "countries_count": {
                                                    "type": "integer",
                                                    "example": 240
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Gateway reached but credentials rejected or connection error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "Code": {
                                            "type": "integer",
                                            "example": 422
                                        },
                                        "Message": {
                                            "type": "string",
                                            "example": "Dida gateway reachable, but rejected credentials: Invalid authorization (3)."
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "tags": [
                    "Hotel - Dictionaries & Catalogs",
                    "System Health & Diagnostics"
                ],
                "summary": "Ping Dida API Gateway",
                "description": "Fast probe validating Dida API Gateway connectivity and TLS certificate status.",
                "responses": {
                    "200": {
                        "description": "Gateway operational"
                    },
                    "422": {
                        "description": "Credential or connectivity warning"
                    }
                }
            }
        },
        "/api/v1/hotel/dida/test/{hotelid}": {
            "post": {
                "tags": [
                    "Hotel - Dictionaries & Catalogs",
                    "System Health & Diagnostics"
                ],
                "summary": "Test Dida Content API with Hotel Detail",
                "description": "Executes a live request to Dida Content API v2 (/api/v1/hotel/details) for the specified hotel ID (e.g. 2282117), testing Basic Auth credentials, connectivity, and latency.",
                "parameters": [
                    {
                        "name": "hotelid",
                        "in": "path",
                        "required": true,
                        "description": "Dida Hotel ID (e.g. 2282117)",
                        "schema": {
                            "type": "integer",
                            "default": 2282117
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "env": {
                                        "type": "string",
                                        "example": "staging"
                                    },
                                    "client_id": {
                                        "type": "string",
                                        "example": "AndalusiaMY"
                                    },
                                    "license_key": {
                                        "type": "string",
                                        "example": "your-dida-license-key"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Dida Content API hotel_detail successful"
                    },
                    "422": {
                        "description": "Dida credential or upstream rejection"
                    }
                }
            }
        },
        "/api/v1/payment/checkout": {
            "post": {
                "tags": [
                    "Payment Gateway (Billplz)"
                ],
                "summary": "Initiate Payment Checkout (Flights & Hotels)",
                "description": "Creates a Billplz payment bill for flight (Sabre PNR) or hotel (Dida reservation) bookings, returning a hosted FPX payment URL.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "booking_type",
                                    "booking_reference",
                                    "amount",
                                    "customer"
                                ],
                                "properties": {
                                    "booking_type": {
                                        "type": "string",
                                        "enum": [
                                            "flight",
                                            "hotel",
                                            "other"
                                        ],
                                        "example": "flight"
                                    },
                                    "booking_reference": {
                                        "type": "string",
                                        "example": "KULJED992"
                                    },
                                    "amount": {
                                        "type": "number",
                                        "example": 2450.5
                                    },
                                    "currency": {
                                        "type": "string",
                                        "default": "MYR",
                                        "example": "MYR"
                                    },
                                    "description": {
                                        "type": "string",
                                        "example": "Flight Ticket KUL - JED (PNR: KULJED992)"
                                    },
                                    "customer": {
                                        "type": "object",
                                        "required": [
                                            "name",
                                            "email"
                                        ],
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "example": "Mohammad Azzam"
                                            },
                                            "email": {
                                                "type": "string",
                                                "format": "email",
                                                "example": "azzam@andalusia.com"
                                            },
                                            "phone": {
                                                "type": "string",
                                                "example": "+60123456789"
                                            }
                                        }
                                    },
                                    "auto_fulfill": {
                                        "type": "boolean",
                                        "default": true,
                                        "example": true
                                    },
                                    "redirect_url": {
                                        "type": "string",
                                        "format": "uri",
                                        "example": "https://console.tripanda.com/payment/redirect"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Bill created successfully with hosted payment URL",
                        "content": {
                            "application/json": {
                                "example": {
                                    "status": "success",
                                    "message": "Payment bill created successfully.",
                                    "data": {
                                        "bill_id": "w_5q3n4m",
                                        "payment_url": "https://www.billplz-sandbox.com/bills/w_5q3n4m",
                                        "booking_type": "flight",
                                        "booking_reference": "KULJED992",
                                        "amount": 2450.5,
                                        "amount_in_cents": 245050,
                                        "status": "pending"
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error"
                    },
                    "500": {
                        "description": "Payment Gateway Connection Error"
                    }
                }
            }
        },
        "/api/v1/payment/billplz/status/{billId}": {
            "get": {
                "tags": [
                    "Payment Gateway (Billplz)"
                ],
                "summary": "Inquire Billplz Payment Status",
                "description": "Retrieves the real-time settlement status of a bill from Billplz by bill ID.",
                "parameters": [
                    {
                        "name": "billId",
                        "in": "path",
                        "required": true,
                        "description": "Billplz unique bill identifier (e.g. w_5q3n4m)",
                        "schema": {
                            "type": "string",
                            "example": "w_5q3n4m"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Bill status retrieved",
                        "content": {
                            "application/json": {
                                "example": {
                                    "status": "success",
                                    "data": {
                                        "bill_id": "w_5q3n4m",
                                        "paid": true,
                                        "state": "paid",
                                        "amount": 2450.5,
                                        "paid_amount": 2450.5,
                                        "paid_at": "2026-11-24 10:15:30 +0800",
                                        "url": "https://www.billplz-sandbox.com/bills/w_5q3n4m"
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Bill not found"
                    }
                }
            }
        },
        "/api/v1/payment/billplz/webhook": {
            "post": {
                "tags": [
                    "Payment Gateway (Billplz)"
                ],
                "summary": "Billplz Server-to-Server Webhook",
                "description": "Receives asynchronous payment notifications from Billplz, verifies HMAC-SHA256 signature (X-Signature), and triggers fulfillment.",
                "parameters": [
                    {
                        "name": "X-Signature",
                        "in": "header",
                        "required": true,
                        "description": "HMAC-SHA256 signature computed using Base Secret Key",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string",
                                        "example": "w_5q3n4m"
                                    },
                                    "collection_id": {
                                        "type": "string",
                                        "example": "jmphjm1k"
                                    },
                                    "paid": {
                                        "type": "string",
                                        "example": "true"
                                    },
                                    "state": {
                                        "type": "string",
                                        "example": "paid"
                                    },
                                    "amount": {
                                        "type": "string",
                                        "example": "245050"
                                    },
                                    "paid_amount": {
                                        "type": "string",
                                        "example": "245050"
                                    },
                                    "email": {
                                        "type": "string",
                                        "example": "azzam@andalusia.com"
                                    },
                                    "name": {
                                        "type": "string",
                                        "example": "Mohammad Azzam"
                                    },
                                    "url": {
                                        "type": "string",
                                        "example": "https://www.billplz-sandbox.com/bills/w_5q3n4m"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Webhook processed successfully"
                    },
                    "400": {
                        "description": "Invalid signature or missing bill ID"
                    }
                }
            }
        }
    },
    "components": {
        "parameters": {
            "XOriginEnv": {
                "name": "x-origin-env",
                "in": "header",
                "description": "Target gateway environment routing header (live / staging / sandbox). Defaults to staging if omitted or unrecognized.",
                "required": false,
                "schema": {
                    "type": "string",
                    "enum": [
                        "live",
                        "staging",
                        "sandbox"
                    ],
                    "default": "staging"
                }
            },
            "XOriginDomain": {
                "name": "x-origin-domain",
                "in": "header",
                "description": "Origin domain header for white-label tenant routing (e.g., localhost:4200, admin.tripanda.com).",
                "required": false,
                "schema": {
                    "type": "string",
                    "example": "localhost:4200"
                }
            }
        },
        "securitySchemes": {
            "BearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "Token",
                "description": "Session token returned from /api/auth/login. Passed as 'Authorization: Bearer <token>' or 'X-Auth-Token: <token>' header."
            }
        }
    }
}