> ## Documentation Index
> Fetch the complete documentation index at: https://developer.tripedge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get all bookings for a specific user



## OpenAPI

````yaml get /booking/user/{userId}
openapi: 3.0.0
info:
  title: Tripedge Backend API
  version: 1.0.0
servers:
  - url: /api
    description: API server
security:
  - ApiKeyAuth: []
paths:
  /booking/user/{userId}:
    get:
      summary: Get all bookings for a specific user
      operationId: getBookingsByUserId
      parameters:
        - in: path
          name: userId
          schema:
            type: string
          required: true
          description: ID of the user to get bookings for
      responses:
        '200':
          description: Bookings found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates if the request was successful
                  message:
                    type: string
                    nullable: true
                    description: Response message
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: number
                        status:
                          type: string
                          enum:
                            - confirmed
                            - pending
                            - cancelled
                        voucher:
                          type: string
                        hotelId:
                          type: number
                        checkIn:
                          type: string
                        checkOut:
                          type: string
                        firstName:
                          type: string
                        lastName:
                          type: string
                        email:
                          type: string
                        phone:
                          type: string
                        lines:
                          type: array
                          items:
                            type: object
                            properties:
                              lineText:
                                type: string
                              type:
                                type: string
                                enum:
                                  - room
                                  - fee
                                  - payAtHotel
                              amount:
                                type: string
                            required:
                              - lineText
                              - type
                              - amount
                        pricePerNight:
                          type: string
                        priceFees:
                          type: string
                        priceDueAtHotel:
                          type: string
                        priceInclusive:
                          type: string
                        priceChargeable:
                          type: string
                        pricePerRoom:
                          type: string
                        pricePerRoomPerNight:
                          type: string
                        priceBeforeFees:
                          type: string
                        currency:
                          type: string
                        remarks:
                          type: string
                        roomType:
                          type: string
                        cancellationPolicy:
                          type: string
                        cancellationPolicyDate:
                          type: string
                        rooms:
                          type: array
                          items:
                            type: object
                            properties:
                              adults:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    title:
                                      type: string
                                    firstName:
                                      type: string
                                    lastName:
                                      type: string
                                  required:
                                    - title
                                    - firstName
                                    - lastName
                              children:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    title:
                                      type: string
                                    firstName:
                                      type: string
                                    lastName:
                                      type: string
                                    age:
                                      type: number
                                  required:
                                    - title
                                    - firstName
                                    - lastName
                                    - age
                            required:
                              - adults
                              - children
                        clientCommission:
                          type: string
                        paymentMethod:
                          type: string
                          enum:
                            - creditCard
                            - account
                        userId:
                          type: number
                        hotel:
                          type: object
                          properties:
                            id:
                              type: number
                            name:
                              type: string
                            stars:
                              type: number
                              minimum: 1
                              maximum: 5
                            coordinates:
                              type: array
                              items:
                                type: number
                              minItems: 2
                              maxItems: 2
                            address:
                              type: object
                              properties:
                                address:
                                  type: string
                                city:
                                  type: string
                                country:
                                  type: string
                                countryCode:
                                  type: string
                            rating:
                              type: number
                              minimum: 0
                              maximum: 5
                            reviews:
                              type: number
                              minimum: 0
                            pricePerNight:
                              type: string
                            priceChargeable:
                              type: string
                            pricePerRoom:
                              type: string
                            pricePerRoomPerNight:
                              type: string
                            priceBeforeFees:
                              type: string
                            priceFees:
                              type: string
                            priceDueAtHotel:
                              type: string
                            priceInclusive:
                              type: string
                            amenities:
                              type: array
                              items:
                                type: string
                            location:
                              type: string
                            images:
                              type: array
                              items:
                                type: string
                                format: uri
                            exclusive:
                              type: boolean
                            type:
                              type: string
                          required:
                            - id
                            - name
                            - stars
                            - address
                            - rating
                            - reviews
                            - pricePerNight
                            - priceChargeable
                            - pricePerRoom
                            - pricePerRoomPerNight
                            - priceBeforeFees
                            - priceFees
                            - priceDueAtHotel
                            - priceInclusive
                            - amenities
                            - location
                            - images
                            - exclusive
                            - type
                      required:
                        - id
                        - status
                        - voucher
                        - hotelId
                        - checkIn
                        - checkOut
                        - firstName
                        - lastName
                        - email
                        - phone
                        - lines
                        - pricePerNight
                        - priceFees
                        - priceDueAtHotel
                        - priceInclusive
                        - priceChargeable
                        - pricePerRoom
                        - pricePerRoomPerNight
                        - priceBeforeFees
                        - currency
                        - remarks
                        - roomType
                        - cancellationPolicy
                        - cancellationPolicyDate
                        - rooms
                        - clientCommission
                        - paymentMethod
                        - userId
                        - hotel
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API key for authentication

````