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

# Search flight offers

> Returns available flight offers based on search criteria including origin, destination, dates, and passenger details.



## OpenAPI

````yaml https://api.staging.rovemiles.com/functions/v1/openapi post /flights/offers
openapi: 3.0.3
info:
  title: Rove Miles API
  version: 0.1.0
  description: Data Utils, Flights, Hotels & Miles endpoints.
servers:
  - url: https://api.staging.rovemiles.com/functions/v1
security:
  - bearerAuth: []
tags:
  - name: Data
    description: Operations related to reference data like airports and places
  - name: Flights
    description: Operations related to flight search and booking
  - name: Hotels
    description: Operations related to hotel search and booking
  - name: Miles
    description: Operations related to miles and points management
  - name: Deals
    description: Operations related to special offers and promotions for flights and hotels
paths:
  /flights/offers:
    post:
      tags:
        - Flights
      summary: Search flight offers
      description: >-
        Returns available flight offers based on search criteria including
        origin, destination, dates, and passenger details.
      operationId: searchFlights
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - origin
                - destination
                - departureDate
                - adults
              properties:
                origin:
                  type: string
                  description: Origin airport IATA code
                  pattern: ^[A-Z]{3}$
                  example: JFK
                destination:
                  type: string
                  description: Destination airport IATA code
                  pattern: ^[A-Z]{3}$
                  example: LHR
                departureDate:
                  type: string
                  format: date
                  description: Departure date (YYYY-MM-DD)
                  example: '2023-10-15'
                returnDate:
                  type: string
                  format: date
                  description: Return date (YYYY-MM-DD) - omit for one-way flights
                  example: '2023-10-25'
                adults:
                  type: integer
                  description: Number of adult passengers (age 12+)
                  minimum: 1
                  maximum: 9
                  default: 1
                  example: 2
                children:
                  type: integer
                  description: Number of child passengers (age 2-11)
                  minimum: 0
                  maximum: 8
                  default: 0
                  example: 1
                infants:
                  type: integer
                  description: Number of infant passengers (under 2 years)
                  minimum: 0
                  maximum: 4
                  default: 0
                  example: 0
                cabinClass:
                  type: string
                  description: Preferred cabin class
                  enum:
                    - ECONOMY
                    - PREMIUM_ECONOMY
                    - BUSINESS
                    - FIRST
                  default: ECONOMY
                  example: BUSINESS
                bookingType:
                  type: string
                  description: Type of booking to search for
                  enum:
                    - direct
                    - transfer
                  default: direct
                  example: direct
                sort:
                  type: string
                  description: Sort order for results
                  enum:
                    - price
                    - duration
                    - best
                    - departure_time
                    - arrival_time
                  default: price
                  example: duration
                limit:
                  type: integer
                  description: Maximum number of results to return
                  minimum: 1
                  maximum: 100
                  default: 20
                  example: 10
      responses:
        '200':
          description: Successfully retrieved flight offers
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlightOfferList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NoAvailability'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    FlightOfferList:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/FlightOffer'
        meta:
          type: object
          properties:
            count:
              type: integer
              description: Number of offers returned
            totalCount:
              type: integer
              description: Total number of offers available
            sort:
              type: string
              description: Current sort order
              enum:
                - price
                - duration
                - best
                - departure_time
                - arrival_time
            links:
              type: object
              properties:
                self:
                  type: string
                  format: uri
                  description: Link to current page
                next:
                  type: string
                  format: uri
                  description: Link to next page of results
      example:
        data:
          - id: offer123
            bookingType: direct
            price:
              miles: 75000
              taxes:
                amount: '129.40'
                currency: USD
              milesPerPassenger:
                adult: 37500
                child: 37500
                infant: 0
            passengers:
              adults: 2
              children: 1
              infants: 0
            cabinClass: BUSINESS
            itineraries:
              - segments:
                  - departureAirport: JFK
                    arrivalAirport: LHR
                    departureTime: '2023-10-15T18:30:00'
                    arrivalTime: '2023-10-16T06:45:00'
                    flightNumber: BA178
                    airline:
                      code: BA
                      name: British Airways
                    duration: PT7H15M
                duration: PT7H15M
              - segments:
                  - departureAirport: LHR
                    arrivalAirport: JFK
                    departureTime: '2023-10-25T10:20:00'
                    arrivalTime: '2023-10-25T13:25:00'
                    flightNumber: BA175
                    airline:
                      code: BA
                      name: British Airways
                    duration: PT7H05M
                duration: PT7H05M
            availability: LIMITED
          - id: offer456
            bookingType: transfer
            price:
              miles: 65000
              taxes: null
              milesPerPassenger:
                adult: 32500
                child: 32500
                infant: 0
            passengers:
              adults: 2
              children: 1
              infants: 0
            cabinClass: BUSINESS
            itineraries:
              - segments:
                  - departureAirport: JFK
                    arrivalAirport: LHR
                    departureTime: '2023-10-15T18:30:00'
                    arrivalTime: '2023-10-16T06:45:00'
                    flightNumber: BA178
                    airline:
                      code: BA
                      name: British Airways
                    duration: PT7H15M
                duration: PT7H15M
              - segments:
                  - departureAirport: LHR
                    arrivalAirport: JFK
                    departureTime: '2023-10-25T10:20:00'
                    arrivalTime: '2023-10-25T13:25:00'
                    flightNumber: BA175
                    airline:
                      code: BA
                      name: British Airways
                    duration: PT7H05M
                duration: PT7H05M
            availability: AVAILABLE
        meta:
          count: 2
          totalCount: 42
          sort: duration
          links:
            self: >-
              https://api.rovemiles.com/v1/flights/offers?origin=JFK&destination=LHR&departureDate=2023-10-15&returnDate=2023-10-25&adults=2&children=1&sort=duration
            next: >-
              https://api.rovemiles.com/v1/flights/offers?origin=JFK&destination=LHR&departureDate=2023-10-15&returnDate=2023-10-25&adults=2&children=1&sort=duration&page=2
    FlightOffer:
      type: object
      required:
        - id
        - price
        - itineraries
      properties:
        id:
          type: string
          description: Unique identifier for the flight offer
        bookingType:
          type: string
          description: Type of booking
          enum:
            - direct
            - transfer
          example: direct
        price:
          type: object
          required:
            - miles
          properties:
            miles:
              type: integer
              description: Total price in Rove Miles
            taxes:
              type: object
              nullable: true
              properties:
                amount:
                  type: string
                  description: Amount of taxes and fees in local currency
                currency:
                  type: string
                  description: Currency code for taxes and fees (ISO 4217)
                  pattern: ^[A-Z]{3}$
            milesPerPassenger:
              type: object
              properties:
                adult:
                  type: integer
                  description: Miles required per adult passenger
                child:
                  type: integer
                  description: Miles required per child passenger
                infant:
                  type: integer
                  description: Miles required per infant passenger
        passengers:
          type: object
          properties:
            adults:
              type: integer
              description: Number of adult passengers
            children:
              type: integer
              description: Number of child passengers
            infants:
              type: integer
              description: Number of infant passengers
        cabinClass:
          type: string
          description: Selected cabin class
          enum:
            - ECONOMY
            - PREMIUM_ECONOMY
            - BUSINESS
            - FIRST
        itineraries:
          type: array
          description: Flight segments for outbound and return journeys
          items:
            type: object
            required:
              - segments
              - duration
            properties:
              segments:
                type: array
                items:
                  $ref: '#/components/schemas/FlightSegment'
              duration:
                type: string
                description: Total duration of the itinerary in ISO 8601 format
                example: PT8H30M
        availability:
          type: string
          description: Available seats at this price point
          enum:
            - LIMITED
            - AVAILABLE
            - WAITLIST
          default: AVAILABLE
      example:
        id: offer123
        bookingType: direct
        price:
          miles: 75000
          taxes:
            amount: '129.40'
            currency: USD
          milesPerPassenger:
            adult: 37500
            child: 37500
            infant: 0
        passengers:
          adults: 2
          children: 1
          infants: 0
        cabinClass: BUSINESS
        itineraries:
          - segments:
              - departureAirport: JFK
                arrivalAirport: LHR
                departureTime: '2023-10-15T18:30:00'
                arrivalTime: '2023-10-16T06:45:00'
                flightNumber: BA178
                airline:
                  code: BA
                  name: British Airways
                duration: PT7H15M
            duration: PT7H15M
          - segments:
              - departureAirport: LHR
                arrivalAirport: JFK
                departureTime: '2023-10-25T10:20:00'
                arrivalTime: '2023-10-25T13:25:00'
                flightNumber: BA175
                airline:
                  code: BA
                  name: British Airways
                duration: PT7H05M
            duration: PT7H05M
        availability: LIMITED
    Error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
    FlightSegment: {}
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 400
            message: Bad Request
    Unauthorized:
      description: Unauthorized - Invalid or missing token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 401
            message: Unauthorized - Invalid or missing token
    NoAvailability:
      description: No Availability
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 404
            message: No Availability
    InternalError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: 500
            message: Internal Server Error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API key for authentication. Add your API key to the Authorization header
        with this format: 'Bearer your_api_key_here'

````