> ## 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.

# Create a booking



## OpenAPI

````yaml post /book/{sessionId}/{hotelId}/{rateId}/{paymentMethod}
openapi: 3.0.0
info:
  title: Hotel Booking API
  version: 1.0.0
servers:
  - url: /api
    description: API server
security:
  - ApiKeyAuth: []
paths:
  /book/{sessionId}/{hotelId}/{rateId}/{paymentMethod}:
    post:
      summary: Create a booking
      operationId: createBooking
      parameters:
        - in: path
          name: sessionId
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: hotelId
          schema:
            type: string
          required: true
        - in: path
          name: rateId
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: paymentMethod
          schema:
            type: string
            enum:
              - creditCard
              - account
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rooms:
                  type: array
                  items:
                    type: object
                    properties:
                      adults:
                        type: array
                        items:
                          type: object
                          properties:
                            title:
                              type: string
                              enum:
                                - Mr
                                - Mrs
                                - Ms
                                - Miss
                            firstName:
                              type: string
                              minLength: 1
                            lastName:
                              type: string
                              minLength: 1
                          required:
                            - title
                            - firstName
                            - lastName
                      children:
                        type: array
                        items:
                          type: object
                          properties:
                            title:
                              type: string
                              enum:
                                - Mr
                                - Mrs
                                - Ms
                                - Miss
                            firstName:
                              type: string
                              minLength: 1
                            lastName:
                              type: string
                              minLength: 1
                            age:
                              type: number
                              minimum: 0
                              maximum: 17
                          required:
                            - title
                            - firstName
                            - lastName
                            - age
                    required:
                      - adults
                      - children
                email:
                  type: string
                  format: email
                phone:
                  type: string
                  minLength: 1
                paymentNonce:
                  type: string
                  minLength: 1
              required:
                - rooms
                - email
                - phone
      responses:
        '200':
          description: Booking created successfully
          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, null if successful
                  data:
                    type: object
                    properties:
                      search:
                        type: object
                        properties:
                          destinationId:
                            type: string
                          checkIn:
                            type: string
                          checkOut:
                            type: string
                          rooms:
                            type: array
                            items:
                              type: object
                              properties:
                                adults:
                                  type: number
                                children:
                                  type: number
                                childrenAges:
                                  type: array
                                  items:
                                    type: number
                              required:
                                - adults
                                - children
                                - childrenAges
                        required:
                          - destinationId
                          - checkIn
                          - checkOut
                          - rooms
                      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
                      booking:
                        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
                    required:
                      - search
                      - hotel
                      - booking
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API key for authentication

````