openapi: 3.1.0
info:
  title: Analytics API for Template
  description: Analytics API for Template provides the ability to retrieve travel itineraries for a Template partner.
  version: v1

tags:
  - name: Analytics API for Template
    description: Analytics API for Template provides the ability to retrieve travel itineraries for a given Template partner.

servers:
  - url: https://analytics.ean.com/template/v1

paths:
  /itineraries:
    get:
      operationId: itineraries
      tags:
        - Bookings
      description: |
        List itineraries for a given date range. \
        At least one pair of creation_date_start and creation_date_end, or update_date_time_start and update_date_time_end must be provided. \
        Each page contains 50 itineraries.
      parameters:
        - $ref: '#/components/parameters/CreationDateStart'
        - $ref: '#/components/parameters/CreationDateEnd'
        - $ref: '#/components/parameters/UpdateDateTimeStart'
        - $ref: '#/components/parameters/UpdateDateTimeEnd'
        - $ref: '#/components/parameters/Token'
        - $ref: '#/components/parameters/IncludePii'
      responses:
        "200":
          description: OK
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
            link:
              description: |
                Contains a single link to get the immediate next page of results. 
                This header will be missing when there are no further results.
              schema:
                type: string
                example: /v1/itineraries?creation_date_start=2024-06-02&creation_date_end=2024-06-20&token=NzI4NTYxMDYxNjQ4NzcsMjAyNC0wNi0xNw==
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListItinerariesResponse'
              examples:
                ListOfItineraries:
                  value:
                    - itinerary_id: '12345678910111'
                      status: Confirmed
                      update_date_time: '2023-10-01T12:00:00Z'
                      creation_date: '2023-10-01'
                      online: true
                      package: true
                      payment_type: Credit Card
                      point_of_sale_country_code: GB
                      purchaser:
                        email: smith@example.com
                        loyalty_id: '12345678'
                      property_booking_items:
                        - booking_item_id: "1400882912"
                          status: Confirmed
                          checkin_date: '2023-10-02'
                          checkout_date: '2023-10-17'
                          property:
                            id: "123456"
                            name: Hotel 1
                            chain_name: Independent
                            brand_name: Savoy Signature
                            star_rating: 3.0
                            city: Toronto
                            state_province_name: Ontario
                            country_code: CA
                          property_confirmation_id: '1516171819'
                          room_name: Comfort Double Room, Private Bathroom
                          adult_count: 1
                          child_count: 1
                          expedia_collect: true
                          rate:
                            rate_plan_name: Room Only
                            rate_plan_type: Distribution Rate
                            refundable: true
                            pricing:
                              gross_booking_value:
                                billable_currency:
                                  value: 1000.00
                                  currency: GBP
                              taxes_and_fees:
                                billable_currency:
                                  value: 100.00
                                  currency: GBP
                      flight_booking_items:
                        - booking_item_id: "1400882911"
                          status: Confirmed
                          departure_date: '2023-10-02'
                          arrival_date: '2023-10-02'
                          airline:
                            plating_carrier: Air Canada
                            plating_carrier_code: AC
                          carrier_pnr: BCDEFG
                          ticket_number: '123456789101'
                          trip_type: One Way
                          segment_count: 1
                          fare_class: Business Class
                          airport_origin_code: LHR
                          airport_destination_code: YYZ
                          airport_origin_location: London, GB (LHR-Heathrow)
                          airport_destination_location: Toronto, ON (YYZ-Lester B. Pearson Intl.)
                          expedia_collect: false
                          rate:
                            pricing:
                              gross_booking_value:
                                billable_currency:
                                  value: 500.54
                                  currency: GBP
                              taxes_and_fees:
                                billable_currency:
                                  value: 140.05
                                  currency: GBP
                        - booking_item_id: "1400882915"
                          status: Confirmed
                          departure_date: '2023-10-02'
                          arrival_date: '2023-10-02'
                          airline:
                            plating_carrier: Air Canada
                            plating_carrier_code: AC
                          carrier_pnr: BCDEFG
                          ticket_number: '123456789101'
                          trip_type: One Way
                          segment_count: 1
                          fare_class: Business Class
                          airport_origin_code: LHR
                          airport_destination_code: YYZ
                          airport_origin_location: London, GB (LHR-Heathrow)
                          airport_destination_location: Toronto, ON (YYZ-Lester B. Pearson Intl.)
                          expedia_collect: false
                          rate:
                            pricing:
                              gross_booking_value:
                                billable_currency:
                                  value: 500.54
                                  currency: GBP
                              taxes_and_fees:
                                billable_currency:
                                  value: 140.05
                                  currency: GBP
                      car_booking_items:
                        - booking_item_id: "1400882910"
                          status: Confirmed
                          pickup_date: '2023-10-02'
                          return_date: '2023-10-17'
                          rental_company:
                            name: Hertz
                          rental_company_confirmation_id: ABC1234
                          trip_type: Round Trip
                          car_type: 2/4 Door_Compact
                          pickup_location: Deer Lake, NL (YDF-Deer Lake Regional)
                          pickup_country_code: CA
                          return_location: Deer Lake, NL (YDF-Deer Lake Regional)
                          return_country_code: CA
                          expedia_collect: false
                          rate:
                            pricing:
                              gross_booking_value:
                                billable_currency:
                                  value: 690.80
                                  currency: GBP
                              taxes_and_fees:
                                billable_currency:
                                  value: 80.08
                                  currency: GBP
                      activity_booking_items:
                        - booking_item_id: "1400882910"
                          status: Confirmed
                          activity_start_date: '2023-10-08'
                          activity_end_date: '2023-10-08'
                          vendor:
                            name: Viator
                            city: Deer Lake, NL (YDF-Deer Lake Regional)
                            country_code: CA
                          offering_name: 'Passions of Paradise Great Barrier Reef '
                          rate:
                            pricing:
                              gross_booking_value:
                                billable_currency:
                                  value: 210.20
                                  currency: GBP
                              taxes_and_fees:
                                billable_currency:
                                  value: 10.02
                                  currency: GBP
                      insurance_booking_items:
                        - booking_item_id: "1400882610"
                          status: Confirmed
                          rate:
                            pricing:
                              gross_booking_value:
                                billable_currency:
                                  value: 220.00
                                  currency: GBP
                              taxes_and_fees:
                                billable_currency:
                                  value: 20.10
                                  currency: GBP
                      rate:
                        pricing:
                          gross_booking_value:
                            billable_currency:
                              value: 2520.80
                              currency: GBP
                          taxes_and_fees:
                            billable_currency:
                              value: 491.10
                              currency: GBP
                      coupon:
                        code: ABCD
                        name: PRIME
                        description: BoGo 5%
                        value: 115.00
                        currency: GBP
                EmptyListOfItineraries:
                  value: [ ]
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                DateRangeError:
                  value:
                    code: BAD_REQUEST
                    message: "The update_date_time_start must be before or equal to the update_date_time_end"
                DateFormatError:
                  value:
                    code: BAD_REQUEST
                    message: "Failed to convert argument [update_date_time_start] for value [2024-01-01] due to: Text '2024-01-01' could not be parsed at index 10"
        "401":
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: UNAUTHORIZED
                    message: "Data required to authenticate your request is missing or inaccurate."
        "403":
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: FORBIDDEN
                    message: "Insufficient permissions to perform the request."
        "429":
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: TOO_MANY_REQUESTS
                    message: "Rate limit exceeded. Please try again later."
        "500":
          description: Internal Server Error
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: INTERNAL_SERVER_ERROR
                    message: "An unexpected error occurred. Please try again later."
        "503":
          description: Service Unavailable
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: SERVICE_UNAVAILABLE
                    message: "Service is temporarily unavailable. Please try again later."
        "504":
          description: Gateway Timeout
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: GATEWAY_TIMEOUT
                    message: "Request timed out. Please try again later."

      security:
        - oauth: [ ]

  /itineraries/{itinerary_id}:
    get:
      operationId: itinerariesById
      tags:
        - Bookings
      description: |
        Get itineraries by itinerary id
      parameters:
        - name: itinerary_id
          required: true
          in: path
          schema:
            $ref: '#/components/parameters/ItineraryId'
        - $ref: '#/components/parameters/IncludePii'
      responses:
        "200":
          description: OK
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Itinerary"
              example:
                itinerary_id: '12345678910111'
                status: Confirmed
                update_date_time: '2023-10-01T12:00:00Z'
                creation_date: '2023-10-01'
                online: true
                package: true
                payment_type: Credit Card
                point_of_sale_country_code: GB
                purchaser:
                  email: smith@example.com
                  loyalty_id: '12345678'
                property_booking_items:
                  - booking_item_id: "1400882912"
                    status: Confirmed
                    checkin_date: '2023-10-02'
                    checkout_date: '2023-10-17'
                    property:
                      id: "123456"
                      name: Hotel 1
                      chain_name: Independent
                      brand_name: Savoy Signature
                      star_rating: 3
                      city: Toronto
                      state_province_name: Ontario
                      country_code: CA
                    property_confirmation_id: '1516171819'
                    room_name: Comfort Double Room, Private Bathroom
                    adult_count: 1
                    child_count: 1
                    expedia_collect: true
                    rate:
                      rate_plan_name: Room Only
                      rate_plan_type: Distribution Rate
                      refundable: true
                      pricing:
                        gross_booking_value:
                          billable_currency:
                            value: 1000.00
                            currency: GBP
                        taxes_and_fees:
                          billable_currency:
                            value: 100.00
                            currency: GBP
                flight_booking_items:
                  - booking_item_id: "1400882911"
                    status: Confirmed
                    departure_date: '2023-10-02'
                    arrival_date: '2023-10-02'
                    airline:
                      plating_carrier: Air Canada
                      plating_carrier_code: AC
                    carrier_pnr: BCDEFG
                    ticket_number: '123456789101'
                    trip_type: One Way
                    segment_count: 1
                    fare_class: Business Class
                    airport_origin_code: LHR
                    airport_destination_code: YYZ
                    airport_origin_location: London, GB (LHR-Heathrow)
                    airport_destination_location: Toronto, ON (YYZ-Lester B. Pearson Intl.)
                    expedia_collect: false
                    rate:
                      pricing:
                        gross_booking_value:
                          billable_currency:
                            value: 500.54
                            currency: GBP
                        taxes_and_fees:
                          billable_currency:
                            value: 140.05
                            currency: GBP
                  - booking_item_id: "1400882915"
                    status: Confirmed
                    departure_date: '2023-10-02'
                    arrival_date: '2023-10-02'
                    airline:
                      plating_carrier: Air Canada
                      plating_carrier_code: AC
                    carrier_pnr: BCDEFG
                    ticket_number: '123456789101'
                    trip_type: One Way
                    segment_count: 1
                    fare_class: Business Class
                    airport_origin_code: LHR
                    airport_destination_code: YYZ
                    airport_origin_location: London, GB (LHR-Heathrow)
                    airport_destination_location: Toronto, ON (YYZ-Lester B. Pearson Intl.)
                    expedia_collect: false
                    rate:
                      pricing:
                        gross_booking_value:
                          billable_currency:
                            value: 500.54
                            currency: GBP
                        taxes_and_fees:
                          billable_currency:
                            value: 140.05
                            currency: GBP
                car_booking_items:
                  - booking_item_id: "1400882910"
                    status: Confirmed
                    pickup_date: '2023-10-02'
                    return_date: '2023-10-17'
                    rental_company:
                      name: Hertz
                    rental_company_confirmation_id: ABC1234
                    trip_type: Round Trip
                    car_type: 2/4 Door_Compact
                    pickup_location: Deer Lake, NL (YDF-Deer Lake Regional)
                    pickup_country_code: CA
                    return_location: Deer Lake, NL (YDF-Deer Lake Regional)
                    return_country_code: CA
                    expedia_collect: false
                    rate:
                      pricing:
                        gross_booking_value:
                          billable_currency:
                            value: 690.80
                            currency: GBP
                        taxes_and_fees:
                          billable_currency:
                            value: 80.08
                            currency: GBP
                activity_booking_items:
                  - booking_item_id: "1400882910"
                    status: Confirmed
                    activity_start_date: '2023-10-08'
                    activity_end_date: '2023-10-08'
                    vendor:
                      name: Viator
                      city: Deer Lake, NL (YDF-Deer Lake Regional)
                      country_code: CA
                    offering_name: 'Passions of Paradise Great Barrier Reef '
                    rate:
                      pricing:
                        gross_booking_value:
                          billable_currency:
                            value: 210.20
                            currency: GBP
                        taxes_and_fees:
                          billable_currency:
                            value: 10.02
                            currency: GBP
                insurance_booking_items:
                  - booking_item_id: "1400882610"
                    status: Confirmed
                    rate:
                      pricing:
                        gross_booking_value:
                          billable_currency:
                            value: 220.00
                            currency: GBP
                        taxes_and_fees:
                          billable_currency:
                            value: 20.10
                            currency: GBP
                rate:
                  pricing:
                    gross_booking_value:
                      billable_currency:
                        value: 2520.80
                        currency: GBP
                    taxes_and_fees:
                      billable_currency:
                        value: 491.10
                        currency: GBP
                coupon:
                  code: ABCD
                  name: PRIME
                  description: BoGo 5%
                  value: 115.00
                  currency: GBP

        "400":
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: BAD_REQUEST
                    message: "An invalid request was sent in, please check the nested errors for details."

        "404":
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: NOT_FOUND
                    message: "Requested itinerary id was not found in the system.\
                     \ Please check the itinerary id and try again"
        "401":
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: UNAUTHORIZED
                    message: "Data required to authenticate your request is missing or inaccurate."
        "403":
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: FORBIDDEN
                    message: "Insufficient permissions to perform the request."
        "429":
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: TOO_MANY_REQUESTS
                    message: "Rate limit exceeded. Please try again later."
        "500":
          description: Internal Server Error
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: INTERNAL_SERVER_ERROR
                    message: "An unexpected error occurred. Please try again later."
        "503":
          description: Service Unavailable
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: SERVICE_UNAVAILABLE
                    message: "Service is temporarily unavailable. Please try again later."
        "504":
          description: Gateway Timeout
          headers:
            Rate-Limit-Day:
              description: Reserved for future use. Optional header for request capacity
                per day.
              schema:
                type: number
            Rate-Limit-Day-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the daily time window."
              schema:
                type: number
            Rate-Limit-Day-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the daily capacity resets."
              schema:
                type: number
            Rate-Limit-Minute:
              description: Reserved for future use. Optional header for request capacity
                per minute.
              schema:
                type: number
            Rate-Limit-Minute-Remaining:
              description: "Optional header for the remaining capacity, as a percentage,\
                          \ for the per minute time window."
              schema:
                type: number
            Rate-Limit-Minute-Reset:
              description: "Optional header for the timestamp, as the number of milliseconds\
                          \ since the Unix Epoch, when the per minute capacity resets."
              schema:
                type: number
            Rate-Limit-Reduction-Status:
              description: "Optional header that indicates the state (inactive, active)\
                          \ of minute capacity reduction triggered once all daily capacity has\
                          \ been used."
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                Error:
                  value:
                    code: GATEWAY_TIMEOUT
                    message: "Request timed out. Please try again later."

      security:
        - oauth: [ ]

webhooks:
  itineraryEvents:
    post:
      parameters:
        - $ref: '#/components/parameters/WebhookAuthorizationHeader'
      requestBody:
        description: Webhook event payload containing the itinerary data
        content:
          application/cloudevents+json:
            schema:
              $ref: "#/components/schemas/ItineraryReportingEvent"
            example:
              itinerary_id: '12345678910111'
              status: Confirmed
              update_date_time: '2023-10-01T12:00:00Z'
              creation_date: '2023-10-01'
              online: true
              package: true
              payment_type: Credit Card
              point_of_sale_country_code: GB
              purchaser:
                email: smith@example.com
                loyalty_id: '12345678'
              property_booking_items:
                - booking_item_id: "1400882912"
                  status: Confirmed
                  checkin_date: '2023-10-02'
                  checkout_date: '2023-10-17'
                  property:
                    id: "123456"
                    name: Hotel 1
                    chain_name: Independent
                    brand_name: Savoy Signature
                    star_rating: 3
                    city: Toronto
                    state_province_name: Ontario
                    country_code: CA
                  property_confirmation_id: '1516171819'
                  room_name: Comfort Double Room, Private Bathroom
                  adult_count: 1
                  child_count: 1
                  expedia_collect: true
                  rate:
                    rate_plan_name: Room Only
                    rate_plan_type: Distribution Rate
                    refundable: true
                    pricing:
                      gross_booking_value:
                        billable_currency:
                          value: 1000.00
                          currency: GBP
                      taxes_and_fees:
                        billable_currency:
                          value: 100.00
                          currency: GBP
              flight_booking_items:
                - booking_item_id: "1400882911"
                  status: Confirmed
                  departure_date: '2023-10-02'
                  arrival_date: '2023-10-02'
                  airline:
                    plating_carrier: Air Canada
                    plating_carrier_code: AC
                  carrier_pnr: BCDEFG
                  ticket_number: '123456789101'
                  trip_type: One Way
                  segment_count: 1
                  fare_class: Business Class
                  airport_origin_code: LHR
                  airport_destination_code: YYZ
                  airport_origin_location: London, GB (LHR-Heathrow)
                  airport_destination_location: Toronto, ON (YYZ-Lester B. Pearson Intl.)
                  expedia_collect: false
                  rate:
                    pricing:
                      gross_booking_value:
                        billable_currency:
                          value: 500.54
                          currency: GBP
                      taxes_and_fees:
                        billable_currency:
                          value: 140.05
                          currency: GBP
                - booking_item_id: "1400882915"
                  status: Confirmed
                  departure_date: '2023-10-02'
                  arrival_date: '2023-10-02'
                  airline:
                    plating_carrier: Air Canada
                    plating_carrier_code: AC
                  carrier_pnr: BCDEFG
                  ticket_number: '123456789101'
                  trip_type: One Way
                  segment_count: 1
                  fare_class: Business Class
                  airport_origin_code: LHR
                  airport_destination_code: YYZ
                  airport_origin_location: London, GB (LHR-Heathrow)
                  airport_destination_location: Toronto, ON (YYZ-Lester B. Pearson Intl.)
                  expedia_collect: false
                  rate:
                    pricing:
                      gross_booking_value:
                        billable_currency:
                          value: 500.54
                          currency: GBP
                      taxes_and_fees:
                        billable_currency:
                          value: 140.05
                          currency: GBP
              car_booking_items:
                - booking_item_id: "1400882910"
                  status: Confirmed
                  pickup_date: '2023-10-02'
                  return_date: '2023-10-17'
                  rental_company:
                    name: Hertz
                  rental_company_confirmation_id: ABC1234
                  trip_type: Round Trip
                  car_type: 2/4 Door_Compact
                  pickup_location: Deer Lake, NL (YDF-Deer Lake Regional)
                  pickup_country_code: CA
                  return_location: Deer Lake, NL (YDF-Deer Lake Regional)
                  return_country_code: CA
                  expedia_collect: false
                  rate:
                    pricing:
                      gross_booking_value:
                        billable_currency:
                          value: 690.80
                          currency: GBP
                      taxes_and_fees:
                        billable_currency:
                          value: 80.08
                          currency: GBP
              activity_booking_items:
                - booking_item_id: "1400882910"
                  status: Confirmed
                  activity_start_date: '2023-10-08'
                  activity_end_date: '2023-10-08'
                  vendor:
                    name: Viator
                    city: Deer Lake, NL (YDF-Deer Lake Regional)
                    country_code: CA
                  offering_name: 'Passions of Paradise Great Barrier Reef '
                  rate:
                    pricing:
                      gross_booking_value:
                        billable_currency:
                          value: 210.20
                          currency: GBP
                      taxes_and_fees:
                        billable_currency:
                          value: 10.02
                          currency: GBP
              insurance_booking_items:
                - booking_item_id: "1400882610"
                  status: Confirmed
                  rate:
                    pricing:
                      gross_booking_value:
                        billable_currency:
                          value: 220.00
                          currency: GBP
                      taxes_and_fees:
                        billable_currency:
                          value: 20.10
                          currency: GBP
              rate:
                pricing:
                  gross_booking_value:
                    billable_currency:
                      value: 2520.80
                      currency: GBP
                  taxes_and_fees:
                    billable_currency:
                      value: 491.10
                      currency: GBP
              coupon:
                code: ABCD
                name: PRIME
                description: BoGo 5%
                value: 115.00
                currency: GBP
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookResponse"
              example:
                status: "success"
                message: "Webhook event processed successfully"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookResponse"
              example:
                status: "error"
                message: "Invalid payload"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookResponse"
              example:
                status: "error"
                message: "Unauthorized"

        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookResponse"
              example:
                status: "error"
                message: "Internal Server Error"

        "503":
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookResponse"
              example:
                status: "error"
                message: "Service Unavailable"

components:
  schemas:
    ListItinerariesResponse:
      type: object
      properties:
        data:
          type: "array"
          items:
            $ref: "#/components/schemas/Itinerary"

    Itinerary:
      type: object
      properties:
        itinerary_id:
          type: "string"
          description: The itinerary id
        status:
          type: "string"
          enum: ["Confirmed", "Cancelled"]
          description: The status of the itinerary, one of confirmed/cancelled.
        update_date_time:
          type: "string"
          description: The last update date time for the itinerary in ISO-8601 date format (YYYY-MM-dd"T"HH:mm:ss.SSSZ).
        creation_date:
          type: "string"
          description: The date when the itinerary was created/booked in ISO-8601 date format (YYYY-MM-dd).
        online:
          type: "boolean"
          description: Indicates whether the booking made was an online booking or an offline via a support agent.
        package:
          type: "boolean"
          description: Indicates whether the booking made was part of a package or a standalone booking.
        payment_type:
          type: "string"
          description: The payment type used e.g Credit Card, Points, Split Pay.
        point_of_sale_country_code:
          type: "string"
          description: The country code for the point of sale from which customer made the booking
            in two-letter ISO 3166-1 alpha-2 format.
        purchaser:
          type: "object"
          properties:
            email:
              type: "string"
              description: The email address of the purchaser of the itinerary.
            loyalty_id:
              type: "string"
              description: The loyalty id of the purchaser of the itinerary.
        property_booking_items:
          type: "array"
          items:
            $ref: "#/components/schemas/PropertyBookingItem"
        flight_booking_items:
          type: "array"
          items:
            $ref: "#/components/schemas/FlightBookingItem"
        car_booking_items:
          type: "array"
          items:
            $ref: "#/components/schemas/CarBookingItem"
        activity_booking_items:
          type: "array"
          items:
            $ref: "#/components/schemas/ActivityBookingItem"
        insurance_booking_items:
          type: "array"
          items:
            $ref: "#/components/schemas/InsuranceBookingItem"
        rate:
          $ref: "#/components/schemas/Rate"
        coupon:
          $ref: "#/components/schemas/Coupon"

    PropertyBookingItem:
      type: object
      properties:
        booking_item_id:
          type: "string"
          description: A unique identifier for a single itinerary item in this case a room.
        status:
          type: "string"
          enum: ["Confirmed", "Cancelled"]
          description: The status of the booking item one of confirmed/cancelled.
        checkin_date:
          type: "string"
          description: The checkin date at the property in ISO-8601 date format (YYYY-MM-dd).
        checkout_date:
          type: "string"
          description: The checkout date at the property in ISO-8601 date format (YYYY-MM-dd).
        property:
          $ref: "#/components/schemas/Property"
        room_name:
          type: "string"
          description: The room type booked e.g Double Room, Private Bathroom.
        adult_count:
          type: "number"
          description: Number of adults accounted for within the booking
        child_count:
          type: "number"
          description: Number of children accounted for within the booking.
        expedia_collect:
          type: "boolean"
          description: Indicates if payment is made at checkout (true) or to the provider (false)
        property_confirmation_id:
          type: "string"
          description: The confirmation id provided by the hotel or vacation rental company.
        rate:
          $ref: "#/components/schemas/LodgingRate"

    Property:
      type: object
      properties:
        id:
          type: "string"
        chain_name:
          type: "string"
          description: Chains represent a parent company associated with the property.
        brand_name:
          type: "string"
          description: Represents the brand associated with the chain, a chain can have multiple brands.
        name:
          type: "string"
          description: Property name
        city:
          type: "string"
          description: The name of the city where the property is located.
        state_province_name:
          type: "string"
          description: The name of the state or province where the property is located.
        country_code:
          type: "string"
          description: The country code for the property location in two-letter ISO 3166-1 alpha-2 format.
        star_rating:
          type: "number"
          description: Star rating of the property.

    LodgingRate:
      type: object
      properties:
        rate_plan_name:
          type: "string"
          description: The name of the rate plan used for pricing of the item e.g Room Only, Bed & Breakfast
        rate_plan_type:
          type: "string"
          description: The type of the rate used for the booking e.g Package Rate, Distribution Rate
        refundable:
          type: "boolean"
          description: Whether the booking is refundable or not.
        pricing:
          $ref: "#/components/schemas/Pricing"

    Rate:
      type: object
      properties:
        pricing:
          $ref: "#/components/schemas/Pricing"

    FlightBookingItem:
      type: object
      properties:
        booking_item_id:
          type: "string"
          description: A unique identifier for a single itinerary item in this case a flight ticket.
        status:
          type: "string"
          enum: ["Confirmed", "Cancelled"]
          description: The status of the booking item one of booked/cancelled.
        departure_date:
          type: "string"
          description: The departure date in ISO-8601 date format (YYYY-MM-dd).
        arrival_date:
          type: "string"
          description: The arrival date in ISO-8601 date format (YYYY-MM-dd).
        airline:
          $ref: "#/components/schemas/Airline"
        rate:
          $ref: "#/components/schemas/Rate"
        carrier_pnr:
          type: "string"
          description: Supplier provided Air Passenger Name Record(PNR)
        trip_type:
          type: "string"
          enum: ["one_way", "round_trip", "multiple_destinations"]
          description: The type of trip e.g `one_way`, `round_trip`, `multiple_destinations`
        fare_class:
          type: "string"
          description: The fare class of the ticket e.g Economy, Business
        airport_origin_code:
          type: "string"
          description: The airport code for the origin airport in IATA format.
        airport_destination_code:
          type: "string"
          description: The airport code for the destination airport in IATA format.
        airport_origin_location:
          type: "string"
          description: The location of the origin airport.
        airport_destination_location:
          type: "string"
          description: The location of the destination airport.
        ticket_number:
          type: "string"
          description: The ticket number for the flight ticket.
        expedia_collect:
          type: "boolean"
          description: Indicates if payment is made at checkout (true) or to the provider (false)
        segment_count:
          type: "number"
          description: The number of segments in the flight ticket.

    Airline:
      type: object
      properties:
        plating_carrier:
          type: "string"
          description: Name of the airline issuing the ticket.
        plating_carrier_code:
          type: "string"
          description: IATA code of the airline issuing the ticket. Consists of 2 letters or a letter and a digit.

    CarBookingItem:
      type: object
      properties:
        booking_item_id:
          type: "string"
          description: A unique identifier for a single itinerary item in this case a car rental.
        status:
          type: "string"
          enum: ["Confirmed", "Cancelled"]
          description: The status of the booking item one of confirmed/cancelled.
        pickup_date:
          type: "string"
          description: The pickup date for the car rental in ISO-8601 date format (YYYY-MM-dd).
        return_date:
          type: "string"
          description: The return/drop-off date for the car rental in ISO-8601 date format (YYYY-MM-dd).
        rental_company:
          $ref: "#/components/schemas/RentalCompany"
        car_type:
          type: "string"
          description: The type of car rented e.g 2/4 Door_Compact, 4 Door_Sedan
        pickup_location:
          type: "string"
          description: The pickup location for the car rental.
        pickup_country_code:
          type: "string"
          description: The country code for the pickup location in two-letter ISO 3166-1 alpha-2 format.
        return_location:
          type: "string"
          description: The return/drop-off location for the car rental.
        return_country_code:
          type: "string"
          description: The country code for the return/drop-off location in two-letter ISO 3166-1 alpha-2 format.
        trip_type:
          type: "string"
          enum: ["one_way", "round_trip", "multiple_destinations"]
          description: The type of trip e.g., `one_way`, `round_trip`, `multiple_destinations`
        rental_company_confirmation_id:
          type: "string"
          description: The confirmation id provided by the car rental.
        expedia_collect:
          type: "boolean"
          description: Indicates if payment is made at checkout (true) or to the provider (false)
        rate:
          $ref: "#/components/schemas/Rate"

    RentalCompany:
      type: object
      properties:
        name:
          type: "string"
          description: The name of the car rental company.

    ActivityBookingItem:
      type: object
      properties:
        booking_item_id:
          type: "string"
          description: A unique identifier for a single itinerary item in this case an activity.
        status:
          type: "string"
          enum: ["Confirmed", "Cancelled"]
          description: The status of the booking item one of confirmed/cancelled.
        activity_start_date:
          type: "string"
          description: The start date of the activity in ISO-8601 date format (YYYY-MM-dd).
        activity_end_date:
          type: "string"
          description: The end date of the activity in ISO-8601 date format (YYYY-MM-dd).
        vendor:
          $ref: "#/components/schemas/ActivityVendor"
        offering_name:
          type: "string"
          description: The offering name of the activity booked.
        expedia_collect:
          type: "boolean"
          description: Indicates if payment is made at checkout (true) or to the provider (false)
        rate:
          $ref: "#/components/schemas/Rate"

    ActivityVendor:
      type: object
      properties:
        name:
          type: "string"
          description: The name of the vendor providing the activity.
        city:
          type: "string"
          description: The city where the activity vendor is located.
        country_code:
          type: "string"
          description: The country code for the activity vendor in two-letter ISO 3166-1 alpha-2 format.

    InsuranceBookingItem:
      type: object
      description: An insurance component/booking item.
      properties:
        booking_item_id:
          type: "string"
          description: A unique identifier for a single itinerary item in this case an insurance.
        status:
          type: "string"
          enum: ["Confirmed", "Cancelled"]
          description: The status of the booking item one of confirmed/cancelled.
        rate:
          $ref: "#/components/schemas/Rate"

    GrossBookingValue:
      type: object
      description: The gross booking value of the booking.
      properties:
        billable_currency:
          $ref: "#/components/schemas/BillableCurrency"

    TaxesAndFees:
      type: object
      description: The taxes and fees associated with the booking.
      properties:
        billable_currency:
          $ref: "#/components/schemas/BillableCurrency"

    Pricing:
      type: object
      properties:
        gross_booking_value:
          $ref: "#/components/schemas/GrossBookingValue"
        taxes_and_fees:
          $ref: "#/components/schemas/TaxesAndFees"

    BillableCurrency:
      type: object
      description: The billable currency is the currency pair used by the supplier.
      properties:
        currency:
          type: string
          description: Currency Code for the billable monetary value.
        value:
          type: number
          description: The monetary value.

    Coupon:
      type: object
      properties:
        code:
          type: string
          description: The coupon code used for the booking.
        name:
          type: string
          description: The name of the coupon.
        description:
          type: string
          description: The description of the coupon.
        value:
          type: number
          description: The monetary value of the coupon.
        currency:
          type: string
          description: The currency code for the coupon monetary value.

    Error:
      description: The object used the describe an error, containing both human-readable and in a machine-readable information.
      type: object
      properties:
        code:
          description: Snake cased all caps error code interpreted from the HTTP status code that can programmatically be acted upon.
          type: string
          example: "FORBIDDEN"
          enum:
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - TOO_MANY_REQUESTS
            - INTERNAL_ERROR
            - BAD_GATEWAY
            - SERVICE_UNAVAILABLE
            - GATEWAY_TIMEOUT
            - CONFLICT
            - BAD_REQUEST
        message:
          description: A human-readable explanation of the error, specific to this error occurrence.
          type: string
          example: "Your request could not be authorized."
      required:
        - code
        - message

    Field:
      type: object
      properties:
        name:
          type: string
          description: The field that had an error.
        type:
          type: string
          description: The type of the field that had an error.
        value:
          type: string
          description: The value of the field that had an error.
      description: An individual field that had an error.

    ItineraryReportingEvent:
      type: object
      required:
        - specversion
        - type
        - source
        - id
        - time
        - datacontenttype
        - data
      properties:
        specversion:
          type: string
          example: "1.0"
        type:
          type: string
          example: "template.itinerary.change"
        source:
          type: string
          example: "https://analytics.ean.com/template/v1"
        id:
          type: string
          example: "b79d3925-0ca3-4344-bf5e-293373959698"
        time:
          type: string
          format: date-time
          example: "2024-02-05T17:31:00Z"
        apiversion:
          type: string
          example: "v1"
        datacontenttype:
          type: string
          example: "application/json"
        data:
          oneOf:
            - $ref: '#/components/schemas/Itinerary'

    WebhookResponse:
      type: object
      #      WebhookResponse is nullable because the response is not always guaranteed from partner
      description: Response object from partners for webhook event
      properties:
        status:
          type: string
          enum: [ "success", "error"]
          description: Status of the webhook event
        message:
          type: string
          description: Message of the webhook event

  parameters:

    ItineraryId:
      name: itinerary_id
      in: path
      description: Itinerary Id to retrieve the itinerary details
      schema:
        type: string
      example: "72564500000000"
      required: true

    CreationDateStart:
      name: creation_date_start
      in: query
      description: UTC Start date of the date range to filter itineraries by booking date, ISO. 8601 format (YYYY-MM-DD)
      schema:
        type: string
        format: date
      example: 2023-09-17
      required: false

    CreationDateEnd:
      name: creation_date_end
      in: query
      description: UTC End date of the date range to filter itineraries by booking date, ISO. 8601 format (YYYY-MM-DD)
      schema:
        type: string
        format: date
      example: 2023-09-18
      required: false


    UpdateDateTimeStart:
      name: update_date_time_start
      in: query
      description: UTC Start datetime of the date range to filter itineraries by last updated date,
        ISO-8601 format (YYYY-MM-DD"T"HH.mm.ssZ).
      schema:
        type: string
        format: date
      example: 2023-09-17T00:00:00Z
      required: false

    UpdateDateTimeEnd:
      name: update_date_time_end
      in: query
      description: UTC End datetime of the date range to filter itineraries by updated date time,
        ISO-8601 format (YYYY-MM-DD"T"HH.mm.ssZ).
      schema:
        type: string
        format: date
      example: 2023-09-18T23:59:59Z
      required: false

    Token:
      name: token
      in: query
      description: Token to identify the next page of results
      schema:
        type: string
      example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
      required: false

    IncludePii:
      name: include_pii
      in: query
      description: Boolean true or false for whether to include PII information in response or not. Defaults to false.
      schema:
        type: string
      example: "true"
      required: false

    WebhookAuthorizationHeader:
      in: header
      name: authorization
      required: true
      schema:
        type: string
      description: The authorization header that contains the hmac signature and the information related. Format \
        "MAC id="{apikey}",ts="{epochTimestamp}",nonce="{guid}",bodyhash="{bodyhash}",mac="{mac}".
      example: MAC id='testApiKey',ts='1724941754807',nonce='fdcb4da6-43cb-4b98-9c20-1b1cb29936cf',bodyhash='mWnHESR9lqBxFGdvZ2nZmz5hcaSSQoZA8Xrnn78TCyw=',mac='l56tjzaDJ48DyJWQ22wzF6qJPYeMU2VIpwbmdLeDZbg='

  securitySchemes:
    oauth:
      type: oauth2
      description: "The token expires every 30 minutes."
      flows:
        clientCredentials:
          tokenUrl: https://analytics.ean.com/template/v1/oauth/token
          scopes:
            demand-solutions.demand-api-wrappers-prod.all: "Access to all Demand API Wrappers"