swagger: '2.0'
info:
  version: '1.0'
  title: "DynpaX Book API"
  description: >
    <p>The BookingService 3 service is a booking web-service, containing support for packaged
    and dynamically combined assortment. Together with the TravelSearch you can use these
    services to make a full search & book site, for packaged and dynamically combined
    assortment.
    <p>You can read more about the complete set of APIs here (login required):
    <a href="https://dynpax.com/api">dynpax.com/api</a>
  license:
    name: proprietary
    url: https://qenner.com/privacy
host: book.qenner.com
securityDefinitions:
  ApiKeyAuth:
    type: apiKey
    in: header
    name: Authorization
    description: >
      Send in the Authorization header "ApiKey \<apikey>"<br>
      __Example__: Authorization: ApiKey QEN1-8438541E-7B169E6F-1517FA41-921D0657
security:
  - ApiKeyAuth: []
basePath: /
schemes:
  - https
consumes:
  - application/json
produces:
  - application/json
paths:
  /getBookableUnits:
    x-summary: Bookable Accommodation Units
    post:
      summary: GetBookableUnits
      description: >
        Returns a list of all bookable units.
        Add parameter **type** or **board** to get *only* options of that type.
        Based on [docs](http://docs.qenner.com/docs/bookingservice.html).
      operationId: getBookableUnits
      parameters:
        - name: X-Test
          in: header
          type: boolean
          description: When set to "true", the service will make test bookings.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/BookableUnitsRequest'
      responses:
        200:
          description: Successful Response
          schema:
            $ref: '#/definitions/BookableUnitsResponse'
  /getBookableTransports:
    x-summary: Bookable Transports
    post:
      summary: GetBookableTransports
      description: >
        Returns a list of all bookable transports.
        Parameter **type** is required.
      operationId: getBookableTransports
      parameters:
        - name: X-Test
          in: header
          type: boolean
          description: When set to "true", the service will make test bookings.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/BookableTransportsRequest'
      responses:
        200:
          description: Successful Response
          schema:
            $ref: '#/definitions/BookableTransportsResponse'
  /getBookableServiceTypes:
    x-summary: Bookable Service types
    post:
      summary: GetBookableServiceTypes
      description: >
        Returns a list of all bookable service types that can be used
        in getBookableExtras calls.
      operationId: getBookableServiceTypes
      parameters:
        - name: X-Test
          in: header
          type: boolean
          description: When set to "true", the service will make test bookings.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/BookableServiceTypesRequest'
      responses:
        200:
          description: Successful Response
          schema:
            $ref: '#/definitions/BookableServiceTypesResponse'
  /getBookableExtras:
    x-summary: Bookable Extras
    post:
      summary: GetBookableExtras
      description: >
        Returns a list of all bookable extras. This includes
        extras defined by the provider (associated with
        accommodation and/or transport), and extras from
        third party services like parking, car rental etc.
      operationId: getBookableExtras
      parameters:
        - name: X-Test
          in: header
          type: boolean
          description: When set to "true", the service will make test bookings.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/BookableExtrasRequest'
      responses:
        200:
          description: Successful Response
          schema:
            $ref: '#/definitions/BookableExtrasResponse'
  /getPriceInfo:
    x-summary: Get price details for a possible booking
    post:
      summary: GetPriceInfo
      description: >
        Define a booking, check latest availability and price.
        Returns details of the price, availability of the proposed booking.
      operationId: getPriceInfo
      parameters:
        - name: X-Test
          in: header
          type: boolean
          description: When set to "true", the service will make test bookings.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/PriceInfoRequest'
      responses:
        200:
          description: Successful Response
          schema:
            $ref: '#/definitions/PriceInfoResponse'
  /prepareBooking:
    x-summary: Prepare a booking
    post:
      summary: PrepareBooking
      description: >
        Prepare a booking, check latest availability and price.
        Returns details of the price, availability and a token to complete the booking.
      operationId: prepareBooking
      parameters:
        - name: X-Test
          in: header
          type: boolean
          description: When set to "true", the service will make test bookings.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/PrepareBookingRequest'
      responses:
        200:
          description: Successful Response
          schema:
            $ref: '#/definitions/PrepareBookingResponse'
  /completeBooking:
    x-summary: Complete a booking
    post:
      summary: CompleteBooking
      description: >
        Complete a previously prepared booking.
        Returns bookingNumber and total price.
      operationId: completeBooking
      parameters:
        - name: X-Test
          in: header
          type: boolean
          description: When set to "true", the service will make test bookings.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/CompleteBookingRequest'
      responses:
        200:
          description: Successful Response
          schema:
            $ref: '#/definitions/CompleteBookingResponse'
  /getCompleteBookingResponse:
    x-summary: Experimental call to re-fetch the complete booking response
    post:
      summary: CompleteBookingResponse
      description: (Experimental) Can be used in combinations with
        findBookings to get more details for a search result. Returns exactly
        the same response as returned by the completeBooking function.
      operationId: getCompleteBookingResponse
      parameters:
        - name: X-Test
          in: header
          type: boolean
          description: When set to "true", the service will make test bookings.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/RecapBookingRequest'
      responses:
        200:
          description: Booking details
          schema:
            $ref: '#/definitions/CompleteBookingResponse'

  /recapBooking:
    x-summary: Get a recap of an existing booking
    post:
      summary: RecapBooking
      description: Get a recap of a previously created booking.
      operationId: recapBooking
      parameters:
        - name: X-Test
          in: header
          type: boolean
          description: When set to "true", the service will make test bookings.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/RecapBookingRequest'
      responses:
        200:
          description: Booking details
          schema:
            $ref: '#/definitions/RecapBookingResponse'
  /prepareCancelBooking:
    x-summary: Prepare the cancellation of an existing booking
    post:
      summary: PrepareCancelBooking
      description: Prepare the cancellation of an existing booking.
      operationId: prepareCancelBooking
      parameters:
        - name: X-Test
          in: header
          type: boolean
          description: When set to "true", the service will make test bookings.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/PrepareCancelRequest'
      responses:
        200:
          description: Cancellation cost and token
          schema:
            $ref: '#/definitions/PrepareCancelResponse'
  /confirmCancelBooking:
    x-summary: Confirm the cancellation of an existing booking
    post:
      summary: ConfirmCancelBooking
      description: Confirm the cancellation of an existing booking
      operationId: confirmCancelBooking
      parameters:
        - name: X-Test
          in: header
          type: boolean
          description: When set to "true", the service will make test bookings.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/ConfirmCancelRequest'
      responses:
        200:
          description: Confirmation of cancellation
          schema:
            $ref: '#/definitions/ConfirmCancelResponse'
  /findBookings:
    x-summary: Returns a list of bookings which match the criteria in the request body
    post:
      summary: FindBookings
      description: >
        Returns a list of bookings which match the criteria in the request body. Results are
        limited to a maximum. The returned objects have a field `bookingNumber` which can
        be used with the `RecapBooking` call to obtain the booking details.
      operationId: findBookings
      parameters:
        - name: X-Test
          in: header
          type: boolean
          description: When set to "true", the service will make test bookings.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/FindBookingsRequest'
      responses:
        200:
          description: List of bookings.
          schema:
            $ref: '#/definitions/FindBookingsResponse'
  /composeBookRequest:
    x-summary: Private method, used to compose bookrequest using alternative info.
    post:
      summary: ComposeBookRequest
      description: Private method, used to compose bookrequest using alternative info.
      operationId: prepareBookRequest
      parameters:
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/ComposeBookRequestRequest'
      responses:
        200:
          description: A bookrequest.
          schema:
            $ref: '#/definitions/ComposeBookRequestResponse'

definitions:
  ComposeBookRequestRequest:
    title: ComposeBookRequest request
    type: object
    properties:
      vrsBookCode:
        type: string
      productId:
        type: number
        format: int64
      birthDates:
        type: array
        items:
          type: string

  BookableUnitsRequest:
    title: BookableUnits request
    type: object
    properties:
      bookRequest:
        $ref: '#/definitions/BookRequest'
      unitOccupations:
        type: array
        description: >
          List of room-occupations, cannot be empty.
        items:
          $ref: '#/definitions/UnitOccupation'
      sessionId:
        type: string
        description: >
          Empty for first call in a session. Use returned sessionId in subsequent calls.
        example: null
    required:
      - bookRequest
      - unitOccupations
  BookableUnitsResponse:
    title: BookableUnits response
    type: object
    properties:
      bookingDescription:
        $ref: '#/definitions/BookingDescription'
      sessionId:
        type: string
        description: >
          The unique ID for this session, to tie all calls together. Use in subsequent calls.
      packagePriceIndication:
        $ref: '#/definitions/Price'
        description: >
          Estimated (minimum) total price. This estimation includes
          transports and required extras.
      bookableUnitOccupations:
        type: array
        items:
          $ref: '#/definitions/BookableUnitOccupation'
      messages:
        type: array
        items:
          $ref: '#/definitions/Message'
    required:
      - bookableUnitOccupations
      - messages

  BookableTransportsRequest:
    title: BookableTransports request
    type: object
    properties:
      bookRequest:
        $ref: '#/definitions/BookRequest'
      sessionId:
        type: string
        description: >
          Use the sessionId returned from a previous GetBookableUnits call.
    required:
      - bookRequest
      - sessionId
  BookableTransportsResponse:
    title: BookableTransports response
    type: object
    properties:
      bookingDescription:
        $ref: '#/definitions/BookingDescription'
      sessionId:
        type: string
        description: >
          The unique ID for this session, to tie all calls together.
      packagePriceIndication:
        $ref: '#/definitions/Price'
        description: >
          Estimated (minimum) total price. This estimation includes
          accommodation units and required extras.
      bookableTransports:
        type: array
        items:
          $ref: '#/definitions/BookableTransport'
      messages:
        type: array
        items:
          $ref: '#/definitions/Message'
    required:
      - bookableTransports
      - messages

  BookableServiceTypesRequest:
    title: BookableServiceTypes request
    description: >
      Requests the possible service types which are available for this
      account. Note that at least one unit or transport assignment must be
      provided.
    type: object
    properties:
      bookRequest:
        $ref: '#/definitions/BookRequest'
      sessionId:
        type: string
      travelerBirthdates:
        type: array
        description: >
          The birthdates of the travelers used in the unit and transport assignments.
          Cannot be empty.
        items:
          $ref: '#/definitions/TravelerBirthdate'
      unitAssignments:
        type: array
        items:
          $ref: '#/definitions/UnitAssignment'
        description: >
          The chosen accommodation units with the assigned travelers.
          Values can be taken from the `BookableUnitOccupation` which
          was returned by `getBookableUnits`
      transportAssignments:
        type: array
        items:
          $ref: '#/definitions/TransportAssignment'
        description: >
          The chosen transports with the assigned travelers. Values can be taken
          from the `BookableTransport` which was returned by
          `getBookableTransports`.
          Note that for each TransportAssignment instance the
          selected to and from transports must come from the same
          `BookableTransport`.
    required:
      - bookRequest
      - sessionId
      - travelerBirthdates

  BookableServiceTypesResponse:
    title: BookableServiceTypes response
    type: object
    properties:
      bookingDescription:
        $ref: '#/definitions/BookingDescription'
      sessionId:
        type: string
      services:
        type: array
        items:
          type: string
          enum: [insurance, transfer, parking, airportHotel, carrental]
        description: >
          List service types you can request using getBookableExtras.
      messages:
        type: array
        items:
          $ref: '#/definitions/Message'
    required:
      - messages
      - services
  BookableExtrasRequest:
    title: BookableExtras request
    description: >
      Requests the possible extras based on the given assignments.
      Note that at least one unit or transport assignment must be provided.
    type: object
    properties:
      bookRequest:
        $ref: '#/definitions/BookRequest'
      sessionId:
        type: string
      travelerBirthdates:
        type: array
        description: >
          The birthdates of the travelers used in the unit and transport assignments.
          Cannot be empty.
        items:
          $ref: '#/definitions/TravelerBirthdate'
      unitAssignments:
        type: array
        items:
          $ref: '#/definitions/UnitAssignment'
        description: >
          The chosen accommodation units with the assigned travelers.
          Values can be taken from the `BookableUnitOccupation` which
          was returned by `getBookableUnits`
      transportAssignments:
        type: array
        items:
          $ref: '#/definitions/TransportAssignment'
        description: >
          The chosen transports with the assigned travelers. Values can be taken
          from the `BookableTransport` which was returned by
          `getBookableTransports`.
          Note that for each TransportAssignment instance the
          selected to and from transports must come from the same
          `BookableTransport`.
      services:
        type: array
        items:
          type: string
          enum: [insurance, transfer, parking, airportHotel, carrental]
        description: >
          List services you would like to request. Apart from the requested services
          the result always includes the extras from the providers (which includes
          for instance luggage options).
    required:
      - bookRequest
      - travelerBirthdates
      - sessionId

  BookableExtrasResponse:
    title: BookableExtras response
    type: object
    properties:
      bookingDescription:
        $ref: '#/definitions/BookingDescription'
      sessionId:
        type: string
      packagePriceIndication:
        $ref: '#/definitions/Price'
        description: >
          Estimated (minimum) total price. This estimation includes
          transports and required extras.
      extras:
        type: array
        items:
          $ref: '#/definitions/Extra'
        description: Extras which don't be belong to one of the specific categories
      luggageOptions:
        type: array
        items:
          $ref: '#/definitions/BookableLuggage'
      insuranceOptions:
        type: array
        items:
          $ref: '#/definitions/Insurance'
      parkingOptions:
        type: array
        items:
          $ref: '#/definitions/Parking'
      carRentalLocations:
        type: array
        items:
          $ref: '#/definitions/CarRentalLocation'
      carRentalOptions:
        type: array
        items:
          $ref: '#/definitions/CarRental'
      airportHotelOptions:
        type: array
        items:
          $ref: '#/definitions/AirportHotel'
      transferOptions:
        type: array
        items:
          $ref: '#/definitions/BookableTransfer'
      messages:
        type: array
        items:
          $ref: '#/definitions/Message'
    required:
      - messages

  FindBookingsRequest:
    title: Find bookings for given criteria.
    type: object
    description: >
      Open date intervals are allowed
    properties:
      bookingNumber:
        type: string
        description: Booking number or booking id
      providerBookingReference:
        type: string
        description: >
          Booking reference used by the provider, this corresponds to the
          `providerBookingReference` property on the `UnitAssignment` and
          `TransportAssignment` objects in the CompleteBooking response
      minBookingDate:
        type: string
        description: Date in yyyyMMdd format
      maxBookingDate:
        type: string
        description: Date in yyyyMMdd format
      minStartDate:
        type: string
        description: Date in yyyyMMdd format
      maxStartDate:
        type: string
        description: Date in yyyyMMdd format
      customerName:
        type: string
        description: Wildcards (`*`) are allowed.
  FindBookingsResponse:
    title: List of found bookings
    type: object
    properties:
      messages:
        type: array
        items:
          $ref: '#/definitions/Message'
      bookings:
        type: array
        items:
          $ref: '#/definitions/BookingSummary'
      sessionId:
        type: string
        description: >
          Although the recap request doesn't require a session, the sessionId here acts
          as a trackingId and can be used for troubleshooting.
    required:
      - messages
      - bookings
      
  ComposeBookRequestResponse:
    title: Create BookRequest
    type: object
    properties:
      messages:
        type: array
        items:
          $ref: '#/definitions/Message'
      bookRequest:
        $ref: '#/definitions/BookRequest'
      sessionId:
        type: string
        description: >
          Use the sessionId returned from a previous GetBookableUnits call.
    
  BookingSummary:
    title: Single entry in the `FindBookingsResponse`
    type: object
    properties:
      bookingNumber:
        type: string
        description: Can be used for a recap request
      bookingDateTime:
        type: string
        description: dateTime in yyyyMMddTHHmmssZ
      startDate:
        type: string
        description: Date in yyyyMMdd format
      endDate:
        type: string
        description: Date in yyyyMMdd format
      customerName:
        type: string
      accommodationName:
        type: string
        description: >
          Name of the accommodation at the time of booking
      accommodationCountry:
        type: string
        description: >
          Country of the accommodation at the time of booking
      transportArrivalPoint:
        type: string
        description: >
          Arrival point of the transport at the time of booking.
          For transports, this will be the airport
      bookingStatus:
        type: string
        enum: [open, inProgress, prepared, booked, requested, cancelled, failed, testBooked]
      test:
        type: boolean
        description: The test flag used when making the booking
      providerBookingReferences:
        type: array
        items:
          $ref: '#/definitions/BookingSummaryProviderReference'

  BookingSummaryProviderReference:
    title: Provider reference element in the BookingSummary
    type: object
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      providerBookingReference:
        type: string
    required:
      - providerId
      - providerName
      - providerBookingReference

  PriceInfoRequest:
    title: Request a price for a possible booking
    type: object
    description: >
      Note that at least one unit or transport assignment must be provided.
    properties:
      bookRequest:
        $ref: '#/definitions/BookRequest'
      sessionId:
        type: string
      travelerBirthdates:
        type: array
        description: >
          The birthdates of the travelers used in the unit and transport assignments.
          Cannot be empty.
        items:
          $ref: '#/definitions/TravelerBirthdate'
      unitAssignments:
        type: array
        items:
          $ref: '#/definitions/UnitAssignment'
        description: >
          The chosen accommodation units with the assigned travelers.
          Values can be taken from the `BookableUnitOccupation` which
          was returned by `getBookableUnits`
      transportAssignments:
        type: array
        items:
          $ref: '#/definitions/TransportAssignment'
        description: >
          The chosen transports with the assigned travelers. Values can be taken
          from the `BookableTransport` which was returned by
          `getBookableTransports`.
          Note that for each TransportAssignment instance the
          selected to and from transports must come from the same
          `BookableTransport`.
      luggageAssignments:
        type: array
        items:
          $ref: '#/definitions/LuggageAssignment'
      extraAssignments:
        type: array
        items:
          $ref: '#/definitions/ExtraAssignment'
      transferAssignments:
        type: array
        items:
          $ref: '#/definitions/TransferAssignment'
      insuranceAssignments:
        type: array
        items:
          $ref: '#/definitions/InsuranceAssignment'
      parkingAssignments:
        type: array
        items:
          $ref: '#/definitions/ParkingAssignment'
      carRentalAssignments:
        type: array
        items:
          $ref: '#/definitions/CarRentalAssignment'
      airportHotelAssignments:
        type: array
        items:
          $ref: '#/definitions/AirportHotelAssignment'
    required:
      - bookRequest
      - travelerBirthdates
      - sessionId
  PriceInfoResponse:
    title: Response of a price info booking request
    type: object
    properties:
      bookingDescription:
        $ref: '#/definitions/BookingDescription'
      sessionId:
        type: string
      totalPrice:
        $ref: '#/definitions/Price'
      totalPriceAtLocation:
        $ref: '#/definitions/Price'
      totalSecurityDeposit:
        $ref: '#/definitions/Price'
      priceSegments:
        type: array
        items:
          $ref: '#/definitions/PriceSegment'
      paymentSchedule:
        $ref: '#/definitions/PaymentSchedule'
        deprecated: true
      cancellationDetails:
        type: array
        items:
          $ref: '#/definitions/CancellationDetail'
      messages:
        type: array
        items:
          $ref: '#/definitions/Message'
    required:
      - messages
      - cancellationDetails
  PrepareBookingRequest:
    title: Request to prepare a booking
    type: object
    properties:
      bookRequest:
        $ref: '#/definitions/BookRequest'
      sessionId:
        type: string
      travelers:
        type: array
        description:
          The travelers used in the unit and transport assignments.
          Cannot be empty.
        items:
          $ref: '#/definitions/Traveler'
      unitAssignments:
        type: array
        items:
          $ref: '#/definitions/UnitAssignment'
      transportAssignments:
        type: array
        items:
          $ref: '#/definitions/TransportAssignment'
      luggageAssignments:
        type: array
        items:
          $ref: '#/definitions/LuggageAssignment'
      extraAssignments:
        type: array
        items:
          $ref: '#/definitions/ExtraAssignment'
      transferAssignments:
        type: array
        items:
          $ref: '#/definitions/TransferAssignment'
      insuranceAssignments:
        type: array
        items:
          $ref: '#/definitions/InsuranceAssignment'
      parkingAssignments:
        type: array
        items:
          $ref: '#/definitions/ParkingAssignment'
      carRentalAssignments:
        type: array
        items:
          $ref: '#/definitions/CarRentalAssignment'
      airportHotelAssignments:
        type: array
        items:
          $ref: '#/definitions/AirportHotelAssignment'
      mainBooker:
        $ref: '#/definitions/Customer'
      homeContact:
        $ref: '#/definitions/Contact'
    description: >
      This request is contains the same properties as the `PriceInfoRequest`
      apart from the additional main booker, home contact and traveler
      details.
      Note that at least one unit or transport assignment must be provided.
    required:
      - bookRequest
      - sessionId
      - travelers
      - mainBooker
      - homeContact
  PrepareBookingResponse:
    title: Response of a prepare booking request
    type: object
    properties:
      bookingDescription:
        $ref: '#/definitions/BookingDescription'
      sessionId:
        type: string
      bookingToken:
        type: string
      invoiceId:
        type: integer
        format: int64
        description: >
          Deprecated: The Qenner PaymentService is no longer supported 
          Identifier of the invoice on which payments can be made through the
          Qenner PaymentService.
        deprecated: true
      totalPrice:
        $ref: '#/definitions/Price'
      totalPriceAtLocation:
        $ref: '#/definitions/Price'
      totalSecurityDeposit:
        $ref: '#/definitions/Price'
      priceSegments:
        type: array
        items:
          $ref: '#/definitions/PriceSegment'
      paymentSchedule:
        $ref: '#/definitions/PaymentSchedule'
        deprecated: true
      cancellationDetails:
        type: array
        items:
          $ref: '#/definitions/CancellationDetail'
      messages:
        type: array
        items:
          $ref: '#/definitions/Message'
    required:
      - messages
      - cancellationDetails
  CompleteBookingRequest:
    title: Request to complete a previously prepared booking
    type: object
    properties:
      bookRequest:
        $ref: '#/definitions/BookRequest'
      sessionId:
        type: string
      bookingToken:
        type: string
    required:
      - bookRequest
      - bookingToken
      - sessionId

  CompleteBookingResponse:
    title: Response of a complete booking request
    type: object
    properties:
      bookingDescription:
        $ref: '#/definitions/BookingDescription'
      sessionId:
        type: string
      bookingNumber:
        type: string
      bookingDateTime:
        type: string
        description: dateTime in yyyyMMddTHHmmssZ
      invoiceId:
        type: integer
        format: int64
        description: >
          Deprecated: The Qenner PaymentService is no longer supported 
          Identifier of the invoice on which payments can be made through the
          Qenner PaymentService.
        deprecated: true
      totalPrice:
        $ref: '#/definitions/Price'
      totalPriceAtLocation:
        $ref: '#/definitions/Price'
      totalSecurityDeposit:
        $ref: '#/definitions/Price'
      priceSegments:
        type: array
        items:
          $ref: '#/definitions/PriceSegment'
      paymentSchedule:
        $ref: '#/definitions/PaymentSchedule'
      cancellationDetails:
        type: array
        items:
          $ref: '#/definitions/CancellationDetail'
      messages:
        type: array
        items:
          $ref: '#/definitions/Message'
    required:
      - priceSegments
      - cancellationDetails
      - messages

  Price:
    title: Price in cents
    type: object
    properties:
      currency:
        type: string
      amount:
        type: integer
        description: Amount in cents
    required:
      - currency
      - amount
  AgeRestrictedPrice:
    title: Price with age restrictions, only valid within the specified age (if any)
    type: object
    properties:
      minAge:
        type: integer
      maxAge:
        type: integer
      price:
        $ref: '#/definitions/Price'
    required:
      - price
  PriceSegment:
    title: Price for a segment of the booking.
    description: >
      Each provider-booking results in a separate PriceSegment. An additional
      PriceSegment can be added for the booking as a whole.
    type: object
    properties:
      description:
        type: string
        description: Name or description of the segment.
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      providerBookingReference:
        type: string
        description: Available after CompleteBooking.
      netPrice:
        description: >
          The net price for this segment. Should only be displayed to agents,
          never to consumers.
        $ref: '#/definitions/Price'
      calculatedMargin:
        description: >
          The calculated margin for this segment (can be positive or negative).
          Should only be displayed to agents, never to consumers.
        $ref: '#/definitions/Price'
      salesPrice:
        description: The sales (consumer) price for this segment.
        $ref: '#/definitions/Price'
      priceAtLocation:
        description: >
          The total (sales, consumer) price expected to be payable at
          location.
        $ref: '#/definitions/Price'
      priceDetails:
        type: array
        description: >
          A posssibly empty list of sub-price details, displayable to the consumer.
          The sum of prices in PriceDetail is not per definiton equal to the
          total price of PriceSegment. It may contain items like 'Luggage fee',
          'Surcharge All-inclusive' etc.
        items:
          $ref: '#/definitions/PriceDetail'
    required:
      - description
      - providerId
      - priceDetails

  PriceDetail:
    title: Part of the total price.
    type: object
    properties:
      description:
        type: string
      netPrice:
        $ref: '#/definitions/Price'
      salesPrice:
        $ref: '#/definitions/Price'
      isPayAtLocation:
        type: boolean
        default: false
    required:
      - description
  BookableAccommodation:
    title: Accommodation
    type: object
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      accommodationId:
        type: integer
        format: int64
      accommodationSubId:
        type: string
      accommodationType:
        type: string
      name:
        type: string
      place:
        type: string
      district:
        type: string
      country:
        type: string
      bookableUnits:
        type: array
        items:
          $ref: '#/definitions/BookableUnit'
      packageInfo:
        $ref: '#/definitions/PackageInfo'
    required:
      - providerId
      - accommodationId
      - accommodationType
      - name
      - place
      - country
      - bookableUnits
  BookableUnit:
    title: Unit
    type: object
    properties:
      occupationSequence:
        type: integer
      countAdults:
        type: integer
      countChildren:
        type: integer
      countBabies:
        type: integer
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      accommodationId:
        type: integer
        format: int64
      accommodationSubId:
        type: string
      unitId:
        type: string
      unitName:
        type: string
      unitType:
        type: string
      minOccupation:
        type: integer
      maxOccupation:
        type: integer
      minAdults:
        type: integer
      maxAdults:
        type: integer
      maxChildAge:
        type: integer
      boardType:
        type: string
      bookingCode:
        type: string
      availabilityStatus:
        type: string
        enum: [available, onrequest, unknown]
        description: >
          Optionally provided by the providers, when empty or unknown, this often means the
          field isn't supported yet and 'available' may be assumed.
      packageCode:
        type: string
        description: >
          Provided if Unit is part of a touroperator package.
          If not empty must be combined with units and transports with the same packageCode.
      price:
        $ref: '#/definitions/Price'
    required:
      - unitId
      - unitName
      - unitType
      - price
      - providerId
      - bookingCode
  BookingDescription:
    title: Booking Description
    type: object
    properties:
      bookRequest:
        $ref: '#/definitions/BookRequest'
      travelers:
        type: array
        items:
          $ref: '#/definitions/TravelerDescription'
      unitAssignments:
        type: array
        items:
          $ref: '#/definitions/UnitAssignmentDescription'
      transportAssignments:
        type: array
        items:
          $ref: '#/definitions/TransportAssignmentDescription'
      luggageAssignments:
        type: array
        items:
          $ref: '#/definitions/LuggageAssignment'
      extrasAssignments:
        type: array
        items:
          $ref: '#/definitions/ExtraAssignment'
      transferAssignments:
        type: array
        items:
          $ref: '#/definitions/TransferAssignmentDescription'
      insuranceAssignments:
        type: array
        items:
          $ref: '#/definitions/InsuranceAssignmentDescription'
      parkingAssignments:
        type: array
        items:
          $ref: '#/definitions/ParkingAssignmentDescription'
      carRentalAssignments:
        type: array
        items:
          $ref: '#/definitions/CarRentalAssignmentDescription'
      airportHotelAssignments:
        type: array
        items:
          $ref: '#/definitions/AirportHotelAssignmentDescription'
      mainBooker:
        $ref: '#/definitions/Customer'
      homeContact:
        $ref: '#/definitions/Contact'
      availabilityStatus:
        type: string
        enum: [available, onrequest, unknown]
        description: >
          Optionally provided, when empty or unknown, this often means the
          field isn't supported yet and 'available' may be assumed. This field loses items
          value after a completeBooking is performed and bookingStatus will give the Status
          of the total booking.
      tourOperatorName:
        type: string
        example: "Tui"
      tourOperatorCode:
        type: string
        example: "AR"
      bookingStatus:
        type: string
        enum: [open, inProgress, prepared, booked, requested, cancelled, failed, testBooked]
    required:
      - unitAssignments
      - transportAssignments
      - extrasAssignments
      - luggageAssignments
      - insuranceAssignments
      - parkingAssignments
      - carRentalAssignments
      - airportHotelAssignments
  BookRequest:
    title: Book Request
    type: object
    properties:
      startDate:
        type: string
        description: Date in yyyyMMdd format
        example: "20190801"
      nightCount:
        type: integer
        description: Number of nights for the stay
        example: 7
      countAdults:
        type: integer
        description: Total number of adults in this booking
        example: 2
      countChildren:
        type: integer
        description: Total number of children in this booking
        example: 0
      countBabies:
        type: integer
        description: Total number of infants in this booking
        example: 1
      boardType:
        type: string
        description: >
          Required when requesting a booking including accommodation. Only options
          with this boardType will be returned.
        example: "LO"
      accommodationId:
        type: integer
        format: int64
        example: 451342
      transportType:
        type: string
        example: "VL"
      departureAirport:
        type: string
        example: "AMS"
      arrivalAirport:
        type: string
        example: "AYT"
      preferredTransportCode:
        type: string
        example: "KC341352"
      actionCodes:
        description: Optional list of action codes to apply to the booking.
        type: array
        items:
          type: string
        example: ["VB3303"]
      birthdates:
        description: >
          Optional but preferred list of birthdates (yyyyMMdd) which can be used to
          give more accurate options and price indications.
        type: array
        items:
          type: string
      preferredPackageCode:
        type: string
        example: "VLACEACBSL|T"
      countPets:
        type: integer
        description: >
          Only used internally, not used in regular book-requests
          Total number of pets in this booking
        example: 1
      restrictUnitId:
        type: string
        example: "3B01"
        description: Optional reduce processing by restricting to a single unit type.
    required:
      - accommodationId
      - startDate
      - nightCount
      - countAdults
      - countChildren
      - countBabies
      - transportType
  UnitOccupation:
    title: Units with occupation of Booking request
    type: object
    properties:
      accommodationId:
        type: integer
        format: int64
      sequence:
        type: integer
        description: >
          Unique number you give to this unitOccupation, will be returend in the
          response so you can map request unitOccupations to reponse unitOcccupations.
      countAdults:
        type: integer
      countChildren:
        type: integer
      countBabies:
        type: integer
      unitType:
        type: string
        description: For future use, ignored
      birthdates:
        description: >
          Optional but preferred list of birthdates (yyyyMMdd) which can be used to
          give more accurate options and price indications.
        type: array
        items:
          type: string
    required:
      - sequence
      - accommodationId
      - countAdults
      - countChildren
      - countBabies
  UnitAssignmentDescription:
    title: Accommodation and Unit with assigned Travelers
    type: object
    properties:
      occupationSequence:
        type: integer
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      providerBookingReference:
        type: string
        description: Available after CompleteBooking.
      accommodationBookingReference:
        type: string
        description: Available after CompleteBooking.
      accommodationId:
        type: integer
        format: int64
      accommodationSubId:
        type: string
      accommodationType:
        type: string
      accommodationName:
        type: string
      accommodationPlace:
        type: string
      accommodationDistrict:
        type: string
      accommodationCountry:
        type: string
      accommodationTelephone:
        type: string
      accommodationAddress:
        type: string
      accommodationZipcode:
        type: string
      unitId:
        type: string
      unitName:
        type: string
      unitType:
        type: string
      boardType:
        type: string
      bookingCode:
        type: string
      countAdults:
        type: integer
      countChildren:
        type: integer
      countBabies:
        type: integer
      assignedTravelerIds:
        type: array
        items:
          type: integer
      packageInfo:
        $ref: '#/definitions/PackageInfo'
        description: Available when part of a package.
    required:
      - occupationSequence
      - providerId
      - accommodationId
      - unitId
      - boardType
      - bookingCode
      - countAdults
      - countChildren
      - countBabies
      - assignedTravelerIds
  UnitAssignment:
    title: Unit with assigned Travelers
    type: object
    properties:
      bookableUnit:
        $ref: '#/definitions/BookableUnit'
      assignedTravelerIds:
        type: array
        items:
          type: integer
    required:
      - bookableUnit
      - assignedTravelerIds
  TravelerBirthdate:
    title: Birthday of a person travelling on this journey
    type: object
    properties:
      travelerId:
        type: integer
      birthdate:
        type: string
        description: Date in yyyyMMdd format
    required:
      - travelerId
      - birthdate
  Traveler:
    title: A person travelling on this journey
    type: object
    properties:
      travelerId:
        type: integer
      gender:
        type: string
        enum: [M, F]
        description: M for male, F for female
      firstName:
        type: string
        description: First full name as in passport
      namePrefix:
        type: string
        description: Field for 'van', 'van der', 'de' etc.
      lastName:
        type: string
      initials:
        type: string
        description: Initials without spacing or periods
      birthdate:
        type: string
        description: Date in yyyyMMdd format
      isMainBooker:
        type: boolean
      nationality:
        type: string
        description: 2-letter code for nationality
    required:
      - travelerId
      - firstName
      - lastName
      - birthdate
      - isMainBooker
      - nationality
  TravelerDescription:
    title: A person travelling on this journey
    description: >
      Represents submitted traveler information. If for instance the preceding request contained
      TravelerBirthdate objects, only the travelerId and birthdate are filled.
    type: object
    properties:
      travelerId:
        type: integer
      gender:
        type: string
        enum: [M, F]
        description: M for male, F for female
      firstName:
        type: string
        description: First full name as in passport
      namePrefix:
        type: string
        description: Field for 'van', 'van der', 'de' etc.
      lastName:
        type: string
      initials:
        type: string
        description: Initials without spacing or periods
      birthdate:
        type: string
        description: Date in yyyyMMdd format
      isMainBooker:
        type: boolean
      nationality:
        type: string
        description: 2-letter code for nationality
    required:
      - travelerId
      - birthdate
  Customer:
    title: A person making and paying the booking
    type: object
    properties:
      gender:
        type: string
        enum: [M, F]
        description: M for male, F for female
      firstName:
        type: string
        description: First full name as in passport
      namePrefix:
        type: string
        description: Field for 'van', 'van der', 'de' etc.
      lastName:
        type: string
      initials:
        type: string
        description: Initials without spacing or periods
      phone:
        type: string
      email:
        type: string
      address:
        type: string
      zipcode:
        type: string
      place:
        type: string
      country:
        type: string
      countryCode:
        description: ISO 3166 (two-letter) country code, e.g. NL
        type: string
    required:
      - lastName
      - phone
      - email


  Contact:
    title: Contact information (e.g. for homecontact)
    type: object
    properties:
      name:
        type: string
      phone:
        type: string
      email:
        type: string
    required:
      - name
      - phone
      - email
  BookableUnitOccupation:
    title: Units with occupation with unit options of Booking response
    type: object
    properties:
      sequence:
        type: integer
      countAdults:
        type: integer
      countChildren:
        type: integer
      countBabies:
        type: integer
      bookableAccommodations:
        type: array
        items:
          $ref: '#/definitions/BookableAccommodation'
      messages:
        type: array
        description: >
          Messages related to this BookableUnitOccupation. In a future update these will be
          moved to response level, with the appropriate providerId and messageOn.
        items:
          $ref: '#/definitions/Message'
    required:
      - countAdults
      - countChildren
      - countBabies
      - bookableAccommodations
  BookableTransport:
    title: Outbound (to) transport with one or more inbound (from) options, from Booking response
    type: object
    properties:
      providerId:
        type: integer
        format: int64
        description: >
          Provider on Transport level, not on Leg. If we combine different single
          flights as a retour, possibly from different carriers, it will still be
          from one provider.
      providerName:
        type: string
      transportType:
        type: string
      packageCode:
        type: string
        description: >
          Provided if Transport is part of a touroperator package.
          If not empty must be combined with units and transports with the same packageCode.
      toTransport:
        $ref: '#/definitions/Transport'
      fromTransports:
        type: array
        items:
          $ref: '#/definitions/Transport'
      messages:
        type: array
        description: >
          Messages related to this BookableTransport. In a future update these will be
          moved to response level, with the appropriate providerId and messageOn.
        items:
          $ref: '#/definitions/Message'
    required:
      - fromTransports
      - providerId
      - transportType
  TransportAssignment:
    title: Transport with assigned Travelers
    type: object
    properties:
      toTransport:
        $ref: '#/definitions/Transport'
      fromTransport:
        $ref: '#/definitions/Transport'
      toPickUpPoint:
        $ref: '#/definitions/PickUpDropOffPoint'
      fromDropOffPoint:
        $ref: '#/definitions/PickUpDropOffPoint'
      assignedTravelerIds:
        type: array
        description: Cannot be empty
        items:
          type: integer
    required:
      - toTransport
      - fromTransport
      - assignedTravelerIds
  TransportAssignmentDescription:
    title: Transport with assigned Travelers from GetPriceInfo/Book requests
    type: object
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      providerBookingReference:
        type: string
      transportBookingReference:
        type: string
      transportType:
        type: string
      toTransport:
        $ref: '#/definitions/Transport'
      fromTransport:
        $ref: '#/definitions/Transport'
      toPickUpPoint:
        $ref: '#/definitions/PickUpDropOffPoint'
      fromDropOffPoint:
        $ref: '#/definitions/PickUpDropOffPoint'
      assignedTravelerIds:
        type: array
        items:
          type: integer
    required:
      - providerId
      - transportType
      - toTransport
      - fromTransport
      - assignedTravelerIds

  Transport:
    title: Transport
    type: object
    description: >
      Represents a user-selectable transport(option). If a transport has one ore more
      stops, these can be expressed using TransportLegs
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      transportType:
        type: string
      packageCode:
        type: string
        description: >
          Provided if Transport is part of a touroperator package.
          If not empty must be combined with units and transports with the same packageCode.
      transportCode:
        type: string
        description: Identifier of the Transport
      isPreferredTransport:
        type: boolean
        default: false
        description: >
          If true, this transport matches the preferred transport from the BookRequest.
      bookingCode:
        type: string
        description: >
          The code with which this transport can be booked. May be empty for a
          toTransport, may not be empty for a fromTransport
      departurePoint:
        type: string
      arrivalPoint:
        type: string
        description: >
          A displayable name to indicate the arrival name
      departureLocation:
        type: string
        description: >
          A displayable name to indicate the departure name
      arrivalLocation:
        type: string
      departureDateTime:
        type: string
        description: dateTime in yyyyMMddTHHmm
      arrivalDateTime:
        type: string
        description: dateTime in yyyyMMddTHHmm
      class:
        type: string
        enum: [economy, comfort, business, luxe, royal, tourist, first, second]
        description: >
          Transport class, typically economy, comfort or business for flight,
          comfort, luxe, royal or tourist for bus, and first or second
          for train.
      classCode:
        type: string
        description: Transport class codes (like Y, C, U)
      classDescription:
        type: string
        description: Human-readable description of flight class
      carrierCode:
        type: string
      carrierName:
        type: string
      number:
        type: string
        description: Number of the transport, or first TransportLeg
      legs:
        type: array
        items:
          $ref: '#/definitions/TransportLeg'
        description: >
          Lists individual parts of this transport. This should be empty when the number of
          stop-overs is unknown. If not empty, the information should be complete.
      stopovers:
        type: integer
        description: >
          When available contains the number of stopovers of this transport. If legs is entered, 
          stopovers will be count(legs) - 1.
      availabilityStatus:
        type: string
        enum: [available, onrequest, unknown]
        description: >
          Optionally provided by the providers, when empty or unknown, this often means the
          field isn't supported yet and 'available' may be assumed.
      price:
        $ref: '#/definitions/Price'
        description: >
          Price for this Transport. The total price of a BookableTransport is defined by
          the sum of the selected toTransport and fromTransport. If only retour-flight
          prices are known, the toTransport will have the lowest possible price and each
          fromTransport the additional price for that option.
      pickUpDropOffPoints:
        type: array
        items:
          $ref: '#/definitions/PickUpDropOffPoint'
        description: >
          Optional list of PickUpDropOffPoint's for certain types of transport (train/bus) a list of
          pickup points for the from Transport and list of dropoff points for the to Transport is provided
          and one of each must be selected.
    required:
      - providerId
      - bookingCode
      - transportType
  TransportLeg:
    title: Transport Leg
    type: object
    description: >
      Segment of a transport.
    properties:
      transportLegCode:
        type: string
        description: Identifier of the TransportLeg
      departurePoint:
        type: string
      arrivalPoint:
        type: string
      departureDateTime:
        type: string
        description: dateTime in yyyyMMddTHHmm
      arrivalDateTime:
        type: string
        description: dateTime in yyyyMMddTHHmm
      classCode:
        type: string
        description: Transport class codes (like Y, C, U)
      carrierCode:
        type: string
      carrierName:
        type: string
      number:
        type: string
        description: Number of the transport
  PickUpDropOffPoint:
    title: Pickup Drop Off Point
    type: object
    description: >
      Represents a point for the customer to be picked to start the yourney, or
      a point where they can be dropped of to end the yourney.
    properties:
      pointId:
        type: string
      pointType:
        type: string
      description:
        type: string
      dateTime:
        type: string
        description: dateTime in yyyyMMddTHHmm
  PaymentSchedule:
    title: Payment parts and status
    description: Deprecated, The Qenner PaymentService is no longer supported, please configure payment schedule within your payment implementation.
    type: object
    properties:
      paymentTerms:
        type: array
        items:
          $ref: '#/definitions/PaymentTerm'
    required:
      - paymentTerms
  PaymentTerm:
    title: Payment term
    type: object
    properties:
      name:
        type: string
      nameTag:
        type: string
      term:
        $ref: '#/definitions/Price'
      percentage:
        type: number
      percentageBase:
        type: integer
      expirationDate:
        type: string
        description: Date in yyyyMMdd format
    required:
      - name
      - term
      - percentage
      - percentageBase
  CancellationDetail:
    title: Cancellation details
    type: object
    properties:
      providerId:
        type: integer
        format: int64
      daysBeforeDeparture:
        type: integer
        description:
            The given price applies when the booking is cancelled at
            least this number of days before departure.
      amountToPay:
        $ref: '#/definitions/Price'
    required:
        - providerId
        - daysBeforeDeparture
        - amountToPay

  PrepareCancelRequest:
    title: Prepare cancellation of a booking, get cancellation cost
    type: object
    properties:
      bookingNumber:
        type: string
    required:
      - bookingNumber
  PrepareCancelResponse:
    title: Returns the cancellation cost and a token to confirm the cancellation
    type: object
    properties:
      bookingNumber:
        type: string
      cancellationCost:
        $ref: '#/definitions/Price'
      cancellationToken:
        type: string
      messages:
        type: array
        items:
          $ref: '#/definitions/Message'
    required:
      - messages
  ConfirmCancelRequest:
    title: Cofirms the cancellation of a booking
    type: object
    properties:
      bookingNumber:
        type: string
      cancellationCost:
        $ref: '#/definitions/Price'
      cancellationToken:
        type: string
    required:
      - bookingNumber
      - cancellationCost
      - cancellationToken
  ConfirmCancelResponse:
    title: Confirmation of the cancellation
    type: object
    properties:
      bookingNumber:
        type: string
      success:
        type: boolean
      messages:
        type: array
        items:
          $ref: '#/definitions/Message'
    required:
      - messages
  RecapBookingRequest:
    title: Request to recap a previously completed booking
    type: object
    properties:
      bookingNumber:
        type: string
    required:
      - bookingNumber
  RecapBookingResponse:
    title: Details of a previously completed booking
    type: object
    properties:
      bookingStatus:
        type: string
        enum: [open, inProgress, prepared, booked, requested, cancelled, failed, testBooked]
      bookingNumber:
        type: string
      bookingDateTime:
        type: string
        description: dateTime in yyyyMMddTHHmmssZ
      invoiceId:
        type: integer
        format: int64
        description: >
          Identifier of the invoice on which payments can be made through the
          Qenner PaymentService.
      totalPrice:
        $ref: '#/definitions/Price'
      totalPriceAtLocation:
        $ref: '#/definitions/Price'
      totalSecurityDeposit:
        $ref: '#/definitions/Price'
      priceSegments:
        type: array
        items:
          $ref: '#/definitions/PriceSegment'
      bookedAccommodations:
        type: array
        items:
          $ref: '#/definitions/BookedAccommodation'
      bookedTransports:
        type: array
        items:
          $ref: '#/definitions/BookedTransport'
      mainBooker:
        $ref: '#/definitions/Customer'
      homeContact:
        $ref: '#/definitions/Contact'
      paymentSchedule:
        $ref: '#/definitions/PaymentSchedule'
      cancellationDetails:
        type: array
        items:
          $ref: '#/definitions/CancellationDetail'
      luggageAssignments:
        type: array
        items:
          $ref: '#/definitions/LuggageAssignment'
      extraAssignments:
        type: array
        items:
          $ref: '#/definitions/ExtraAssignment'
      transferAssignments:
        type: array
        items:
          $ref: '#/definitions/TransferAssignment'
      insuranceAssignments:
        type: array
        items:
          $ref: '#/definitions/InsuranceAssignment'
      parkingAssignments:
        type: array
        items:
          $ref: '#/definitions/ParkingAssignment'
      carRentalAssignments:
        type: array
        items:
          $ref: '#/definitions/CarRentalAssignment'
      airportHotelAssignments:
        type: array
        items:
          $ref: '#/definitions/AirportHotelAssignment'

      messages:
        type: array
        items:
          $ref: '#/definitions/Message'
      sessionId:
        type: string
        description: >
          Although the recap request doesn't require a session, the sessionId here acts
          as a trackingId and can be used for troubleshooting.
    required:
      - bookedAccommodations
      - bookedTransports
      - messages
      - cancellationDetails
  BookedAccommodation:
    title: Accommodation
    type: object
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      providerBookingReference:
        type: string
      accommodationBookingReference:
        type: string
      accommodationId:
        type: integer
        format: int64
      accommodationSubId:
        type: string
      accommodationType:
        type: string
      name:
        type: string
      place:
        type: string
      district:
        type: string
      country:
        type: string
      telephone:
        type: string
      address:
        type: string
      zipcode:
        type: string
      startDate:
        type: string
        description: Date in yyyyMMdd format
      nightCount:
        type: integer
      totalPrice:
        $ref: '#/definitions/Price'
      units:
        type: array
        items:
          $ref: '#/definitions/BookedUnit'
      bookingStatus:
        type: string
        enum: [open, inProgress, prepared, booked, requested, cancelled, failed, testBooked]
    required:
      - providerId
      - units
  BookedUnit:
    title: Unit
    type: object
    properties:
      unitId:
        type: string
      unitName:
        type: string
      unitType:
        type: string
      boardType:
        type: string
      travelers:
        type: array
        items:
          $ref: '#/definitions/Traveler'
    required:
      - unitId
      - unitName
      - unitType
      - travelers
  BookedTransport:
    title: Transport
    type: object
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      providerBookingReference:
        type: string
      transportBookingReference:
        type: string
      transportCode:
        type: string
      transportType:
        type: string
      number:
        type: string
        description: Number of the transport
      packageCode:
        type: string
        description: >
          Provided if Transport is part of a touroperator package.
          If not empty must be combined with units and transports with the same packageCode.
      departurePoint:
        type: string
      arrivalPoint:
        type: string
      departureDateTime:
        type: string
        description: dateTime in yyyyMMddTHHmmssZ
      arrivalDateTime:
        type: string
        description: dateTime in yyyyMMddTHHmmssZ
      departurePickUpPoint:
        type: string
      arrivalDropOffPoint:
        type: string
      class:
        type: string
        enum: [economy, comfort, business, luxe, royal, tourist, first, second]
        description: >
          Transport class, typically economy, comfort or business for flight,
          comfort, luxe, royal or tourist for bus, and first or second
          for train.
      classCode:
        type: string
        description: Transport class codes (like Y, C, U)
      classDescription:
        type: string
        description: Human-readable description of flight class
      carrierCode:
        type: string
      carrierName:
        type: string
      travelers:
        type: array
        items:
          $ref: '#/definitions/Traveler'
      bookingStatus:
        type: string
        enum: [open, inProgress, prepared, booked, requested, cancelled, failed, testBooked]

  Extra:
    title: Extra
    type: object
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      bookingCode:
        type: string
      extraId:
        type: string
        description: Unique identifier of this Extra
      description:
        type: string
        description: (Short) Human readable description of the extra
      extendedDescription:
        type: string
        description: Longer human readable description of the extra
      category:
        type: string
        description: provider's category for this extra
      status:
        type: string
        enum: [optional, required, onRequest, available, facultative, unkown]
      price:
        $ref: '#/definitions/Price'
      priceUnit:
        type: string
        description: The price-unit for which the price counts (translated)
      priceUnitCode:
        type: string
        description: An untranslated code for the price-unit which can be used for mappings, should be one of PerStay, PerPerson, PerDay, PerNight, PerPersonPerDay, PerPersonPerNight, PercentageOfTravelSum
      group:
        type: string
        description: >
          If status is facultative (requires at least one) then this group groups the
          extra records from which one has to be chosen. If this field is empty then one
          must be chosen from all extras
      priceNotes:
        type: array
        items:
          type: string
        description: Detailed price rules for this unit
      fromDate:
        type: string
        description: Deprecated, no longer used -- Date in yyyyMMdd format; possible starting date of this Extra
        deprecated: true
      toDate:
        type: string
        description: Deprecated, no longer used -- Date in yyyyMMdd format; possible ending date of this Extra
        deprecated: true
      minStartDate:
        type: string
        description: Optional item, used to determine startDateTime on assignment in yyyyMMdd format;
      maxStartDate:
        type: string
        description: Optional item, used to determine startDateTime on assignment  in yyyyMMdd format;
      minNightCount:
        type: integer
        description: Optional item, used to determine the endDateTime on assignment in yyyyMMdd format;
      maxNightCount:
        type: integer
        description: Optional item, used to determine the endDateTime on assignment yyyyMMdd format;
      minQuantity:
        type: integer
        description: Minimum quantity to book
      maxQuantity:
        type: integer
        description: Maximum quantity to book
      childPrice:
        $ref: '#/definitions/AgeRestrictedPrice'
      payAtLocation:
        type: boolean
        description: Should this Extra be paid at location
    required:
      - providerId
      - extraId
  ExtraAssignment:
    title: Selected and optionally assigned extras
    type: object
    properties:
      extra:
        $ref: '#/definitions/Extra'
      amount:
        type: integer
      startDate:
        type: string
        description: date in yyyyMMdd. When a min- and maxStartDate are set in the extra, a startDate must be selected and assigned here.
      endDate:
        type: string
        description: date in yyyyMMdd. When a min- and maxStartDate, and min- and maxNightCount are set in the extra, a endDate must be calculated and assigned here.
      startDateTime:
        type: string
        description: Deprecated, no longer used -- dateTime in yyyyMMddTHHmmssZ
        deprecated: true
      endDateTime:
        type: string
        description: Deprecated, no longer used -- dateTime in yyyyMMddTHHmmssZ
        deprecated: true
      assignedTravelerIds:
        type: array
        items:
          type: integer
    required:
      - extra
  BookableLuggage:
    title: Bookable Luggage options
    type: object
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      bookingCode:
        type: string
        description: >
          Corresponds with the bookingCode on BookableTransport and/or
          BookableAccommodation
      type:
        type: string
        enum: [hand, hold]
        description: >
          Per type, zero or one of the options can be assigned to each customer
      toLuggageOption:
        $ref: '#/definitions/Luggage'
      fromLuggageOptions:
        type: array
        items:
          $ref: '#/definitions/Luggage'
  Luggage:
    title: Luggage options
    type: object
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      bookingCode:
        type: string
        description: >
          Corresponds with the bookingCode on BookableTransport and/or
          BookableAccommodation
      type:
        type: string
        enum: [hand, hold]
        description: >
          Per type, zero or one of the options can be assigned to each customer
      luggageCode:
        type: string
      direction:
        type: string
        enum: [outbound, inbound, return]
      weight:
        type: integer
        description: >
          Weight in kilos. If it couldn't be determined, the value will be
          `null`. And because it sometimes is a parsed value, it should only be used for
          ordering the luggage options.
      description:
        type: string
      extendedDescription:
        type: string
      price:
        $ref: '#/definitions/Price'
      childPrice:
        $ref: '#/definitions/AgeRestrictedPrice'
    required:
      - providerId
      - bookingCode
      - luggageCode
  LuggageAssignment:
    title: Selected Luggage options per Traveler
    description: >
      Luggage is optional, for each Traveler one assignment can be added.
      Each Traveler can have a Hand LuggageOption, Hold LuggageOption, or both.
      At least one option must be specified.
    type: object
    properties:
      assignedTravelerId:
        type: integer
      toHandLuggageOption:
        $ref: '#/definitions/Luggage'
        description: a toLuggageOption returned from getBookableExtras of type \'Hand\'
      fromHandLuggageOption:
        $ref: '#/definitions/Luggage'
        description: a fromLuggageOption returned from getBookableExtras of type \'Hand\'
      toHoldLuggageOption:
        $ref: '#/definitions/Luggage'
        description: a toLuggageOption returned from getBookableExtras of type \'Hold\'
      fromHoldLuggageOption:
        $ref: '#/definitions/Luggage'
        description: a fromLuggageOption returned from getBookableExtras of type \'Hold\'
    required:
      - assignedTravelerId

  BookableTransfer:
    title: Bookable Transfer options
    type: object
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      bookingCode:
        type: string
      toTransferOptions:
        type: array
        items:
          $ref: '#/definitions/Transfer'
      fromTransferOptions:
        type: array
        items:
          $ref: '#/definitions/Transfer'
    required:
      - providerId
      - bookingCode
      - toTransferOptions
      - fromTransferOptions
  Transfer:
    title: Transfer option
    type: object
    properties:
      description:
        type: string
      extendedDescription:
        type: string
      bookingCode:
        type: string
      transferId:
        type: string
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      arrivalName:
        type: string
      departureName:
        type: string
      imageUrls:
        type: array
        items:
          type: string
      transferTimeMinutes:
        type: integer
      minOccupation:
        type: integer
      maxOccupation:
        type: integer
      totalPrice:
        $ref: '#/definitions/Price'
    required:
      - bookingCode
      - transferId
      - providerId
      - description
      - arrivalName
      - departureName
      - totalPrice
  TransferAssignment:
    title: Selected Transfer options per Traveler
    type: object
    properties:
      toTransferOption:
        $ref: '#/definitions/Transfer'
      fromTransferOption:
        $ref: '#/definitions/Transfer'
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      assignedTravelerIds:
          type: array
          items:
            type: integer
    required:
      - assignedTravelerIds
      - providerId
  TransferAssignmentDescription:
    title: Transfer Assignment Description
    type: object
    properties:
      transferAssignment:
        $ref: '#/definitions/TransferAssignment'
      providerBookingReference:
        type: string
        description: Available after CompleteBooking.
    required:
      - transferAssignment


  Insurance:
    title: Insurance
    type: object
    description: TODO
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      insuranceId:
        type: string
        description: Id of the insurance to be booked
      insuranceCoverages:
        type: array
        items:
          $ref: '#/definitions/InsuranceCoverage'
        description: >
          List of InsuranceCoverage objects describing what is covered by this insurance
    required:
      - providerId
      - insuranceId
  InsuranceCoverage:
    title: Insurance Coverage
    type: object
    description: Describes what is covered by an insurance
    properties:
      code:
        type: string
      coveredPrice:
        $ref: '#/definitions/Price'
        description: The amount to be covered
  InsuranceAssignment:
    title: Selected insurance
    type: object
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      insuranceId:
        type: string
        description: Id of the selected insurance
      assignedTravelerIds:
        type: array
        items:
          type: integer
    required:
      - providerId
      - insuranceId
  InsuranceAssignmentDescription:
    title: Insurance Assignment Description
    type: object
    properties:
      insuranceAssignment:
        $ref: '#/definitions/InsuranceAssignment'
      providerBookingReference:
        type: string
        description: Available after CompleteBooking.
    required:
      - insuranceAssignment

  Parking:
    title: Parking
    type: object
    description: Contains all information about parking possibilities at or around the airport
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      parkingId:
        type: string
      parkingDistanceMeters:
        type: integer
        description: Distance of the parking in meters
      parkingDistanceMinutes:
        type: integer
        description: Distance of the parking in minutes
      name:
        type: string
        description: Name of the parking
      description:
        type: string
        description: Textual description of the parking
      totalPrice:
        $ref: '#/definitions/Price'
        description: Total price, optionally available in the recap
      status:
        type: string
        description: Status of the parking option
      parkingOptions:
        type: array
        items:
          $ref: '#/definitions/ParkingOption'
        description: >
          User selectable options for the parking
      parkingConditionsUrl:
        type: string
        description: >
          In case there are online conditions for the parking, it could be found on
          the given url
    required:
      - providerId
      - parkingId
  ParkingOption:
    type: object
    title: A user selectable option for a parking
    properties:
      parkingOptionId:
        type: string
      name:
        type: string
    required:
      - parkingOptionId
  ParkingAssignment:
    title: Selected Parking
    type: object
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      parking:
        $ref: '#/definitions/Parking'
        description: >
          The chosen parking with (only) the chosen options
#      parkingOptions:
#        type: array
#        items:
#          $ref: '#/definitions/ParkingOption'
#        description: >
#          Selected options for the parking
    required:
      - providerId
      - parking
  ParkingAssignmentDescription:
    title: Parking Assignment Description
    type: object
    properties:
      parkingAssignment:
        $ref: '#/definitions/ParkingAssignment'
      providerBookingReference:
        type: string
        description: Available after CompleteBooking.
    required:
      - parkingAssignment

  CarRentalLocation:
    title: Car rental location
    type: object
    description: Contains all information about possible car rental pickup locations.
  CarRental:
    title: Car rental
    type: object
    description: TODO
  CarRentalAssignment:
    title: Selected car rental
    type: object
    description: TODO
  CarRentalAssignmentDescription:
    title: Car Rental Assignment Description
    type: object
    properties:
      carRentalAssignment:
        $ref: '#/definitions/CarRentalAssignment'
      providerBookingReference:
        type: string
        description: Available after CompleteBooking.
    required:
      - carRentalAssignment

  AirportHotel:
    title: Airport hotel
    type: object
    description: >
      An airport hotel object contains all information about possible airport hotels.
      These airport hotels have parking included.
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      airportHotelId:
        type: string
      name:
        type: string
      description:
        type: string
      price:
        $ref: '#/definitions/Price'
      status:
        type: string
      roomId:
        type: string
      roomName:
        type: string
      roomType:
        type: string
      boardCode:
        type: string
      boardName:
        type: string
      maxAdults:
        type: integer
      maxChildren:
        type: integer
      parkingDays:
        type: integer
        description: How many parking days are part of the airport hotel stay
    required:
      - providerId
      - airportHotelId
  AirportHotelAssignment:
    title: Selected airport hotel
    type: object
    description: Selected airport hotel
    properties:
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
      airportHotelId:
        type: string
      roomId:
        type: string
      boardCode:
        type: string
    required:
      - providerId
      - airportHotelId
  AirportHotelAssignmentDescription:
    title: Airport Hotel Assignment Description
    type: object
    properties:
      airportHotelAssignment:
        $ref: '#/definitions/AirportHotelAssignment'
      providerBookingReference:
        type: string
        description: Available after CompleteBooking.
    required:
      - airportHotelAssignment

  PackageInfo:
    title: Package info, describes the package the accommodation belongs to.
    type: object
    description: This object echos packageinfo found in the DynaxSearch TS3 api. Current supported flags are IncludingTransfer, ExcludingTransfer, IncludingCarRental, IncludingSkiPass
    properties:
      code:
        type: string
        description: Code of the package
      name:
        type: string
        description: Name of the project
      flags:
        type: array
        description: Flags describing package options
        items:
          type: string
    required:
      - code
      - name
      - flags


  Message:
    title: Status message from service or backend providers
    type: object
    properties:
      code:
        type: string
      description:
        type: string
      consumerDescription:
        type: string
      type:
        type: string
        enum: [info, warning, error, erratum]
      messageOn:
        type: string
      providerId:
        type: integer
        format: int64
      providerName:
        type: string
