Introduction

The Farel API is organized around REST. Our API has predictable resource-oriented URLs and uses standard HTTP response codes and API key based authentication.

Authorization

Use API keys to authenticate API requests.

Farel authenticates your API requests using your account’s API key. Farel raises an invalid request error if you don’t include a key, and an authentication error if the key is incorrect or outdated. You can generate the account’s API key in your agency web portal in Settings - API-key. API-key must be passed in header named X-AGENCY-API-KEY

Resources

Search Flights

The API allows you to search for flights by specified dates and route directions.

HTTP Request
POST /v1/agency-api/flights/search HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json;charset=UTF-8
Content-Length: 409

{
  "departure" : {
    "code" : "ALA",
    "type" : "CITY"
  },
  "arrival" : {
    "code" : "GDN",
    "type" : "AIRPORT"
  },
  "departureDate" : "2022-10-03",
  "returnDate" : "2022-11-03",
  "paxes" : [ {
    "paxType" : "ADT",
    "quantity" : 1
  }, {
    "paxType" : "CHD",
    "quantity" : 1
  }, {
    "paxType" : "INF",
    "quantity" : 1
  } ],
  "cabinClass" : "ECONOMY",
  "fareFrameId" : null
}
Table 1. Search Flights request fields
Path Type Description

departure

Object

Departure point description

departure.code

String

IATA-code of airport/city of departure

Must not be blank. Size must be between 3 and 3 inclusive

departure.type

String

Type of point: airport or city

Must not be null

arrival

Object

Arrival point description

arrival.code

String

IATA-code of airport/city of arrival

Must not be blank. Size must be between 3 and 3 inclusive

arrival.type

String

Type of point: airport or city

Must not be null

departureDate

String

Departure date

Must not be null

returnDate

String

Departure date of return flight

cabinClass

String

Cabin class filter

paxes

Array

Set of passengers types with their quantities

Must not be null. Size must be between 1 and 9 inclusive

paxes[].paxType

String

Passenger type: ADT, CHD, INF or etc.

Must not be null

paxes[].quantity

Number

Number of passengers of a given type

Must be positive

HTTP Response

The response contains information on each available flight: detailed information about the flight, branded fares, additional services, and prices for each passenger.

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 2744

{
  "trips" : [ {
    "date" : [ 2022, 10, 3 ],
    "routes" : [ {
      "legs" : [ {
        "flightId" : "7f3d4300-f0fa-43c7-842a-b33bb42d2230",
        "flightType" : "SCHEDULED",
        "flightNumber" : "OK-1234",
        "originAirport" : {
          "airportCode" : "ALA",
          "airportName" : "Almaty International Airport",
          "cityName" : "Almaty"
        },
        "destinationAirport" : {
          "airportCode" : "GDN",
          "airportName" : "Gdansk Lech Walesa Airport",
          "cityName" : "Gdansk"
        },
        "aircraft" : "Millennium Falcon",
        "flightDuration" : 10,
        "departureDate" : [ 2022, 10, 3 ],
        "arrivalDate" : [ 2022, 10, 3 ],
        "departureTime" : "09:00",
        "arrivalTime" : "16:00",
        "flightOption" : {
          "fareFrameId" : "1ece9012-3596-40d3-815d-0ac1fadb1ce9",
          "cabinClass" : "ECONOMY",
          "originalPrice" : 100,
          "taxPrice" : 0,
          "farePrice" : 100,
          "price" : 100,
          "originalCurrencyPrice" : {
            "base" : {
              "currency" : "USD",
              "value" : 100
            },
            "display" : {
              "currency" : "USD",
              "value" : 100
            }
          },
          "taxCurrencyPrice" : {
            "base" : {
              "currency" : "USD",
              "value" : 0
            },
            "display" : {
              "currency" : "USD",
              "value" : 0
            }
          },
          "currencyPrice" : {
            "base" : {
              "currency" : "USD",
              "value" : 100
            },
            "display" : {
              "currency" : "USD",
              "value" : 100
            }
          },
          "currencyFarePrice" : {
            "base" : {
              "currency" : "USD",
              "value" : 100
            },
            "display" : {
              "currency" : "USD",
              "value" : 100
            }
          }
        },
        "flightSaleStatus" : "OPEN",
        "arriveDateOffset" : 0
      } ],
      "stops" : [ {
        "airport" : {
          "cityCode" : "TSE",
          "cityName" : "Astana",
          "airportCode" : "TSE",
          "airportName" : "Astana International Airport"
        },
        "duration" : 2
      } ],
      "totalDuration" : 10,
      "availableSeats" : 100,
      "returnRoutes" : [ {
        "flightIds" : [ "a1c509cc-5079-44a4-a02c-d57218274528" ]
      } ],
      "currencyTotalPrice" : {
        "base" : {
          "currency" : "USD",
          "value" : 100
        },
        "display" : {
          "currency" : "USD",
          "value" : 100
        }
      },
      "totalPrice" : 100
    } ]
  } ]
}
Table 2. Search Flights response fields description
Path Type Description

trips

Array

Array of route options

trips[].date

Array

Date of the trip

trips[].routes

Array

Array of route options

trips[].routes[].legs

Array

Array of flight legs

trips[].routes[].legs[].flightId

String

Flight ID

trips[].routes[].legs[].flightType

String

Type of flight

trips[].routes[].legs[].flightNumber

String

Flight number

trips[].routes[].legs[].originAirport

Object

Origin airport

trips[].routes[].legs[].originAirport.airportCode

String

IATA-code of origin airport

trips[].routes[].legs[].originAirport.airportName

String

Name of origin airport

trips[].routes[].legs[].originAirport.cityName

String

Name of origin city

trips[].routes[].legs[].destinationAirport

Object

Destination airport

trips[].routes[].legs[].destinationAirport.airportCode

String

IATA-code of destination airport

trips[].routes[].legs[].destinationAirport.airportName

String

Name of destination airport

trips[].routes[].legs[].destinationAirport.cityName

String

Name of destination city

trips[].routes[].legs[].aircraft

String

Aircraft model

trips[].routes[].legs[].flightDuration

Number

Duration of the flight

trips[].routes[].legs[].departureDate

Array

Departure date

trips[].routes[].legs[].arrivalDate

Array

Arrival date

trips[].routes[].legs[].departureTime

String

Departure time

trips[].routes[].legs[].arrivalTime

String

Arrival time

trips[].routes[].legs[].flightOption

Object

Flight option

trips[].routes[].legs[].flightOption.fareFrameId

String

Fare frame ID

trips[].routes[].legs[].flightOption.cabinClass

String

Cabin class

trips[].routes[].legs[].flightOption.originalPrice

Number

Original price

trips[].routes[].legs[].flightOption.taxPrice

Number

Tax price

trips[].routes[].legs[].flightOption.farePrice

Number

Fare price

trips[].routes[].legs[].flightOption.price

Number

Price

trips[].routes[].legs[].flightOption.originalCurrencyPrice

Object

Original currency price

trips[].routes[].legs[].flightOption.originalCurrencyPrice.base

Object

Original currency base price

trips[].routes[].legs[].flightOption.originalCurrencyPrice.base.currency

String

Original currency base price currency

trips[].routes[].legs[].flightOption.originalCurrencyPrice.base.value

Number

Original currency base price currency sum

trips[].routes[].legs[].flightOption.originalCurrencyPrice.display

Object

Original currency display price

trips[].routes[].legs[].flightOption.originalCurrencyPrice.display.currency

String

Original currency display price currency

trips[].routes[].legs[].flightOption.originalCurrencyPrice.display.value

Number

Original currency display price sum

trips[].routes[].legs[].flightOption.taxCurrencyPrice

Object

Tax currency price

trips[].routes[].legs[].flightOption.taxCurrencyPrice.base

Object

Tax currency base price

trips[].routes[].legs[].flightOption.taxCurrencyPrice.base.currency

String

Tax currency base price currency

trips[].routes[].legs[].flightOption.taxCurrencyPrice.base.value

Number

Tax currency base price sum

trips[].routes[].legs[].flightOption.taxCurrencyPrice.display

Object

Tax currency display price

trips[].routes[].legs[].flightOption.taxCurrencyPrice.display.currency

String

Tax currency display price currency

trips[].routes[].legs[].flightOption.taxCurrencyPrice.display.value

Number

Tax currency display price sum

trips[].routes[].legs[].flightOption.currencyPrice

Object

Currency price

trips[].routes[].legs[].flightOption.currencyPrice.base

Object

Currency base price

trips[].routes[].legs[].flightOption.currencyPrice.base.currency

String

Currency base price currency

trips[].routes[].legs[].flightOption.currencyPrice.base.value

Number

Currency base price sum

trips[].routes[].legs[].flightOption.currencyPrice.display

Object

Currency display price

trips[].routes[].legs[].flightOption.currencyPrice.display.currency

String

Currency display price currency

trips[].routes[].legs[].flightOption.currencyPrice.display.value

Number

Currency display price sum

trips[].routes[].legs[].flightOption.currencyFarePrice

Object

Currency fare price

trips[].routes[].legs[].flightOption.currencyFarePrice.base

Object

Currency fare base price

trips[].routes[].legs[].flightOption.currencyFarePrice.base.currency

String

Currency fare base price currency

trips[].routes[].legs[].flightOption.currencyFarePrice.base.value

Number

Currency fare base price sum

trips[].routes[].legs[].flightOption.currencyFarePrice.display

Object

Currency fare display price

trips[].routes[].legs[].flightOption.currencyFarePrice.display.currency

String

Currency fare display price currency

trips[].routes[].legs[].flightOption.currencyFarePrice.display.value

Number

Currency fare display price sum

trips[].routes[].legs[].arriveDateOffset

Number

Day(s) between departure and arrival

trips[].routes[].legs[].flightSaleStatus

String

Public sale status

trips[].routes[].stops

Array

Array of stops

trips[].routes[].stops[].airport

Object

Stop airport

trips[].routes[].stops[].airport.cityCode

String

IATA-code of stop city

trips[].routes[].stops[].airport.cityName

String

Name of stop city

trips[].routes[].stops[].airport.airportCode

String

IATA-code of stop airport

trips[].routes[].stops[].airport.airportName

String

Name of stop airport

trips[].routes[].stops[].duration

Number

Duration of the stop

trips[].routes[].totalDuration

Number

Total duration of the trip

trips[].routes[].availableSeats

Number

Number of available seats

trips[].routes[].returnRoutes

Array

Set of return routes

trips[].routes[].returnRoutes[].flightIds

Array

Return flight IDs

trips[].routes[].currencyTotalPrice

Object

Total price in currency

trips[].routes[].currencyTotalPrice.base

Object

Total price in currency base

trips[].routes[].currencyTotalPrice.base.currency

String

Total price in currency base currency

trips[].routes[].currencyTotalPrice.base.value

Number

Total price in currency base sum

trips[].routes[].currencyTotalPrice.display

Object

Total price in currency display

trips[].routes[].currencyTotalPrice.display.currency

String

Total price in currency display currency

trips[].routes[].currencyTotalPrice.display.value

Number

Total price in currency display sum

trips[].routes[].totalPrice

Number

Total price

Search Returning Flights

The API allows you to search for returning flights by specified dates, route directions and fare frame ID.

HTTP Request
POST /v1/agency-api/flights/returning HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json;charset=UTF-8
Content-Length: 252

{
  "departure" : {
    "code" : "ALA",
    "type" : "AIRPORT"
  },
  "arrival" : {
    "code" : "GDN",
    "type" : "AIRPORT"
  },
  "departureDate" : "2022-10-03",
  "cabinClass" : "ECONOMY",
  "fareFrameId" : "0b89716d-22b4-4948-b53b-00ddbaa49f74"
}
Table 3. Search Flights request fields
Path Type Description

departure

Object

Departure point description

departure.code

String

IATA-code of airport/city of departure

Must not be blank. Size must be between 3 and 3 inclusive

departure.type

String

Type of point: airport or city

Must not be null

arrival

Object

Arrival point description

arrival.code

String

IATA-code of airport/city of arrival

Must not be blank. Size must be between 3 and 3 inclusive

arrival.type

String

Type of point: airport or city

Must not be null

departureDate

String

Departure date

Must not be null

cabinClass

String

Cabin class filter

fareFrameId

String

ID of outbound flight fare frame

HTTP Response

The response contains information on each available returning flight: detailed information about the flight, branded fares, additional services, and prices for each passenger.

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 2744

{
  "trips" : [ {
    "date" : [ 2022, 10, 3 ],
    "routes" : [ {
      "legs" : [ {
        "flightId" : "7f3d4300-f0fa-43c7-842a-b33bb42d2230",
        "flightType" : "SCHEDULED",
        "flightNumber" : "OK-1234",
        "originAirport" : {
          "airportCode" : "ALA",
          "airportName" : "Almaty International Airport",
          "cityName" : "Almaty"
        },
        "destinationAirport" : {
          "airportCode" : "GDN",
          "airportName" : "Gdansk Lech Walesa Airport",
          "cityName" : "Gdansk"
        },
        "aircraft" : "Millennium Falcon",
        "flightDuration" : 10,
        "departureDate" : [ 2022, 10, 3 ],
        "arrivalDate" : [ 2022, 10, 3 ],
        "departureTime" : "09:00",
        "arrivalTime" : "16:00",
        "flightOption" : {
          "fareFrameId" : "1ece9012-3596-40d3-815d-0ac1fadb1ce9",
          "cabinClass" : "ECONOMY",
          "originalPrice" : 100,
          "taxPrice" : 0,
          "farePrice" : 100,
          "price" : 100,
          "originalCurrencyPrice" : {
            "base" : {
              "currency" : "USD",
              "value" : 100
            },
            "display" : {
              "currency" : "USD",
              "value" : 100
            }
          },
          "taxCurrencyPrice" : {
            "base" : {
              "currency" : "USD",
              "value" : 0
            },
            "display" : {
              "currency" : "USD",
              "value" : 0
            }
          },
          "currencyPrice" : {
            "base" : {
              "currency" : "USD",
              "value" : 100
            },
            "display" : {
              "currency" : "USD",
              "value" : 100
            }
          },
          "currencyFarePrice" : {
            "base" : {
              "currency" : "USD",
              "value" : 100
            },
            "display" : {
              "currency" : "USD",
              "value" : 100
            }
          }
        },
        "flightSaleStatus" : "OPEN",
        "arriveDateOffset" : 0
      } ],
      "stops" : [ {
        "airport" : {
          "cityCode" : "TSE",
          "cityName" : "Astana",
          "airportCode" : "TSE",
          "airportName" : "Astana International Airport"
        },
        "duration" : 2
      } ],
      "totalDuration" : 10,
      "availableSeats" : 100,
      "returnRoutes" : [ {
        "flightIds" : [ "a1c509cc-5079-44a4-a02c-d57218274528" ]
      } ],
      "currencyTotalPrice" : {
        "base" : {
          "currency" : "USD",
          "value" : 100
        },
        "display" : {
          "currency" : "USD",
          "value" : 100
        }
      },
      "totalPrice" : 100
    } ]
  } ]
}
Table 4. Search Flights response fields description
Path Type Description

trips

Array

Array of route options

trips[].date

Array

Date of the trip

trips[].routes

Array

Array of route options

trips[].routes[].legs

Array

Array of flight legs

trips[].routes[].legs[].flightId

String

Flight ID

trips[].routes[].legs[].flightType

String

Type of flight

trips[].routes[].legs[].flightNumber

String

Flight number

trips[].routes[].legs[].originAirport

Object

Origin airport

trips[].routes[].legs[].originAirport.airportCode

String

IATA-code of origin airport

trips[].routes[].legs[].originAirport.airportName

String

Name of origin airport

trips[].routes[].legs[].originAirport.cityName

String

Name of origin city

trips[].routes[].legs[].destinationAirport

Object

Destination airport

trips[].routes[].legs[].destinationAirport.airportCode

String

IATA-code of destination airport

trips[].routes[].legs[].destinationAirport.airportName

String

Name of destination airport

trips[].routes[].legs[].destinationAirport.cityName

String

Name of destination city

trips[].routes[].legs[].aircraft

String

Aircraft model

trips[].routes[].legs[].flightDuration

Number

Duration of the flight

trips[].routes[].legs[].departureDate

Array

Departure date

trips[].routes[].legs[].arrivalDate

Array

Arrival date

trips[].routes[].legs[].departureTime

String

Departure time

trips[].routes[].legs[].arrivalTime

String

Arrival time

trips[].routes[].legs[].flightOption

Object

Flight option

trips[].routes[].legs[].flightOption.fareFrameId

String

Fare frame ID

trips[].routes[].legs[].flightOption.cabinClass

String

Cabin class

trips[].routes[].legs[].flightOption.originalPrice

Number

Original price

trips[].routes[].legs[].flightOption.taxPrice

Number

Tax price

trips[].routes[].legs[].flightOption.farePrice

Number

Fare price

trips[].routes[].legs[].flightOption.price

Number

Price

trips[].routes[].legs[].flightOption.originalCurrencyPrice

Object

Original currency price

trips[].routes[].legs[].flightOption.originalCurrencyPrice.base

Object

Original currency base price

trips[].routes[].legs[].flightOption.originalCurrencyPrice.base.currency

String

Original currency base price currency

trips[].routes[].legs[].flightOption.originalCurrencyPrice.base.value

Number

Original currency base price currency sum

trips[].routes[].legs[].flightOption.originalCurrencyPrice.display

Object

Original currency display price

trips[].routes[].legs[].flightOption.originalCurrencyPrice.display.currency

String

Original currency display price currency

trips[].routes[].legs[].flightOption.originalCurrencyPrice.display.value

Number

Original currency display price sum

trips[].routes[].legs[].flightOption.taxCurrencyPrice

Object

Tax currency price

trips[].routes[].legs[].flightOption.taxCurrencyPrice.base

Object

Tax currency base price

trips[].routes[].legs[].flightOption.taxCurrencyPrice.base.currency

String

Tax currency base price currency

trips[].routes[].legs[].flightOption.taxCurrencyPrice.base.value

Number

Tax currency base price sum

trips[].routes[].legs[].flightOption.taxCurrencyPrice.display

Object

Tax currency display price

trips[].routes[].legs[].flightOption.taxCurrencyPrice.display.currency

String

Tax currency display price currency

trips[].routes[].legs[].flightOption.taxCurrencyPrice.display.value

Number

Tax currency display price sum

trips[].routes[].legs[].flightOption.currencyPrice

Object

Currency price

trips[].routes[].legs[].flightOption.currencyPrice.base

Object

Currency base price

trips[].routes[].legs[].flightOption.currencyPrice.base.currency

String

Currency base price currency

trips[].routes[].legs[].flightOption.currencyPrice.base.value

Number

Currency base price sum

trips[].routes[].legs[].flightOption.currencyPrice.display

Object

Currency display price

trips[].routes[].legs[].flightOption.currencyPrice.display.currency

String

Currency display price currency

trips[].routes[].legs[].flightOption.currencyPrice.display.value

Number

Currency display price sum

trips[].routes[].legs[].flightOption.currencyFarePrice

Object

Currency fare price

trips[].routes[].legs[].flightOption.currencyFarePrice.base

Object

Currency fare base price

trips[].routes[].legs[].flightOption.currencyFarePrice.base.currency

String

Currency fare base price currency

trips[].routes[].legs[].flightOption.currencyFarePrice.base.value

Number

Currency fare base price sum

trips[].routes[].legs[].flightOption.currencyFarePrice.display

Object

Currency fare display price

trips[].routes[].legs[].flightOption.currencyFarePrice.display.currency

String

Currency fare display price currency

trips[].routes[].legs[].flightOption.currencyFarePrice.display.value

Number

Currency fare display price sum

trips[].routes[].legs[].arriveDateOffset

Number

Day(s) between departure and arrival

trips[].routes[].legs[].flightSaleStatus

String

Public sale status

trips[].routes[].stops

Array

Array of stops

trips[].routes[].stops[].airport

Object

Stop airport

trips[].routes[].stops[].airport.cityCode

String

IATA-code of stop city

trips[].routes[].stops[].airport.cityName

String

Name of stop city

trips[].routes[].stops[].airport.airportCode

String

IATA-code of stop airport

trips[].routes[].stops[].airport.airportName

String

Name of stop airport

trips[].routes[].stops[].duration

Number

Duration of the stop

trips[].routes[].totalDuration

Number

Total duration of the trip

trips[].routes[].availableSeats

Number

Number of available seats

trips[].routes[].returnRoutes

Array

Set of return routes

trips[].routes[].returnRoutes[].flightIds

Array

Return flight IDs

trips[].routes[].currencyTotalPrice

Object

Total price in currency

trips[].routes[].currencyTotalPrice.base

Object

Total price in currency base

trips[].routes[].currencyTotalPrice.base.currency

String

Total price in currency base currency

trips[].routes[].currencyTotalPrice.base.value

Number

Total price in currency base sum

trips[].routes[].currencyTotalPrice.display

Object

Total price in currency display

trips[].routes[].currencyTotalPrice.display.currency

String

Total price in currency display currency

trips[].routes[].currencyTotalPrice.display.value

Number

Total price in currency display sum

trips[].routes[].totalPrice

Number

Total price

Get Flights Calendar

The API allows you to get flight dates for specified dates and route directions.

HTTP Request
GET /v1/agency-api/flights/calendar?origin=ALA&destination=TSE&outboundDateFrom=2025-06-05&outboundDateTo=2025-06-06 HTTP/1.1
Accept: application/json;charset=UTF-8
Get Flights Calendar request params

Unresolved directive in index.adoc - include::/home/gitlab-runner/builds/RRsrzGr7L/0/farel_repos/farel-os/farel-os-api/agency-api/target/generated-snippets/AgencyApiFlightSearchControllerTest/calendar/request-parameters.adoc[]

HTTP Response

The response contains list of dates with available flights.

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 46

{
  "dates" : [ "2025-06-05", "2025-06-06" ]
}
Table 5. Search Flights response fields description
Path Type Description

dates

Array

List of dates with available flights

Get fare data

The API allows you to get fare data by specified route directions.

HTTP Request
GET /v1/agency-api/select/f4fab554-ba14-4642-b071-cc00c02e6cc6?roundTrip=true HTTP/1.1
Content-Type: application/json;charset=UTF-8
X-Currency: KZT
Accept: application/json;charset=UTF-8
HTTP Response

The response contains information about fares.

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 3225

{
  "legs" : [ {
    "flightId" : "50e7ebcb-e486-4518-b2fa-364f4e63ade0",
    "flightNumber" : "OK-1234",
    "departureDate" : [ 2022, 10, 3 ],
    "arrivalDate" : [ 2022, 10, 3 ],
    "departureTime" : [ 9, 0 ],
    "arrivalTime" : [ 16, 0 ],
    "aircraftInfo" : {
      "id" : "6f6c0c1b-fed9-4995-b69b-43c4b8a7e564",
      "name" : "Millennium Falcon",
      "regNumber" : "NCC-1701"
    },
    "originAirport" : {
      "airportCode" : "ALA",
      "airportName" : "Almaty International Airport",
      "cityName" : "Almaty"
    },
    "destinationAirport" : {
      "airportCode" : "GDN",
      "airportName" : "Gdansk Lech Walesa Airport",
      "cityName" : "Gdansk"
    },
    "flightDuration" : 10,
    "flightFarePrices" : [ {
      "fareFrameId" : "1ece9012-3596-40d3-815d-0ac1fadb1ce9",
      "cabinClass" : "ECONOMY",
      "bookingClassPrice" : 100,
      "currencyBookingClassPrice" : {
        "base" : {
          "currency" : "USD",
          "value" : 100
        },
        "display" : {
          "currency" : "USD",
          "value" : 100
        }
      },
      "farePrice" : 100,
      "globalDiscount" : 0,
      "globalDiscountCurrency" : {
        "base" : {
          "currency" : "USD",
          "value" : 0
        },
        "display" : {
          "currency" : "USD",
          "value" : 0
        }
      },
      "currencyFarePrice" : {
        "base" : {
          "currency" : "USD",
          "value" : 100
        },
        "display" : {
          "currency" : "USD",
          "value" : 100
        }
      },
      "taxPrice" : 0,
      "currencyTaxPrice" : {
        "base" : {
          "currency" : "USD",
          "value" : 0
        },
        "display" : {
          "currency" : "USD",
          "value" : 0
        }
      },
      "price" : 100,
      "currencyPrice" : {
        "base" : {
          "currency" : "USD",
          "value" : 100
        },
        "display" : {
          "currency" : "USD",
          "value" : 100
        }
      },
      "hasAgencies" : true,
      "name" : "Economy",
      "managingRules" : [ {
        "ancillaryId" : "93dff29e-296c-4a7f-a1a2-bbbb3b1839f9",
        "ancillaryFrameId" : "83ec8c81-c996-4e4f-b935-185e0fe2ae43",
        "amount" : {
          "value" : 100,
          "type" : "FREE_VALUE"
        },
        "type" : "NO_SHOW_CHANGE",
        "timeBeforeDeparture" : 1
      } ],
      "baggageRules" : [ {
        "quantity" : 1,
        "ancillaryId" : "fe47236f-7b2f-4f50-9d72-9e0d0d95fb13",
        "ancillaryFrameId" : "85c1adb6-1e86-474a-9eab-b658d51d5ce4",
        "type" : "CABIN_BAGGAGE",
        "weight" : 10
      } ]
    } ],
    "flightSaleStatus" : "OPEN"
  } ],
  "stops" : [ {
    "airport" : {
      "airportCode" : "TSE",
      "airportName" : "Astana International Airport",
      "cityName" : "Astana"
    },
    "duration" : 2
  } ],
  "totalDuration" : 10,
  "fareTotalPriceMap" : {
    "d4ffe81c-8fd5-49c9-b130-24483ffc93f2" : {
      "price" : 100,
      "currencyPrice" : {
        "base" : {
          "currency" : "USD",
          "value" : 100
        },
        "display" : {
          "currency" : "USD",
          "value" : 100
        }
      }
    }
  },
  "availableSeats" : 100
}
Table 6. Fare data response fields description
Path Type Description

legs

Array

Array of flights

legs[].flightId

String

ID of the flight

legs[].flightNumber

String

Number of the flight

legs[].departureDate

Array

Departure date of the flight

legs[].arrivalDate

Array

Arrival date of the flight

legs[].departureTime

Array

Departure time of the flight

legs[].arrivalTime

Array

Arrival time of the flight

legs[].aircraftInfo

Object

Aircraft information

legs[].aircraftInfo.id

String

Aircraft ID

legs[].aircraftInfo.name

String

Aircraft name

legs[].aircraftInfo.regNumber

String

Aircraft registration number

legs[].originAirport

Object

Origin airport

legs[].originAirport.airportCode

String

IATA-code of origin airport

legs[].originAirport.airportName

String

Name of origin airport

legs[].originAirport.cityName

String

Name of origin city

legs[].destinationAirport

Object

Destination airport

legs[].destinationAirport.airportCode

String

IATA-code of destination airport

legs[].destinationAirport.airportName

String

Name of destination airport

legs[].destinationAirport.cityName

String

Name of destination city

legs[].flightDuration

Number

Duration of the flight

legs[].flightFarePrices

Array

Array of fare prices

legs[].flightSaleStatus

String

Public sale status

legs[].flightFarePrices[].fareFrameId

String

ID of the fare frame

legs[].flightFarePrices[].cabinClass

String

Cabin class

legs[].flightFarePrices[].bookingClassPrice

Number

Booking class price

legs[].flightFarePrices[].currencyBookingClassPrice

Object

Currency booking class price

legs[].flightFarePrices[].currencyBookingClassPrice.base.currency

String

Currency booking class price base currency

legs[].flightFarePrices[].currencyBookingClassPrice.base.value

Number

Currency booking class price base sum

legs[].flightFarePrices[].currencyBookingClassPrice.display.currency

String

Currency booking class price display currency

legs[].flightFarePrices[].currencyBookingClassPrice.display.value

Number

Currency booking class price display sum

legs[].flightFarePrices[].farePrice

Number

Fare price

legs[].flightFarePrices[].currencyFarePrice

Object

Currency fare price

legs[].flightFarePrices[].currencyFarePrice.base.currency

String

Currency fare price base currency

legs[].flightFarePrices[].currencyFarePrice.base.value

Number

Currency fare price base sum

legs[].flightFarePrices[].currencyFarePrice.display.currency

String

Currency fare price display currency

legs[].flightFarePrices[].currencyFarePrice.display.value

Number

Currency fare price display sum

legs[].flightFarePrices[].taxPrice

Number

Tax price

legs[].flightFarePrices[].currencyTaxPrice

Object

Currency tax price

legs[].flightFarePrices[].currencyTaxPrice.base.currency

String

Currency tax price base currency

legs[].flightFarePrices[].currencyTaxPrice.base.value

Number

Currency tax price base sum

legs[].flightFarePrices[].currencyTaxPrice.display.currency

String

Currency tax price display currency

legs[].flightFarePrices[].currencyTaxPrice.display.value

Number

Currency tax price display sum

legs[].flightFarePrices[].price

Number

Price

legs[].flightFarePrices[].currencyPrice

Object

Price in currency

legs[].flightFarePrices[].currencyPrice.base.currency

String

Price in currency base currency

legs[].flightFarePrices[].currencyPrice.base.value

Number

Price in currency base sum

legs[].flightFarePrices[].currencyPrice.display.currency

String

Price in currency display currency

legs[].flightFarePrices[].currencyPrice.display.value

Number

Price in currency display sum

legs[].flightFarePrices[].globalDiscount

Number

Global discount

legs[].flightFarePrices[].globalDiscountCurrency

Object

Global discount in currency

legs[].flightFarePrices[].globalDiscountCurrency.base.currency

String

Global discount in currency base currency

legs[].flightFarePrices[].globalDiscountCurrency.base.value

Number

Global discount in currency base sum

legs[].flightFarePrices[].globalDiscountCurrency.display.currency

String

Global discount in currency display currency

legs[].flightFarePrices[].globalDiscountCurrency.display.value

Number

Global discount in currency display sum

legs[].flightFarePrices[].hasAgencies

Boolean

If has agencies

legs[].flightFarePrices[].name

String

Fare name

legs[].flightFarePrices[].managingRules

Array

Managing rules

legs[].flightFarePrices[].managingRules[].ancillaryId

String

Ancillary ID

legs[].flightFarePrices[].managingRules[].ancillaryFrameId

String

Ancillary frame ID

legs[].flightFarePrices[].managingRules[].amount

Object

Amount

legs[].flightFarePrices[].managingRules[].amount.value

Number

Amount value

legs[].flightFarePrices[].managingRules[].amount.type

String

Amount type

legs[].flightFarePrices[].managingRules[].type

String

Type

legs[].flightFarePrices[].managingRules[].timeBeforeDeparture

Number

Hours before departure where rule is applied

legs[].flightFarePrices[].baggageRules

Array

Baggage rules

legs[].flightFarePrices[].baggageRules[].quantity

Number

Quantity

legs[].flightFarePrices[].baggageRules[].weight

Number

weight

legs[].flightFarePrices[].baggageRules[].type

String

Type

legs[].flightFarePrices[].baggageRules[].ancillaryId

String

Ancillary ID

legs[].flightFarePrices[].baggageRules[].ancillaryFrameId

String

Ancillary frame ID

stops

Array

Array of stops

stops[].airport

Object

Stop airport

stops[].airport.cityName

String

Name of stop city

stops[].airport.airportCode

String

IATA-code of stop airport

stops[].airport.airportName

String

Name of stop airport

stops[].duration

Number

Duration of the stop

totalDuration

Number

Total duration of the trip

fareTotalPriceMap

Object

Map of fare to total price

fareTotalPriceMap.*.price

Number

The total price for the fare

fareTotalPriceMap.*.currencyPrice

Object

Details of the currency for the fare price

fareTotalPriceMap.*.currencyPrice.base

Object

Base price information in a specific currency

fareTotalPriceMap.*.currencyPrice.base.currency

String

Currency code for the base price (e.g., USD)

fareTotalPriceMap.*.currencyPrice.base.value

Number

Value of the base price

fareTotalPriceMap.*.currencyPrice.display

Object

Display price information in a specific currency

fareTotalPriceMap.*.currencyPrice.display.currency

String

Currency code for the display price (e.g., USD)

fareTotalPriceMap.*.currencyPrice.display.value

Number

Value of the display price

availableSeats

Number

Number of seats available

Get flight fare prices

The API allows you to get fare prices by specified flights.

HTTP Request
GET /v1/agency-api/flights/fares/prices?paxTypes=ADT&fareFrameId=d596a83d-2560-48f6-9c64-92c5e741ba01&outboundFlightIds=e04af6b8-29ec-4933-b8ff-72c66e207cd8&returnFlightIds=aaaabbbb-cccc-4933-b8ff-72c66e207cd8 HTTP/1.1
X-Currency: USD
Accept: application/json
HTTP Response

The response contains information about fare prices.

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 709

{
  "prices" : [ {
    "paxType" : "ADT",
    "taxPrice" : 10,
    "originalPrice" : 100,
    "originalCurrencyPrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 10
      },
      "display" : {
        "currency" : "USD",
        "value" : 10
      }
    },
    "taxCurrencyPrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 10
      },
      "display" : {
        "currency" : "USD",
        "value" : 10
      }
    },
    "price" : 90.0,
    "currencyPrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 10
      },
      "display" : {
        "currency" : "USD",
        "value" : 10
      }
    }
  } ],
  "unavailabilityReason" : null
}
Table 7. Fare prices response fields description
Path Type Description

prices[].paxType

String

The type of passenger

prices[].taxPrice

Number

The tax price for the fare

prices[].originalPrice

Number

The original price of the fare

prices[].price

Number

The final price after discounts

prices[].currencyPrice

Object

Currency price

prices[].currencyPrice.base

Object

Currency base price

prices[].currencyPrice.base.currency

String

Currency base price currency

prices[].currencyPrice.base.value

Number

Currency base price currency value

prices[].currencyPrice.display

Object

Currency display price

prices[].currencyPrice.display.currency

String

Currency display price currency

prices[].currencyPrice.display.value

Number

Currency display price value

prices[].originalCurrencyPrice

Object

Original currency price

prices[].originalCurrencyPrice.base

Object

Original currency base price

prices[].originalCurrencyPrice.base.currency

String

Original base currency code

prices[].originalCurrencyPrice.base.value

Number

Original base currency value

prices[].originalCurrencyPrice.display

Object

Original display currency price

prices[].originalCurrencyPrice.display.currency

String

Display currency code

prices[].originalCurrencyPrice.display.value

Number

Display currency value

prices[].taxCurrencyPrice

Object

Tax currency price

prices[].taxCurrencyPrice.base

Object

Tax currency base price

prices[].taxCurrencyPrice.base.currency

String

Tax currency base price currency

prices[].taxCurrencyPrice.base.value

Number

Tax currency base price currency value

prices[].taxCurrencyPrice.display

Object

Tax currency display price

prices[].taxCurrencyPrice.display.currency

String

Tax currency display price currency

prices[].taxCurrencyPrice.display.value

Number

Tax currency display price value

unavailabilityReason

Null

Reason of unavailability

Get flight fare prices with rules

The API allows you to get fare prices by specified flights.

HTTP Request
GET /v1/agency-api/flights/fares/prices-with-rules?paxTypes=ADT&fareFrameId=d596a83d-2560-48f6-9c64-92c5e741ba01&outboundFlightIds=e04af6b8-29ec-4933-b8ff-72c66e207cd8&returnFlightIds=aaaabbbb-cccc-4933-b8ff-72c66e207cd8 HTTP/1.1
X-Currency: USD
Accept: application/json
HTTP Response

The response contains information about fare prices with riles.

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 890

{
  "prices" : [ {
    "paxType" : "ADT",
    "price" : 90.0,
    "originalPrice" : 90.0,
    "taxPrice" : 0,
    "currencyPrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 10
      },
      "display" : {
        "currency" : "USD",
        "value" : 10
      }
    },
    "currencyTaxPrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 0
      },
      "display" : {
        "currency" : "USD",
        "value" : 0
      }
    },
    "currencyOriginalPrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 90.0
      },
      "display" : {
        "currency" : "USD",
        "value" : 90.0
      }
    },
    "managingRules" : [ {
      "rule" : "CHANGE_BEFORE_DEPARTURE",
      "penalty" : 10,
      "timeBeforeDeparture" : 10,
      "amount" : {
        "type" : "FREE_VALUE",
        "value" : 10
      }
    } ]
  } ]
}
Table 8. Fare prices response fields description
Path Type Description

prices[].paxType

String

The type of passenger

prices[].price

Number

The final price after discounts

prices[].originalPrice

Number

The final fare price after discounts

prices[].taxPrice

Number

The full tax price without discounts

prices[].currencyPrice.base.currency

String

Currency code

prices[].currencyPrice.base.value

Number

Currency value

prices[].currencyPrice.display.currency

String

Currency code

prices[].currencyPrice.display.value

Number

Currency value

prices[].managingRules[].rule

String

The rule type for changes or refunds

prices[].managingRules[].penalty

Number

The penalty amount for breaking the rule

prices[].currencyTaxPrice

Object

Tax currency price

prices[].currencyTaxPrice.base

Object

Tax currency base price

prices[].currencyTaxPrice.base.currency

String

Tax currency base price currency

prices[].currencyTaxPrice.base.value

Number

Tax currency base price currency value

prices[].currencyTaxPrice.display

Object

Tax currency display price

prices[].currencyTaxPrice.display.currency

String

Tax currency display price currency

prices[].currencyTaxPrice.display.value

Number

Tax currency display price value

prices[].currencyOriginalPrice

Object

Original currency price

prices[].currencyOriginalPrice.base

Object

Original currency base price

prices[].currencyOriginalPrice.base.currency

String

Original base currency code

prices[].currencyOriginalPrice.base.value

Number

Original base currency value

prices[].currencyOriginalPrice.display

Object

Original display currency price

prices[].currencyOriginalPrice.display.currency

String

Display currency code

prices[].currencyOriginalPrice.display.value

Number

Display currency value

prices[].managingRules[].timeBeforeDeparture

Number

Hours before departure when the rule applies

prices[].managingRules[].amount.type

String

Type of penalty amount

prices[].managingRules[].amount.value

Number

Value of the penalty amount

Get route details

The API allows you to get route ID by flight IDs.

HTTP Request
GET /v1/agency-api/routes?flightIds=d596a83d-2560-48f6-9c64-92c5e741ba01%2Ce04af6b8-29ec-4933-b8ff-72c66e207cd8 HTTP/1.1
Accept: application/json
HTTP Response

The response contains information about route with legs.

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 244

{
  "routeId" : "fbe12a3d-7771-4fcc-96dc-948ff1f6c5de",
  "routeLegs" : [ {
    "legNumber" : 0,
    "flightId" : "d596a83d-2560-48f6-9c64-92c5e741ba01"
  }, {
    "legNumber" : 1,
    "flightId" : "e04af6b8-29ec-4933-b8ff-72c66e207cd8"
  } ]
}
Table 9. Route details response fields description
Path Type Description

routeId

String

Route ID

routeLegs[].legNumber

Number

Leg (flight) number

routeLegs[].flightId

String

Flight ID

Branded Fare Details

Branded fares consist of services such as baggage allowance, meals on board, seat selection, and exchange and refund conditions.

The request must include all of the following parameters to get information about the branded fares. Fare(Brand) frame id is a parameter in order to get actual fare.

HTTP Request
POST /v1/agency-api/branded-fares HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json;charset=UTF-8
Content-Length: 284

{
  "flightIds" : [ "7f3d4300-f0fa-43c7-842a-b33bb42d2230" ],
  "brandFrameId" : "a0ebd77c-e2ef-475f-87a7-a373de87318f",
  "paxes" : [ {
    "paxType" : "ADT",
    "quantity" : 1
  }, {
    "paxType" : "CHD",
    "quantity" : 1
  }, {
    "paxType" : "INF",
    "quantity" : 1
  } ]
}
Table 10. Branded Fare Details request fields description
Path Type Description

flightIds

Array

List of flight id (UUID) on the route

Must not be empty

brandFrameId

String

Brand frame id (UUID)

paxes

Array

Set of passengers types with their quantities

Must not be empty. Size must be between 1 and 9 inclusive

paxes[].paxType

String

Passenger type: ADT, CHD, INF or etc.

Must not be null

paxes[].quantity

Number

Number of passengers of a given type

Must be positive

The response contains information about each branded fare on the flight, indicating the scope of services, conditions, and prices for each passenger.

HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 2089

{
  "flightBrands" : [ {
    "flightId" : "7f3d4300-f0fa-43c7-842a-b33bb42d2230",
    "currency" : "USD",
    "brandPrices" : {
      "brandFrameId" : "a0ebd77c-e2ef-475f-87a7-a373de87318f",
      "brandId" : "1ece9012-3596-40d3-815d-0ac1fadb1ce9",
      "brandName" : "Light Saber",
      "paxPrices" : [ {
        "paxType" : "ADT",
        "paxPrice" : 100,
        "feeRules" : [ {
          "timeLimit" : 15,
          "allowance" : true,
          "type" : "REFUND_BEFORE_DEPARTURE",
          "penaltyAmount" : 0
        }, {
          "timeLimit" : null,
          "allowance" : true,
          "type" : "CHANGE_BEFORE_DEPARTURE",
          "penaltyAmount" : 10
        } ]
      }, {
        "paxType" : "CHD",
        "paxPrice" : 50,
        "feeRules" : [ {
          "timeLimit" : null,
          "allowance" : true,
          "type" : "CHANGE_BEFORE_DEPARTURE",
          "penaltyAmount" : 0
        }, {
          "timeLimit" : null,
          "allowance" : true,
          "type" : "REFUND_BEFORE_DEPARTURE",
          "penaltyAmount" : 10
        } ]
      }, {
        "paxType" : "INF",
        "paxPrice" : 10,
        "feeRules" : [ {
          "timeLimit" : null,
          "allowance" : true,
          "type" : "REFUND_BEFORE_DEPARTURE",
          "penaltyAmount" : 0
        }, {
          "timeLimit" : null,
          "allowance" : true,
          "type" : "CHANGE_BEFORE_DEPARTURE",
          "penaltyAmount" : 10
        } ]
      } ],
      "includedServices" : [ {
        "service" : {
          "payload" : {
            "type" : "CABIN_BAGGAGE",
            "weight" : 5,
            "imageUrl" : null,
            "description" : "CABIN_BAGGAGE_DESCRIPTION"
          },
          "category" : "BAGGAGE"
        },
        "quantity" : 2
      }, {
        "service" : {
          "payload" : {
            "type" : "CHECKIN_BAGGAGE",
            "weight" : 23,
            "imageUrl" : null,
            "description" : "CHECKIN_BAGGAGE_DESCRIPTION"
          },
          "category" : "BAGGAGE"
        },
        "quantity" : 1
      } ]
    }
  } ]
}
Table 11. Branded Fare Details response fields description
Path Type Description

flightBrands

Array

Flight’s brand description

flightBrands[].flightId

String

Flight id (UUID)

flightBrands[].currency

String

Currency

flightBrands[].brandPrices

Object

Brand description

flightBrands[].brandPrices.brandFrameId

String

Brand frame id (UUID)

flightBrands[].brandPrices.brandId

String

Brand id (UUID)

flightBrands[].brandPrices.brandName

String

Brand name

flightBrands[].brandPrices.paxPrices

Array

List of passenger prices

flightBrands[].brandPrices.paxPrices[].paxType

String

Passenger type

flightBrands[].brandPrices.paxPrices[].paxPrice

Number

Price

flightBrands[].brandPrices.paxPrices[].feeRules

Array

Description of fee rules

flightBrands[].brandPrices.paxPrices[].feeRules[].type

String

Type of fee rules (exm. before departure)

flightBrands[].brandPrices.paxPrices[].feeRules[].allowance

Boolean

Rule allowance

flightBrands[].brandPrices.paxPrices[].feeRules[].timeLimit

Number

Rule time limit

flightBrands[].brandPrices.paxPrices[].feeRules[].penaltyAmount

Number

Penalty value

flightBrands[].brandPrices.includedServices

Array

Included services in brand per passenger

flightBrands[].brandPrices.includedServices[].service

Object

Service description

flightBrands[].brandPrices.includedServices[].service.category

String

Service category type

flightBrands[].brandPrices.includedServices[].service.payload

Object

Service payload

flightBrands[].brandPrices.includedServices[].quantity

Number

Quantity of service

Flight Offer

The airline may sell additional services on the flight, such as extra baggage, pre-paid meals onboard, seat selection, etc.

You need to submit a request to receive a list of additional services of the airline available for purchase.

HTTP Request
GET /v1/agency-api/flight-offers?flightIds=7f3d4300-f0fa-43c7-842a-b33bb42d2230&brandFrameId=1ece9012-3596-40d3-815d-0ac1fadb1ce9 HTTP/1.1
Accept: application/json;charset=UTF-8
Flight Offer request params

Unresolved directive in index.adoc - include::/home/gitlab-runner/builds/RRsrzGr7L/0/farel_repos/farel-os/farel-os-api/agency-api/target/generated-snippets/AgencyApiFlightOfferControllerTest/flightOffers/request-parameters.adoc[]

The response contains information about each branded fare on the flight, indicating the scope of services, conditions, and prices for each passenger.

HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1512

{
  "flightOffers" : [ {
    "flightId" : "7f3d4300-f0fa-43c7-842a-b33bb42d2230",
    "brandName" : "Light Saber",
    "currency" : "KZT",
    "includedServices" : [ {
      "service" : {
        "payload" : {
          "type" : "CABIN_BAGGAGE",
          "weight" : 5,
          "imageUrl" : null,
          "description" : "CHECKIN_BAGGAGE_DESCRIPTION"
        },
        "category" : "BAGGAGE"
      },
      "quantity" : 2
    }, {
      "service" : {
        "payload" : {
          "type" : "CHECKIN_BAGGAGE",
          "weight" : 23,
          "imageUrl" : null,
          "description" : "CHECKIN_BAGGAGE_DESCRIPTION"
        },
        "category" : "BAGGAGE"
      },
      "quantity" : 1
    } ],
    "offers" : [ {
      "offerId" : "05dd8bf6-97b1-46a7-a613-36c534ec0201",
      "services" : [ {
        "payload" : {
          "type" : "CHECKIN_BAGGAGE",
          "weight" : 32,
          "imageUrl" : null,
          "description" : "CHECKIN_BAGGAGE_DESCRIPTION"
        },
        "category" : "BAGGAGE"
      }, {
        "payload" : {
          "type" : "CABIN_BAGGAGE",
          "weight" : 10,
          "imageUrl" : null,
          "description" : "CABIN_BAGGAGE_DESCRIPTION"
        },
        "category" : "BAGGAGE"
      } ],
      "maxPerPax" : 2,
      "price" : 100,
      "currencyPrice" : {
        "base" : {
          "currency" : "USD",
          "value" : 100
        },
        "display" : {
          "currency" : "USD",
          "value" : 100
        }
      }
    } ]
  } ]
}
Table 12. Flight Offer response fields
Path Type Description

flightOffers[].flightId

String

Flight id (UUID)

flightOffers[].brandName

String

The name of the requested brand

flightOffers[].currency

String

Currency

flightOffers[].includedServices

Array

List of services in the brand

flightOffers[].includedServices[].service

Object

Service description

flightOffers[].includedServices[].quantity

Number

Quantity of service

flightOffers[].offers

Array

Available offers for sale

flightOffers[].offers[].offerId

String

Offer id (UUID)

flightOffers[].offers[].services

Array

Set of offer’s services

flightOffers[].offers[].services[].category

String

Service category type

flightOffers[].offers[].services[].payload

Object

Service payload

flightOffers[].offers[].maxPerPax

Number

Max quantity per passenger

flightOffers[].offers[].price

Number

Offer price

flightOffers[].offers[].currencyPrice

Object

Offer currency price

flightOffers[].offers[].currencyPrice.base.currency

String

Offer currency price base currency

flightOffers[].offers[].currencyPrice.base.value

Number

Offer currency price base value

flightOffers[].offers[].currencyPrice.display.currency

String

Offer currency price display currency

flightOffers[].offers[].currencyPrice.display.value

Number

Offer currency price display value

Flight Assistances

This request is for a list of available passenger assistance services.

Http Request
GET /v1/agency-api/assistances?flightIds=64b03ce6-03a3-465c-9e16-48045b9840e6&flightIds=4166785e-6590-42cf-9dd6-256ddeb62d20 HTTP/1.1
Accept: application/json
Flight Assistances request params

Unresolved directive in index.adoc - include::/home/gitlab-runner/builds/RRsrzGr7L/0/farel_repos/farel-os/farel-os-api/agency-api/target/generated-snippets/AgencyApiAssistanceControllerTest/assistances/request-parameters.adoc[]

The response for each service additionally indicates the type of passenger for which assistance can be selected.

HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 719

{
  "flightAssistances" : [ {
    "flightId" : "64b03ce6-03a3-465c-9e16-48045b9840e6",
    "assistances" : [ {
      "assistanceId" : "a8012180-f384-4aef-bf6c-2bba128d7916",
      "name" : "Deaf",
      "category" : "DEAF",
      "availability" : [ "ADT", "CHD" ]
    }, {
      "assistanceId" : "242ccb5d-46af-4042-8949-8e954ed2f440",
      "name" : "Bassi.NET",
      "category" : "BASSINET",
      "availability" : [ "INF" ]
    } ]
  }, {
    "flightId" : "4166785e-6590-42cf-9dd6-256ddeb62d20",
    "assistances" : [ {
      "assistanceId" : "58230fbc-bec8-4f31-9549-853bf5eeefc2",
      "name" : "Nice wheels, bro.",
      "category" : "WHEELCHAIR_SERVICE",
      "availability" : [ "ADT", "CHD" ]
    } ]
  } ]
}
Table 13. Flight Assistances response fields
Path Type Description

flightAssistances

Array

Available assistances on flight

flightAssistances[].flightId

String

Flight id (UUID)

flightAssistances[].assistances

Array

Assistance description

flightAssistances[].assistances[].assistanceId

String

Assistance id (UUID)

flightAssistances[].assistances[].name

String

Assistance name

flightAssistances[].assistances[].category

String

Assistance category

flightAssistances[].assistances[].availability

Array

List of passenger types for whom assistance is allowed

Booking Create

To create a booking, you must specify information about the selected flight, brand, and passengers. Additionally, for each passenger, you can specify a list of selected additional services and assistance of the airline on this flight.

*The set of mandatory parameters that must be specified to the passenger when booking may differ depending on the selected airline configuration. For each airline, the agent must agree on the list of parameters to be used.

HTTP Request
POST /v1/agency-api/bookings HTTP/1.1
Content-Type: application/json;charset=UTF-8
X-Currency: KZT
Accept: application/json;charset=UTF-8
Content-Length: 1375

{
  "passengers" : [ {
    "passenger" : {
      "paxType" : "ADT",
      "birthday" : "2021-03-01",
      "firstname" : "Andrei",
      "lastname" : "Shischits",
      "gender" : "MALE",
      "citizenship" : "KZT",
      "documentId" : "MP22222222",
      "documentType" : "PASSPORT",
      "documentExpireDate" : "2030-10-10"
    },
    "outboundFlight" : {
      "legs" : [ {
        "flightId" : "7f3d4300-f0fa-43c7-842a-b33bb42d2230",
        "brandFrameId" : "a0ebd77c-e2ef-475f-87a7-a373de87318f",
        "offers" : [ {
          "offerId" : "05dd8bf6-97b1-46a7-a613-36c534ec0201",
          "quantity" : 2
        } ],
        "assistances" : [ "75b5a9a1-1244-4f02-9c7f-85d43c6f283d" ]
      } ]
    },
    "returningFlight" : {
      "legs" : [ {
        "flightId" : "530a1925-0b3c-45da-927f-b217bd1cb516",
        "brandFrameId" : "a0ebd77c-e2ef-475f-87a7-a373de87318f",
        "offers" : [ {
          "offerId" : "05dd8bf6-97b1-46a7-a613-36c534ec0201",
          "quantity" : 2
        } ],
        "assistances" : [ "75b5a9a1-1244-4f02-9c7f-85d43c6f283d" ]
      } ]
    }
  } ],
  "customerInfo" : {
    "email" : "andrei@farel.io",
    "phone" : "+333222445566"
  },
  "agentFee" : 150,
  "routes" : [ {
    "routeId" : "75b5a9a1-1244-4f02-9c7f-85d43c6f283d",
    "fareFrameId" : "75b5a9a1-1244-4f02-9c7f-85d43c6f283d",
    "direction" : "OUTBOUND"
  } ]
}
Table 14. Booking Create request fields
Path Type Description

passengers

Array

Set of passengers data

Must not be empty. Size must be between 1 and 9 inclusive

passengers[].passenger.paxType

String

Passenger Type

Must be not null

passengers[].passenger.firstname

String

First name

First name must be of Latin letters. Must be not blank. Size must be between 1 and 300 inclusive

passengers[].passenger.lastname

String

Last name

Last name must be of Latin letters. Must be not blank. Size must be between 1 and 300 inclusive

passengers[].passenger.birthday

String

Date of birth

Must be in past. Must be not null

passengers[].passenger.gender

String

Gender

Must be not null

passengers[].passenger.citizenship

String

Citizenship

Must be not blank. Size must be between 2 and 300 inclusive

passengers[].passenger.documentId

String

Document number

ID must be alphanumeric. Must be not blank. Size must be between 2 and 300 inclusive

passengers[].passenger.documentType

String

Document type

Must be not null

passengers[].passenger.documentExpireDate

String

Document expire date

Must be in future

passengers[].outboundFlight

Object

Outbound flight description

passengers[].outboundFlight.legs

Array

Outbound flight legs

passengers[].outboundFlight.legs[].flightId

String

Flight id (UUID)

passengers[].outboundFlight.legs[].brandFrameId

String

Brand frame id (UUID)

passengers[].outboundFlight.legs[].offers

Array

List of selected offers

passengers[].outboundFlight.legs[].offers[].offerId

String

Offer id (UUID)

passengers[].outboundFlight.legs[].offers[].quantity

Number

Quantity

passengers[].outboundFlight.legs[].assistances

Array

List of assistances (UUID)

passengers[].returningFlight

Object

Returning flight description if exists

passengers[].returningFlight.legs

Array

Returning flight legs

passengers[].returningFlight.legs[].flightId

String

Flight id (UUID)

passengers[].returningFlight.legs[].brandFrameId

String

Brand frame id (UUID)

passengers[].returningFlight.legs[].offers

Array

List of selected offers

passengers[].returningFlight.legs[].offers[].offerId

String

Offer id (UUID)

passengers[].returningFlight.legs[].offers[].quantity

Number

Quantity

passengers[].returningFlight.legs[].assistances

Array

List of assistances (UUID)

customerInfo

Object

Customer contact information for notification

customerInfo.email

String

Customer email

Must be a well-formed email address

customerInfo.phone

String

Customer phone.

Phone should be numeric and should have leading '+'

agentFee

Number

Agent fee

routes[].routeId

String

RouteId

routes[].fareFrameId

String

fareFrameId

routes[].direction

String

direction

The response contains information about the created booking and its price.

HTTP Response
HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
Content-Length: 184

{
  "bookingId" : "13cf4b4c-d923-4ee9-a75e-e43999282fff",
  "orderId" : "05dd8bf6-97b1-46a7-a613-36c534ec0201",
  "bookingNumber" : "HQ2131",
  "currency" : "USD",
  "price" : 100500
}
Table 15. Booking Create response fields
Path Type Description

bookingId

String

Booking id (UUID)

orderId

String

Booking Order id (UUID)

bookingNumber

String

Booking number

currency

String

Currency

price

Number

Total price of booking

Booking Payment

To pay for the booking from the agent’s balance, you must complete the following request with information on the booking id. Our system will automatically determine the payment instrument for your agency and authorize for the amount of the booking.

HTTP Request
POST /v1/agency-api/bookings/13cf4b4c-d923-4ee9-a75e-e43999282fff/payments HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Table 16. Path params
Parameter Description

bookingId

Booking id (UUID)

HTTP Response
HTTP/1.1 202 Accepted

Booking Order

Booking payment deadline in seconds. Order ID must be passed in path, it can be obtained from the booking create request.

Table 17. Path params
Parameter Description

orderId

Order ID (UUID)

HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 24

{
  "timeLimit" : 1200
}

Booking Details

This endpoint is designed to receive detailed information on booking: booking details, data on each passenger segment, and route. The request can be made after paying for the booking, in order to receive information about successful authorization. And to receive changes to the reservation that could have occurred on the side of the airline.

HTTP Request
GET /v1/agency-api/bookings/13cf4b4c-d923-4ee9-a75e-e43999282fff HTTP/1.1
Accept: application/json
Table 18. Path params
Parameter Description

bookingId

Booking id (UUID)

HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 3768

{
  "bookingId" : "13cf4b4c-d923-4ee9-a75e-e43999282fff",
  "bookingNumber" : "HQ2131",
  "createdDate" : 1.66540171E9,
  "payedDate" : 1.66540171E9,
  "paymentFailReason" : "Payment Fail Reason",
  "currency" : "USD",
  "outboundFlight" : {
    "legs" : [ {
      "flightId" : "7f3d4300-f0fa-43c7-842a-b33bb42d2230",
      "flightNumber" : "IO-9999",
      "departureDateTime" : "2022-10-09T09:00:00",
      "departureAirportCode" : "ALA",
      "arrivalDateTime" : "2022-10-10T09:00:00",
      "arrivalAirportCode" : "GDN",
      "duration" : 180,
      "aircraftName" : "Millennium Falcon"
    } ],
    "stops" : [ ],
    "totalDuration" : 1000
  },
  "returningFlight" : {
    "legs" : [ {
      "flightId" : "530a1925-0b3c-45da-927f-b217bd1cb516",
      "flightNumber" : "IO-8888",
      "departureDateTime" : "2022-10-10T11:00:00",
      "departureAirportCode" : "GDN",
      "arrivalDateTime" : "2022-10-10T15:00:00",
      "arrivalAirportCode" : "ALA",
      "duration" : 180,
      "aircraftName" : "Millennium Falcon"
    } ],
    "stops" : [ ],
    "totalDuration" : 1000
  },
  "passengerSegments" : [ {
    "passengerSegmentId" : "962cfe9e-2557-468a-9ca3-41f8d5975054",
    "passengerSegmentStatus" : "ISSUED",
    "flightId" : "7f3d4300-f0fa-43c7-842a-b33bb42d2230",
    "price" : 100500.01,
    "baseFarePrice" : 90,
    "taxChargePrice" : 10,
    "passengerData" : {
      "paxType" : "ADT",
      "birthday" : [ 2021, 3, 1 ],
      "firstname" : "Andrei",
      "lastname" : "Shischits",
      "gender" : "MALE",
      "citizenship" : "KZT",
      "documentId" : "MP22222222",
      "documentType" : "PASSPORT",
      "documentExpireDate" : [ 2030, 10, 10 ],
      "passengerId" : "a1c509cc-5079-44a4-a02c-d57218274528",
      "eticketNumber" : null
    },
    "offers" : [ {
      "offerId" : "05dd8bf6-97b1-46a7-a613-36c534ec0201",
      "quantity" : 2,
      "price" : 100,
      "services" : [ {
        "payload" : {
          "type" : "CHECKIN_BAGGAGE",
          "weight" : 32,
          "imageUrl" : null,
          "description" : "CHECKIN_BAGGAGE_DESCRIPTION"
        },
        "category" : "BAGGAGE"
      }, {
        "payload" : {
          "type" : "CABIN_BAGGAGE",
          "weight" : 10,
          "imageUrl" : null,
          "description" : "CABIN_BAGGAGE_DESCRIPTION"
        },
        "category" : "BAGGAGE"
      } ]
    } ],
    "assistances" : [ {
      "assistanceId" : "75b5a9a1-1244-4f02-9c7f-85d43c6f283d",
      "name" : "Help disabled passenger",
      "category" : "PASSENGER_WITH_DISABILITY"
    } ],
    "managingRules" : [ {
      "timeLimit" : 30,
      "allowance" : true,
      "type" : "NO_SHOW_REFUND",
      "penaltyValue" : 0,
      "penaltyType" : "FREE_VALUE"
    } ],
    "brand" : {
      "brandId" : "762cfe9e-2557-468a-9ca3-41f8d5975054",
      "name" : "Light Saber",
      "cabinClass" : "ECONOMY",
      "services" : [ {
        "service" : {
          "payload" : {
            "type" : "CHECKIN_BAGGAGE",
            "weight" : 10,
            "imageUrl" : null,
            "description" : "CHECKIN_BAGGAGE_DESCRIPTION"
          },
          "category" : "BAGGAGE"
        },
        "quantity" : 3
      } ]
    }
  } ],
  "customerInfo" : {
    "email" : "andrei@farel.io",
    "phone" : "84952020327"
  },
  "agentFee" : 100,
  "primaryBooking" : {
    "bookingId" : "7777777c-d923-4ee9-a75e-e43999282ccc",
    "bookingNumber" : "5"
  },
  "linkedBookings" : [ {
    "bookingId" : "1111114c-d923-4ee9-a75e-e43999282aaa",
    "bookingNumber" : "55"
  } ],
  "previousBookings" : [ {
    "bookingId" : "99999999-9923-4ee9-a75e-e43999282ddd",
    "bookingNumber" : "4"
  } ],
  "followingBookings" : [ {
    "bookingId" : "22222222-2923-4ee9-a75e-e43999282bbb",
    "bookingNumber" : "6"
  } ]
}
Table 19. Booking Details response fields
Path Type Description

bookingId

String

Booking id (UUID)

bookingNumber

String

Booking number

createdDate

Number

Booking creation date

payedDate

Number

Booking payment date

paymentFailReason

String

Payment Fail Reason

currency

String

Currency

primaryBooking

Object

Primary booking

primaryBooking.bookingId

String

Booking id of primary booking

primaryBooking.bookingNumber

String

Booking number of primary booking

linkedBookings

Array

Linked booking

linkedBookings[].bookingId

String

Booking id of linked booking

linkedBookings[].bookingNumber

String

Booking number of linked booking

previousBookings[]

Array

Previous bookings

previousBookings[].bookingId

String

Booking id of previous booking

previousBookings[].bookingNumber

String

Booking number of previous booking

followingBookings

Array

Following booking

followingBookings[].bookingId

String

Booking id of following booking

followingBookings[].bookingNumber

String

Booking number of following booking

outboundFlight

Object

Outbound flight

outboundFlight.legs

Array

Outbound flight legs

outboundFlight.stops

Array

Information about stops for flights with layovers

outboundFlight.totalDuration

Number

Total duration of the flight

outboundFlight.legs[].flightId

String

Flight id (UUID)

outboundFlight.legs[].flightNumber

String

Flight number

outboundFlight.legs[].departureDateTime

String

Date and time of flight departure

outboundFlight.legs[].departureAirportCode

String

IATA-code of airport of departure

outboundFlight.legs[].arrivalDateTime

String

Date and time of flight arrival

outboundFlight.legs[].arrivalAirportCode

String

IATA-code of airport of arrival

outboundFlight.legs[].duration

Number

Flight duration

outboundFlight.legs[].aircraftName

String

Aircraft name

returningFlight

Object

Returning flight if exists

returningFlight.legs

Array

Returning flight legs

returningFlight.stops

Array

Information about stops for flights with layovers

returningFlight.totalDuration

Number

Total duration of the flight

returningFlight.legs[].flightId

String

Flight id (UUID)

returningFlight.legs[].flightNumber

String

Flight number

returningFlight.legs[].departureDateTime

String

Date and time of flight departure

returningFlight.legs[].departureAirportCode

String

IATA-code of airport of departure

returningFlight.legs[].arrivalDateTime

String

Date and time of flight arrival

returningFlight.legs[].arrivalAirportCode

String

IATA-code of airport of arrival

returningFlight.legs[].duration

Number

Flight duration

returningFlight.legs[].aircraftName

String

Aircraft name

passengerSegments

Array

List of passenger booking segments with details

passengerSegments[].passengerSegmentId

String

Passenger segment id (UUID)

passengerSegments[].passengerSegmentStatus

String

Passenger segment status. Status descriptions are given below.

passengerSegments[].flightId

String

Flight id (UUID)

passengerSegments[].price

Number

Price

passengerSegments[].baseFarePrice

Number

booking class & fare price

passengerSegments[].taxChargePrice

Number

tax & charge price

passengerSegments[].passengerData

Object

Passenger data

passengerSegments[].passengerData.paxType

String

Passenger Type

passengerSegments[].passengerData.birthday

Array

Date of birth

passengerSegments[].passengerData.firstname

String

First name

passengerSegments[].passengerData.lastname

String

Last name

passengerSegments[].passengerData.gender

String

Gender

passengerSegments[].passengerData.citizenship

String

Citizenship

passengerSegments[].passengerData.documentId

String

Document number

passengerSegments[].passengerData.documentType

String

Document type

passengerSegments[].passengerData.documentExpireDate

Array

Document expire date

passengerSegments[].passengerData.passengerId

String

Passenger ID

passengerSegments[].passengerData.eticketNumber

Null

eticketNumber

passengerSegments[].offers

Array

List of offers

passengerSegments[].offers[].offerId

String

Offer id (UUID)

passengerSegments[].offers[].quantity

Number

Quantity

passengerSegments[].offers[].price

Number

Offer price

passengerSegments[].offers[].services

Array

Set of offer’s services

passengerSegments[].offers[].services[]

Array

Services description

passengerSegments[].offers[].services[].category

String

Service category type

passengerSegments[].offers[].services[].payload

Object

Service payload

passengerSegments[].assistances

Array

Assistance description

passengerSegments[].assistances[].assistanceId

String

Assistance id (UUID)

passengerSegments[].assistances[].name

String

Assistance name

passengerSegments[].assistances[].category

String

Assistance category

passengerSegments[].managingRules

Array

Passenger segment management rules

passengerSegments[].managingRules[].allowance

Boolean

Rule allowance

passengerSegments[].managingRules[].type

String

Rule type

passengerSegments[].managingRules[].penaltyValue

Number

Penalty value

passengerSegments[].managingRules[].penaltyType

String

Penalty type

passengerSegments[].managingRules[].timeLimit

Number

Rule time limit

passengerSegments[].brand

Object

Branded Fare details

passengerSegments[].brand.brandId

String

Brand id (UUID)

passengerSegments[].brand.name

String

Brand name

passengerSegments[].brand.cabinClass

String

Cabin class

passengerSegments[].brand.services

Array

Brand services

passengerSegments[].brand.services[].service

Object

Service description

passengerSegments[].brand.services[].service.category

String

Service category type

passengerSegments[].brand.services[].service.payload

Object

Service payload with parameters (payload varies by category)

passengerSegments[].brand.services[].quantity

Number

Service quantity

customerInfo

Object

Customer contact information for notification

customerInfo.email

String

Customer email

customerInfo.phone

String

Customer phone

agentFee

Number

Agent fee

Refund Details

Endpoint for getting refund details by booking for each passenger segment.

HTTP Request
GET /v1/agency-api/bookings/13cf4b4c-d923-4ee9-a75e-e43999282fff/refund HTTP/1.1
Accept: application/json
Table 20. Path params
Parameter Description

bookingId

Booking id (UUID)

HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 287

{
  "currency" : "EUR",
  "paxSegments" : [ {
    "paxSegmentId" : "4d75efa9-deb9-426f-8d4f-780d10dff142",
    "refundAmount" : 100500,
    "available" : false
  }, {
    "paxSegmentId" : "9c474a4e-d182-499b-b94b-93c7b7c935a9",
    "refundAmount" : 200100,
    "available" : true
  } ]
}
Table 21. Refund Details response fields
Path Type Description

currency

String

Currency

paxSegments

Array

Refund info for each passenger segment

paxSegments[].paxSegmentId

String

Passenger segment ID

paxSegments[].refundAmount

Number

Refund amount for this passenger segment

paxSegments[].available

Boolean

The refund availability

Refund

Endpoint for performing a refund on the specified passenger segments of the booking.

Http Request
POST /v1/agency-api/bookings/13cf4b4c-d923-4ee9-a75e-e43999282fff/refund HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json;charset=UTF-8
Content-Length: 106

{
  "paxSegmentIds" : [ "162fc5c0-fed0-49dd-9fb7-c4e5ec68e417", "34fb9a7a-8a46-486c-96a7-eb61316f6b28" ]
}
Table 22. Path params
Parameter Description

bookingId

Booking id (UUID)

Request body
{
  "paxSegmentIds" : [ "162fc5c0-fed0-49dd-9fb7-c4e5ec68e417", "34fb9a7a-8a46-486c-96a7-eb61316f6b28" ]
}
Table 23. Refund request fields
Path Type Description

paxSegmentIds

Array

Passenger segment ID

Must not be empty

HTTP Response
HTTP/1.1 202 Accepted

Add Infant

The endpoint is designed to add an infant for the current booking. Information about the route, brand and fare rules is inherited from the main booking.

HTTP Request
POST /v1/agency-api/bookings/13cf4b4c-d923-4ee9-a75e-e43999282fff/infant HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json;charset=UTF-8
Content-Length: 1095

{
  "passengers" : [ {
    "passenger" : {
      "birthday" : "1991-03-01",
      "firstname" : "Andrei",
      "lastname" : "Shischits",
      "gender" : "MALE",
      "citizenship" : "KZT",
      "documentId" : "MP22222222",
      "documentType" : "PASSPORT",
      "documentExpireDate" : "2027-09-09"
    },
    "outboundFlight" : {
      "legs" : [ {
        "flightId" : "7f3d4300-f0fa-43c7-842a-b33bb42d2230",
        "brandFrameId" : "a0ebd77c-e2ef-475f-87a7-a373de87318f",
        "offers" : [ {
          "offerId" : "05dd8bf6-97b1-46a7-a613-36c534ec0201",
          "quantity" : 2
        } ],
        "assistances" : [ "34348bf6-97b1-46a7-a613-36c534121212" ]
      } ]
    },
    "returningFlight" : {
      "legs" : [ {
        "flightId" : "530a1925-0b3c-45da-927f-b217bd1cb516",
        "brandFrameId" : "a0ebd77c-e2ef-475f-87a7-a373de87318f",
        "offers" : [ {
          "offerId" : "05dd8bf6-97b1-46a7-a613-36c534ec0201",
          "quantity" : 2
        } ],
        "assistances" : [ "34348bf6-97b1-46a7-a613-36c534121212" ]
      } ]
    }
  } ],
  "agentFee" : 100500
}
Table 24. Add Infant request fields
Path Type Description

passengers

Array

Set of passengers data

Must not be empty

passengers[].passenger.firstname

String

First name

First name must be of Latin letters. Must be not blank. Size must be between 1 and 300 inclusive

passengers[].passenger.lastname

String

Last name

Last name must be of Latin letters. Must be not blank. Size must be between 1 and 300 inclusive

passengers[].passenger.birthday

String

Date of birth

Must be in past. Must be not null

passengers[].passenger.gender

String

Gender

Must be not null

passengers[].passenger.citizenship

String

Citizenship

Must be not blank. Size must be between 2 and 300 inclusive

passengers[].passenger.documentId

String

Document number

ID must be alphanumeric. Must be not blank. Size must be between 2 and 300 inclusive

passengers[].passenger.documentType

String

Document type

Must be not null

passengers[].passenger.documentExpireDate

String

Document expire date

Must be in future

passengers[].outboundFlight

Object

Outbound flight description

passengers[].outboundFlight.legs

Array

Outbound flight legs

passengers[].outboundFlight.legs[].flightId

String

Flight id (UUID)

passengers[].outboundFlight.legs[].brandFrameId

String

Brand frame id (UUID)

passengers[].outboundFlight.legs[].offers

Array

List of selected offers

passengers[].outboundFlight.legs[].offers[].offerId

String

Offer id (UUID)

passengers[].outboundFlight.legs[].offers[].quantity

Number

Quantity

passengers[].outboundFlight.legs[].assistances

Array

List of assistances (UUID)

passengers[].returningFlight

Object

Returning flight description if exists

passengers[].returningFlight.legs

Array

Returning flight legs

passengers[].returningFlight.legs[].flightId

String

Flight id (UUID)

passengers[].returningFlight.legs[].brandFrameId

String

Brand frame id (UUID)

passengers[].returningFlight.legs[].offers

Array

List of selected offers

passengers[].returningFlight.legs[].offers[].offerId

String

Offer id (UUID)

passengers[].returningFlight.legs[].offers[].quantity

Number

Quantity

passengers[].returningFlight.legs[].assistances

Array

List of assistances (UUID)

agentFee

Number

Agent fee

As a result of the operation, a new booking with an infant is created, which is associated with the main booking.

HTTP Response
HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
Content-Length: 184

{
  "bookingId" : "13cf4b4c-d923-4ee9-a75e-e43999282fff",
  "orderId" : "05dd8bf6-97b1-46a7-a613-36c534ec0201",
  "bookingNumber" : "HQ2131",
  "currency" : "USD",
  "price" : 100500
}
Table 25. Add Infant response fields
Path Type Description

bookingId

String

Booking id (UUID)

orderId

String

Booking Order id (UUID)

bookingNumber

String

Booking number

currency

String

Currency

price

Number

Total price of booking

Exchange Flight Alternative Dates

Endpoint for getting exchange flight alternative dates by booking ID and flightIDs.

HTTP Request
GET /v1/agency-api/bookings/00000000-0000-0000-0000-000000000000/exchange/alternative?flightIds=00000000-0000-0000-0000-000000000001%2C00000000-0000-0000-0000-000000000002 HTTP/1.1
Accept: application/json;charset=UTF-8
Table 26. Path params
Parameter Description

bookingId

Booking id (UUID)

HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 46

{
  "dates" : [ "2025-06-05", "2025-06-06" ]
}
Table 27. Response params
Path Type Description

dates

Array

List of dates with available flights

Get Exchange Alternative Flights

An endpoint for getting for an alternative flights to exchange.

HTTP Request
GET /v1/agency-api/bookings/00000000-0000-0000-0000-000000000000/exchange/flights HTTP/1.1
Accept: application/json;charset=UTF-8
Table 28. Path params
Parameter Description

bookingId

Booking id (UUID)

The response contains information about each available flight and passengers.

HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 2250

{
  "fareName" : "Cheapest fare",
  "fareFrameId" : "f2ad959e-1c2d-4135-90d2-8ca77336be22",
  "orderNumber" : "123456",
  "routes" : [ {
    "routeId" : "7fe11c69-040f-45f0-925b-7b6ed0b388ee",
    "routeInfo" : {
      "origin" : "ALA",
      "destination" : "JFK"
    },
    "direction" : "OUTBOUND",
    "legs" : [ {
      "flightId" : "5011ef21-de47-45de-8d7f-5664cbf36efa",
      "flightNumber" : "KC123",
      "origin" : {
        "city" : "ALA",
        "cityName" : "Almaty",
        "airportCode" : "ALA",
        "airportName" : "Almaty International Airport"
      },
      "departureDateTime" : [ 2025, 6, 5, 10, 0 ],
      "destination" : {
        "city" : "JFK",
        "cityName" : "New York",
        "airportCode" : "JFK",
        "airportName" : "John F. Kennedy International Airport"
      },
      "arrivalDateTime" : [ 2025, 6, 5, 20, 0 ],
      "duration" : 36000,
      "aircraft" : "Boeing 737",
      "alternativeFlight" : true,
      "departureDate" : [ 2025, 6, 5 ],
      "arrivalDate" : [ 2025, 6, 5 ],
      "departureTime" : "10:00",
      "arrivalTime" : "20:00",
      "arriveDateOffset" : 0
    } ],
    "stops" : [ {
      "airport" : {
        "city" : "TSE",
        "cityName" : "Astana",
        "airportCode" : "TSE",
        "airportName" : "Astana International Airport"
      },
      "airportCode" : "TSE",
      "duration" : 3600
    } ],
    "totalDuration" : 7200
  } ],
  "passengers" : [ {
    "passengerId" : "167b9536-55da-48ef-bdb5-58b7b2853276",
    "firstName" : "John",
    "lastName" : "Doe",
    "paxSegments" : [ {
      "paxSegmentId" : "f890f91b-743b-45e4-a986-7b4bad2f9d6b",
      "status" : "ISSUED",
      "flightId" : "82bf46e8-f288-439e-b49c-c228f4029394",
      "legNumber" : 1,
      "exchangeAllowed" : true,
      "involuntary" : "NONE",
      "involuntaryChange" : false,
      "totalPrice" : 10,
      "paxType" : {
        "type" : "ADT",
        "unn" : false,
        "discount" : null,
        "seatIncluded" : true
      },
      "farePrice" : 10,
      "offersPrice" : 0,
      "taxPrice" : 0,
      "offers" : [ ]
    } ]
  } ],
  "managingRules" : [ {
    "name" : "REFUND_BEFORE_DEPARTURE",
    "penalty" : {
      "value" : 10,
      "type" : "PERCENT"
    }
  } ]
}
Table 29. Get Exchange Alterntive Flights response fields
Path Type Description

fareName

String

Fare name

fareFrameId

String

Fare frame ID (UUID)

orderNumber

String

Booking number

routes

Array

List of routes

routes[].routeId

String

Route ID (UUID)

routes[].routeInfo

Object

Route information

routes[].routeInfo.origin

String

Origin airport code

routes[].routeInfo.destination

String

Destination airport code

routes[].direction

String

Route direction

routes[].legs

Array

List of route legs

routes[].legs[].flightId

String

Flight ID (UUID)

routes[].legs[].flightNumber

String

Flight number

routes[].legs[].origin

Object

Origin airport

routes[].legs[].origin.city

String

City code

routes[].legs[].origin.cityName

String

City name

routes[].legs[].origin.airportCode

String

Airport code

routes[].legs[].origin.airportName

String

Airport name

routes[].legs[].departureDateTime

Array

Departure date and time

routes[].legs[].destination

Object

Destination airport

routes[].legs[].destination.city

String

City code

routes[].legs[].destination.cityName

String

City name

routes[].legs[].destination.airportCode

String

Airport code

routes[].legs[].destination.airportName

String

Airport name

routes[].legs[].arrivalDateTime

Array

Arrival date and time

routes[].legs[].duration

Number

Flight duration in seconds

routes[].legs[].aircraft

String

Aircraft name

routes[].legs[].alternativeFlight

Boolean

Is this alternative flight

routes[].legs[].departureDate

Array

Departure date

routes[].legs[].arrivalDate

Array

Arrival date

routes[].legs[].departureTime

String

Departure time

routes[].legs[].arrivalTime

String

Arrival time

routes[].legs[].arriveDateOffset

Number

Number of days between departure and arrival

routes[].stops

Array

List of stops

routes[].stops[].airport

Object

Stop airport

routes[].stops[].airport.city

String

City code

routes[].stops[].airport.cityName

String

City name

routes[].stops[].airport.airportCode

String

Airport code

routes[].stops[].airport.airportName

String

Airport name

routes[].stops[].airportCode

String

Airport code

routes[].stops[].duration

Number

Stop duration in seconds

routes[].totalDuration

Number

Total route duration in seconds

passengers

Array

List of passengers

passengers[].passengerId

String

Passenger ID (UUID)

passengers[].firstName

String

Passenger first name

passengers[].lastName

String

Passenger last name

passengers[].paxSegments

Array

List of passenger segments

passengers[].paxSegments[].paxSegmentId

String

Passenger segment ID (UUID)

passengers[].paxSegments[].farePrice

Number

Passenger segment fare price

passengers[].paxSegments[].offersPrice

Number

Passenger segment offers price

passengers[].paxSegments[].taxPrice

Number

Passenger segment taxes price

passengers[].paxSegments[].offers

Array

List of passenger segment offers

passengers[].paxSegments[].status

String

Passenger segment status

passengers[].paxSegments[].flightId

String

Flight ID (UUID)

passengers[].paxSegments[].legNumber

Number

Leg number

passengers[].paxSegments[].exchangeAllowed

Boolean

Is exchange allowed

passengers[].paxSegments[].involuntary

String

Involuntary type

passengers[].paxSegments[].involuntaryChange

Boolean

Is involuntary change

passengers[].paxSegments[].totalPrice

Number

Total price

passengers[].paxSegments[].paxType

Object

Passenger type

passengers[].paxSegments[].paxType.type

String

Passenger type

passengers[].paxSegments[].paxType.seatIncluded

Boolean

Is seat included

passengers[].paxSegments[].paxType.unn

Boolean

Is UNN

managingRules

Array

List of managing rules

managingRules[].name

String

Rule name

managingRules[].penalty

Object

Penalty amount

managingRules[].penalty.value

Number

Penalty value

managingRules[].penalty.type

String

Penalty type

Search exchange options by pax segment IDs and flight date

Endpoint for searching exchange options by pax segment IDs and flight date.

HTTP Request
POST /v1/agency-api/bookings/00000000-0000-0000-0000-000000000000/exchange/search HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json;charset=UTF-8
X-Currency: USD
Content-Length: 137

{
  "oldPaxSegmentIds" : [ "f045688d-5c86-4a4d-9dad-f9022ae4869f", "d94f308c-8143-4e23-9af4-7fcd98caf94c" ],
  "newDate" : "2025-06-05"
}
Table 30. Path params
Parameter Description

bookingId

Booking id (UUID)

Table 31. Booking Exchange Search request fields
Path Type Description

oldPaxSegmentIds

Array

List of pax segments to exchange

newDate

String

Exchange flight date

The response contains information about the exchange option routes.

HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 7030

{
  "routes" : [ {
    "passengers" : [ {
      "passengerId" : "8c9de749-5614-4733-87e2-0d40d7ebe254",
      "paxSegments" : [ {
        "paxSegmentId" : "83555eff-20a2-4efc-84a2-4703784131d2",
        "offers" : [ {
          "offerId" : "cbf3fbd8-412f-4cc6-9be5-ea2004962bdd",
          "price" : 10,
          "currencyPrice" : {
            "base" : {
              "currency" : "USD",
              "value" : 10
            },
            "display" : {
              "currency" : "KZT",
              "value" : 4800
            }
          },
          "debit" : 10,
          "currencyDebit" : {
            "base" : {
              "currency" : "USD",
              "value" : 10
            },
            "display" : {
              "currency" : "KZT",
              "value" : 4800
            }
          },
          "quantity" : 1,
          "ancillaries" : [ ],
          "active" : true,
          "area" : "B2B"
        } ],
        "offerPrices" : [ {
          "offerId" : "cbf3fbd8-412f-4cc6-9be5-ea2004962bdd",
          "quantity" : 1
        } ]
      } ],
      "firstName" : "John",
      "lastName" : "Doe",
      "birthday" : [ 1995, 6, 5 ],
      "documentNumber" : "123456",
      "documentType" : "PASSPORT",
      "citizenship" : "KZ",
      "documentExpireDate" : [ 2035, 6, 5 ],
      "paxType" : {
        "type" : "ADT",
        "unn" : false,
        "discount" : null,
        "seatIncluded" : true
      },
      "farePrice" : 1,
      "price" : 1000,
      "taxPrice" : 0,
      "currencyTaxPrice" : {
        "base" : {
          "currency" : "USD",
          "value" : 0
        },
        "display" : {
          "currency" : "KZT",
          "value" : 0
        }
      },
      "taxCharge" : 0,
      "currencyTaxCharge" : {
        "base" : {
          "currency" : "USD",
          "value" : 0
        },
        "display" : {
          "currency" : "KZT",
          "value" : 0
        }
      },
      "taxxPrice" : 0,
      "currencyTaxxPrice" : {
        "base" : {
          "currency" : "USD",
          "value" : 0
        },
        "display" : {
          "currency" : "KZT",
          "value" : 0
        }
      },
      "totalCharge" : 10,
      "totalCurrencyCharge" : {
        "base" : {
          "currency" : "USD",
          "value" : 10
        },
        "display" : {
          "currency" : "KZT",
          "value" : 4800
        }
      },
      "fareCharge" : 1,
      "fareCurrencyCharge" : {
        "base" : {
          "currency" : "USD",
          "value" : 1
        },
        "display" : {
          "currency" : "KZT",
          "value" : 480
        }
      },
      "totalFee" : 10,
      "totalCurrencyFee" : {
        "base" : {
          "currency" : "USD",
          "value" : 10
        },
        "display" : {
          "currency" : "KZT",
          "value" : 4800
        }
      }
    } ],
    "route" : {
      "legs" : [ {
        "flightId" : "54393032-9e41-4022-bd4a-2ef4b5b303b2",
        "flightNumber" : "KC123",
        "origin" : {
          "city" : "ALA",
          "cityName" : "Almaty",
          "airportCode" : "ALA",
          "airportName" : "Almaty International Airport"
        },
        "departureDateTime" : [ 2025, 6, 5, 10, 0 ],
        "destination" : {
          "city" : "JFK",
          "cityName" : "New York",
          "airportCode" : "JFK",
          "airportName" : "John F. Kennedy International Airport"
        },
        "arrivalDateTime" : [ 2025, 6, 5, 20, 0 ],
        "duration" : 36000,
        "aircraft" : "Boeing 737",
        "alternativeFlight" : true,
        "departureDate" : [ 2025, 6, 5 ],
        "arrivalDate" : [ 2025, 6, 5 ],
        "departureTime" : "10:00",
        "arrivalTime" : "20:00",
        "arriveDateOffset" : 0
      } ],
      "stops" : [ {
        "airport" : {
          "city" : "TSE",
          "cityName" : "Astana",
          "airportCode" : "TSE",
          "airportName" : "Astana International Airport"
        },
        "airportCode" : "TSE",
        "duration" : 3600
      } ],
      "totalDuration" : 20
    },
    "fare" : {
      "fareId" : "3febb90c-959d-4807-a21c-41acbb6e052c",
      "fareFrameId" : "fe71678f-0b9d-49df-932b-c39a052d3b66",
      "name" : "Cheapest fare",
      "cabinClass" : "FIRST",
      "managingRules" : [ {
        "name" : "REFUND_BEFORE_DEPARTURE",
        "penalty" : {
          "type" : "PERCENT",
          "value" : 10
        },
        "timeBeforeDeparture" : 30
      } ],
      "baggageRules" : [ {
        "quantity" : 1,
        "type" : "CABIN_BAGGAGE",
        "weight" : 23
      } ],
      "price" : 1000
    },
    "legs" : [ {
      "flightId" : "54393032-9e41-4022-bd4a-2ef4b5b303b2",
      "flightNumber" : "KC123",
      "origin" : {
        "city" : "ALA",
        "cityName" : "Almaty",
        "airportCode" : "ALA",
        "airportName" : "Almaty International Airport"
      },
      "departureDateTime" : [ 2025, 6, 5, 10, 0 ],
      "destination" : {
        "city" : "JFK",
        "cityName" : "New York",
        "airportCode" : "JFK",
        "airportName" : "John F. Kennedy International Airport"
      },
      "arrivalDateTime" : [ 2025, 6, 5, 20, 0 ],
      "duration" : 36000,
      "aircraft" : "Boeing 737",
      "alternativeFlight" : true,
      "departureDate" : [ 2025, 6, 5 ],
      "arrivalDate" : [ 2025, 6, 5 ],
      "departureTime" : "10:00",
      "arrivalTime" : "20:00",
      "arriveDateOffset" : 0
    } ],
    "stops" : [ {
      "airport" : {
        "city" : "TSE",
        "cityName" : "Astana",
        "airportCode" : "TSE",
        "airportName" : "Astana International Airport"
      },
      "airportCode" : "TSE",
      "duration" : 3600
    } ],
    "totalDuration" : 20,
    "totalCharge" : 10,
    "totalCurrencyCharge" : {
      "base" : {
        "currency" : "USD",
        "value" : 10
      },
      "display" : {
        "currency" : "KZT",
        "value" : 0
      }
    },
    "totalPrice" : 0,
    "totalCurrencyPrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 0
      },
      "display" : {
        "currency" : "KZT",
        "value" : 0
      }
    },
    "totalFarePrice" : 0,
    "totalCurrencyFarePrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 0
      },
      "display" : {
        "currency" : "KZT",
        "value" : 0
      }
    },
    "totalTaxPrice" : 0,
    "totalCurrencyTaxPrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 0
      },
      "display" : {
        "currency" : "KZT",
        "value" : 0
      }
    },
    "totalFeePrice" : 0,
    "totalCurrencyFeePrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 0
      },
      "display" : {
        "currency" : "KZT",
        "value" : 0
      }
    },
    "totalFareCharge" : 0,
    "totalCurrencyFareCharge" : {
      "base" : {
        "currency" : "USD",
        "value" : 0
      },
      "display" : {
        "currency" : "KZT",
        "value" : 0
      }
    }
  } ]
}
Table 32. Booking Exchange response fields
Path Type Description

routes

Array

List of exchange routes

routes[].totalCharge

Number

Total charge

routes[].totalCurrencyCharge

Object

Total currency charge

routes[].totalCurrencyCharge.base

Object

Base currency charge

routes[].totalCurrencyCharge.base.currency

String

Currency code

routes[].totalCurrencyCharge.base.value

Number

Currency value

routes[].totalCurrencyCharge.display

Object

Display currency charge

routes[].totalCurrencyCharge.display.currency

String

Currency code

routes[].totalCurrencyCharge.display.value

Number

Currency value

routes[].totalPrice

Number

Total currency price

routes[].totalCurrencyPrice

Object

Currency value price

routes[].totalCurrencyPrice.base

Object

Base currency price

routes[].totalCurrencyPrice.base.currency

String

Currency code

routes[].totalCurrencyPrice.base.value

Number

Currency value

routes[].totalCurrencyPrice.display

Object

Display currency price

routes[].totalCurrencyPrice.display.currency

String

Currency code

routes[].totalCurrencyPrice.display.value

Number

Currency value

routes[].passengers

Array

List of passengers

routes[].passengers[].passengerId

String

Passenger ID (UUID)

routes[].passengers[].paxSegments

Array

List of passenger segments

routes[].passengers[].paxSegments[].paxSegmentId

String

Passenger segment ID (UUID)

routes[].passengers[].paxSegments[].offers

Array

List of offers

routes[].passengers[].paxSegments[].offers[].offerId

String

Offer ID (UUID)

routes[].passengers[].paxSegments[].offers[].area

String

Offer area

routes[].passengers[].paxSegments[].offers[].price

Number

Offer price

routes[].passengers[].paxSegments[].offers[].currencyPrice

Object

Offer currency price

routes[].passengers[].paxSegments[].offers[].currencyPrice.base

Object

Offer base currency price

routes[].passengers[].paxSegments[].offers[].currencyPrice.base.currency

String

Offer base currency price currency code

routes[].passengers[].paxSegments[].offers[].currencyPrice.base.value

Number

Offer base currency price value

routes[].passengers[].paxSegments[].offers[].currencyPrice.display

Object

Offer display currency price

routes[].passengers[].paxSegments[].offers[].currencyPrice.display.currency

String

Offer display currency price currency code

routes[].passengers[].paxSegments[].offers[].currencyPrice.display.value

Number

Offer display currency price value

routes[].passengers[].paxSegments[].offers[].ancillaries

Array

List of ancillaries

routes[].passengers[].paxSegments[].offers[].quantity

Number

Offer quantity

routes[].passengers[].paxSegments[].offers[].active

Boolean

Is offer available

routes[].passengers[].totalCharge

Number

Total charge

routes[].passengers[].totalCurrencyCharge

Object

Total currency charge

routes[].passengers[].totalCurrencyCharge.base

Object

Base currency charge

routes[].passengers[].totalCurrencyCharge.base.currency

String

Currency code

routes[].passengers[].totalCurrencyCharge.base.value

Number

Currency value

routes[].passengers[].totalCurrencyCharge.display

Object

Display currency charge

routes[].passengers[].totalCurrencyCharge.display.currency

String

Currency code

routes[].passengers[].totalCurrencyCharge.display.value

Number

Currency value

routes[].passengers[].fareCharge

Number

Fare charge

routes[].passengers[].fareCurrencyCharge

Object

Fare currency charge

routes[].passengers[].fareCurrencyCharge.base

Object

Base currency charge

routes[].passengers[].fareCurrencyCharge.base.currency

String

Currency code

routes[].passengers[].fareCurrencyCharge.base.value

Number

Currency value

routes[].passengers[].fareCurrencyCharge.display

Object

Display currency charge

routes[].passengers[].fareCurrencyCharge.display.currency

String

Currency code

routes[].passengers[].fareCurrencyCharge.display.value

Number

Currency value

routes[].passengers[].totalFee

Number

Total fee

routes[].passengers[].totalCurrencyFee

Object

Total currency fee

routes[].passengers[].totalCurrencyFee.base

Object

Base currency fee

routes[].passengers[].totalCurrencyFee.base.currency

String

Currency code

routes[].passengers[].totalCurrencyFee.base.value

Number

Currency value

routes[].passengers[].totalCurrencyFee.display

Object

Display currency fee

routes[].passengers[].totalCurrencyFee.display.currency

String

Currency code

routes[].passengers[].totalCurrencyFee.display.value

Number

Currency value

routes[].passengers[].firstName

String

Passenger first name

routes[].passengers[].lastName

String

Passenger last name

routes[].passengers[].birthday

Array

Passenger birthday

routes[].passengers[].documentNumber

String

Passenger document number

routes[].passengers[].documentType

String

Passenger document type

routes[].passengers[].citizenship

String

Passenger citizenship

routes[].passengers[].documentExpireDate

Array

Passenger document expire date

routes[].passengers[].paxType

Object

Passenger type

routes[].passengers[].paxType.type

String

Passenger type

routes[].passengers[].paxType.seatIncluded

Boolean

Is seat included

routes[].passengers[].paxType.unn

Boolean

Is UNN

routes[].passengers[].farePrice

Number

Fare price

routes[].passengers[].price

Number

Price

routes[].passengers[].taxxPrice

Number

Tax price

routes[].passengers[].currencyTaxxPrice.base

Object

Tax price base

routes[].passengers[].currencyTaxxPrice.base.currency

String

Tax price base currency

routes[].passengers[].currencyTaxxPrice.base.value

Number

Tax price base value

routes[].passengers[].currencyTaxxPrice.display.currency

String

Tax price display currency

routes[].passengers[].currencyTaxxPrice.display.value

Number

Tax price display value

routes[].passengers[].taxCharge

Number

Tax charge

routes[].passengers[].currencyTaxCharge.base

Object

Tax charge base

routes[].passengers[].currencyTaxCharge.base.currency

String

Tax charge base currency

routes[].passengers[].currencyTaxCharge.base.value

Number

Tax charge base value

routes[].passengers[].currencyTaxCharge.display.currency

String

Tax charge display currency

routes[].passengers[].currencyTaxCharge.display.value

Number

Tax charge display value

routes[].totalFarePrice

Number

Total fare price

routes[].totalCurrencyFarePrice.base.currency

String

Fare price currency

routes[].totalCurrencyFarePrice.base.value

Number

Fare price base value

routes[].totalCurrencyFarePrice.display.currency

String

Fare price display currency

routes[].totalCurrencyFarePrice.display.value

Number

Fare price display value

routes[].totalTaxPrice

Number

Total fare price

routes[].totalCurrencyTaxPrice.base.currency

String

Tax price currency

routes[].totalCurrencyTaxPrice.base.value

Number

Tax price base value

routes[].totalCurrencyTaxPrice.display.currency

String

Tax price display currency

routes[].totalCurrencyTaxPrice.display.value

Number

Tax price display value

routes[].totalFeePrice

Number

Total fee price

routes[].totalCurrencyFeePrice.base.currency

String

Fee price currency

routes[].totalCurrencyFeePrice.base.value

Number

Fee price base value

routes[].totalCurrencyFeePrice.display.currency

String

Fee price display currency

routes[].totalCurrencyFeePrice.display.value

Number

Fee price display value

routes[].totalFareCharge

Number

Total fare charge

routes[].totalCurrencyFareCharge.base.currency

String

Fare price base currency

routes[].totalCurrencyFareCharge.base.value

Number

Fare charge base value

routes[].totalCurrencyFareCharge.display.currency

String

Fare price display currency

routes[].totalCurrencyFareCharge.display.value

Number

Fare charge display value

routes[].route

Object

Route

routes[].route.legs

Array

List of route legs

routes[].route.legs[].flightId

String

Flight ID (UUID)

routes[].route.legs[].flightNumber

String

Flight number

routes[].route.legs[].origin

Object

Origin airport

routes[].route.legs[].origin.city

String

City code

routes[].route.legs[].origin.cityName

String

City name

routes[].route.legs[].origin.airportCode

String

Airport code

routes[].route.legs[].origin.airportName

String

Airport name

routes[].route.legs[].departureDateTime

Array

Departure date and time

routes[].route.legs[].destination

Object

Destination airport

routes[].route.legs[].destination.city

String

City code

routes[].route.legs[].destination.cityName

String

City name

routes[].route.legs[].destination.airportCode

String

Airport code

routes[].route.legs[].destination.airportName

String

Airport name

routes[].route.legs[].arrivalDateTime

Array

Arrival date and time

routes[].route.legs[].duration

Number

Flight duration in seconds

routes[].route.legs[].aircraft

String

Aircraft name

routes[].route.legs[].alternativeFlight

Boolean

Is this alternative flight

routes[].route.legs[].departureDate

Array

Departure date

routes[].route.legs[].arrivalDate

Array

Arrival date

routes[].route.legs[].departureTime

String

Departure time

routes[].route.legs[].arrivalTime

String

Arrival time

routes[].route.legs[].arriveDateOffset

Number

Number of days between departure and arrival

routes[].route.stops

Array

List of stops

routes[].route.stops[].airport

Object

Stop airport

routes[].route.stops[].airport.city

String

City code

routes[].route.stops[].airport.cityName

String

City name

routes[].route.stops[].airport.airportCode

String

Airport code

routes[].route.stops[].airport.airportName

String

Airport name

routes[].route.stops[].airportCode

String

Airport code

routes[].route.stops[].duration

Number

Stop duration in seconds

routes[].route.totalDuration

Number

Total route duration in seconds

routes[].fare

Object

Fare

routes[].fare.fareFrameId

String

Fare frame ID (UUID)

routes[].fare.fareId

String

Fare ID (UUID)

routes[].fare.name

String

Fare name

routes[].fare.cabinClass

String

Cabin class

routes[].fare.managingRules

Array

List of managing rules

routes[].fare.managingRules[].name

String

Rule name

routes[].fare.managingRules[].penalty

Object

Penalty amount

routes[].fare.managingRules[].penalty.value

Number

Penalty value

routes[].fare.managingRules[].penalty.type

String

Penalty type

routes[].fare.managingRules[].timeBeforeDeparture

Number

Time before departure

routes[].fare.baggageRules

Array

List of baggage rules

routes[].fare.baggageRules[].quantity

Number

Baggage quantity

routes[].fare.baggageRules[].type

String

Baggage type

routes[].fare.baggageRules[].weight

Number

Baggage weight

routes[].fare.price

Number

Fare price

Execute booking exchange

Endpoint for executing booking exchange.

HTTP Request
POST /v1/agency-api/bookings/00000000-0000-0000-0000-000000000000/exchange HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json;charset=UTF-8
Content-Length: 185

{
  "oldPaxSegmentIds" : [ "d6027ee2-3f4d-4480-977b-b74c46734c02", "37289b1a-e96c-48bc-8c78-75666e025b7a" ],
  "newRouteId" : "215b29c8-44a0-4a59-8340-18131d15b938",
  "agentFee" : 10
}
Table 33. Path params
Parameter Description

bookingId

Booking id (UUID)

Table 34. Booking Exchange request fields
Path Type Description

oldPaxSegmentIds

Array

List of pax segments to exchange

newRouteId

String

Route ID to exchange

agentFee

Number

Agent fee amount

The response contains new booking ID and newly created order ID.

HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 112

{
  "bookingId" : "00000000-0000-0000-0000-000000000000",
  "orderId" : "cc383b7e-aeac-494c-b616-56ab812af93e"
}
Table 35. Booking Exchange response fields
Path Type Description

bookingId

String

New booking ID

orderId

String

New order ID to pay

Get booking exchange preview

Endpoint for getting booking exchange preview.

HTTP Request
POST /v1/agency-api/bookings/00000000-0000-0000-0000-000000000000/exchange/preview HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json;charset=UTF-8
X-Currency: USD
Content-Length: 185

{
  "oldPaxSegmentIds" : [ "eacb1135-bba2-48e4-947a-69a09665f15d", "f9f36ffa-86cc-47a1-9c74-f6f00172f1d1" ],
  "newRouteId" : "6ec49a61-45da-4d0e-9102-b32ed12c9b76",
  "agentFee" : 10
}
Table 36. Path params
Parameter Description

bookingId

Booking id (UUID)

Table 37. Booking Exchange Preview request fields
Path Type Description

oldPaxSegmentIds

Array

List of pax segments to exchange

newRouteId

String

Route ID to exchange

agentFee

Number

Agent fee amount

The response contains booking exchange preview data.

HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 7027

{
  "data" : {
    "passengers" : [ {
      "passengerId" : "d04649f6-b896-4b43-a643-371ea99a2d37",
      "paxSegments" : [ {
        "paxSegmentId" : "3749e8ed-db90-4fde-932e-79734010a9a5",
        "offers" : [ {
          "offerId" : "366bea39-f76f-41d0-99f8-4ba54a6a2285",
          "price" : 10,
          "currencyPrice" : {
            "base" : {
              "currency" : "USD",
              "value" : 10
            },
            "display" : {
              "currency" : "KZT",
              "value" : 4800
            }
          },
          "debit" : 10,
          "currencyDebit" : {
            "base" : {
              "currency" : "USD",
              "value" : 10
            },
            "display" : {
              "currency" : "KZT",
              "value" : 4800
            }
          },
          "quantity" : 1,
          "ancillaries" : [ ],
          "active" : true,
          "area" : "B2B"
        } ],
        "offerPrices" : [ {
          "offerId" : "366bea39-f76f-41d0-99f8-4ba54a6a2285",
          "quantity" : 1
        } ]
      } ],
      "firstName" : "John",
      "lastName" : "Doe",
      "birthday" : [ 1995, 6, 5 ],
      "documentNumber" : "123456",
      "documentType" : "PASSPORT",
      "citizenship" : "KZ",
      "documentExpireDate" : [ 2035, 6, 5 ],
      "paxType" : {
        "type" : "ADT",
        "unn" : false,
        "discount" : null,
        "seatIncluded" : true
      },
      "farePrice" : 1,
      "price" : 1000,
      "taxPrice" : 0,
      "currencyTaxPrice" : {
        "base" : {
          "currency" : "USD",
          "value" : 0
        },
        "display" : {
          "currency" : "KZT",
          "value" : 0
        }
      },
      "taxCharge" : 0,
      "currencyTaxCharge" : {
        "base" : {
          "currency" : "USD",
          "value" : 0
        },
        "display" : {
          "currency" : "KZT",
          "value" : 0
        }
      },
      "taxxPrice" : 0,
      "currencyTaxxPrice" : {
        "base" : {
          "currency" : "USD",
          "value" : 0
        },
        "display" : {
          "currency" : "KZT",
          "value" : 0
        }
      },
      "totalCharge" : 10,
      "totalCurrencyCharge" : {
        "base" : {
          "currency" : "USD",
          "value" : 10
        },
        "display" : {
          "currency" : "KZT",
          "value" : 4800
        }
      },
      "fareCharge" : 1,
      "fareCurrencyCharge" : {
        "base" : {
          "currency" : "USD",
          "value" : 1
        },
        "display" : {
          "currency" : "KZT",
          "value" : 480
        }
      },
      "totalFee" : 10,
      "totalCurrencyFee" : {
        "base" : {
          "currency" : "USD",
          "value" : 10
        },
        "display" : {
          "currency" : "KZT",
          "value" : 4800
        }
      }
    } ],
    "route" : {
      "legs" : [ {
        "flightId" : "6fd83237-b541-4b28-8284-4689fab28054",
        "flightNumber" : "KC123",
        "origin" : {
          "city" : "ALA",
          "cityName" : "Almaty",
          "airportCode" : "ALA",
          "airportName" : "Almaty International Airport"
        },
        "departureDateTime" : [ 2025, 6, 5, 10, 0 ],
        "destination" : {
          "city" : "JFK",
          "cityName" : "New York",
          "airportCode" : "JFK",
          "airportName" : "John F. Kennedy International Airport"
        },
        "arrivalDateTime" : [ 2025, 6, 5, 20, 0 ],
        "duration" : 36000,
        "aircraft" : "Boeing 737",
        "alternativeFlight" : true,
        "departureDate" : [ 2025, 6, 5 ],
        "arrivalDate" : [ 2025, 6, 5 ],
        "departureTime" : "10:00",
        "arrivalTime" : "20:00",
        "arriveDateOffset" : 0
      } ],
      "stops" : [ {
        "airport" : {
          "city" : "TSE",
          "cityName" : "Astana",
          "airportCode" : "TSE",
          "airportName" : "Astana International Airport"
        },
        "airportCode" : "TSE",
        "duration" : 3600
      } ],
      "totalDuration" : 20
    },
    "fare" : {
      "fareId" : "322116af-b906-4155-b53d-8360fbc791a2",
      "fareFrameId" : "6fa0fc4c-89a3-43e7-8c4e-21a32d9c857a",
      "name" : "Cheapest fare",
      "cabinClass" : "FIRST",
      "managingRules" : [ {
        "name" : "REFUND_BEFORE_DEPARTURE",
        "penalty" : {
          "type" : "PERCENT",
          "value" : 10
        },
        "timeBeforeDeparture" : 30
      } ],
      "baggageRules" : [ {
        "quantity" : 1,
        "type" : "CABIN_BAGGAGE",
        "weight" : 23
      } ],
      "price" : 1000
    },
    "legs" : [ {
      "flightId" : "6fd83237-b541-4b28-8284-4689fab28054",
      "flightNumber" : "KC123",
      "origin" : {
        "city" : "ALA",
        "cityName" : "Almaty",
        "airportCode" : "ALA",
        "airportName" : "Almaty International Airport"
      },
      "departureDateTime" : [ 2025, 6, 5, 10, 0 ],
      "destination" : {
        "city" : "JFK",
        "cityName" : "New York",
        "airportCode" : "JFK",
        "airportName" : "John F. Kennedy International Airport"
      },
      "arrivalDateTime" : [ 2025, 6, 5, 20, 0 ],
      "duration" : 36000,
      "aircraft" : "Boeing 737",
      "alternativeFlight" : true,
      "departureDate" : [ 2025, 6, 5 ],
      "arrivalDate" : [ 2025, 6, 5 ],
      "departureTime" : "10:00",
      "arrivalTime" : "20:00",
      "arriveDateOffset" : 0
    } ],
    "stops" : [ {
      "airport" : {
        "city" : "TSE",
        "cityName" : "Astana",
        "airportCode" : "TSE",
        "airportName" : "Astana International Airport"
      },
      "airportCode" : "TSE",
      "duration" : 3600
    } ],
    "totalDuration" : 20,
    "totalCharge" : 10,
    "totalCurrencyCharge" : {
      "base" : {
        "currency" : "USD",
        "value" : 10
      },
      "display" : {
        "currency" : "KZT",
        "value" : 4800
      }
    },
    "totalPrice" : 0,
    "totalCurrencyPrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 0
      },
      "display" : {
        "currency" : "KZT",
        "value" : 0
      }
    },
    "totalFarePrice" : 0,
    "totalCurrencyFarePrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 0
      },
      "display" : {
        "currency" : "KZT",
        "value" : 0
      }
    },
    "totalTaxPrice" : 0,
    "totalCurrencyTaxPrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 0
      },
      "display" : {
        "currency" : "KZT",
        "value" : 0
      }
    },
    "totalFeePrice" : 0,
    "totalCurrencyFeePrice" : {
      "base" : {
        "currency" : "USD",
        "value" : 0
      },
      "display" : {
        "currency" : "KZT",
        "value" : 0
      }
    },
    "totalFareCharge" : 0,
    "totalCurrencyFareCharge" : {
      "base" : {
        "currency" : "USD",
        "value" : 0
      },
      "display" : {
        "currency" : "KZT",
        "value" : 0
      }
    }
  }
}
Table 38. Booking Exchange preview response fields
Path Type Description

data

Object

Exchange preview

data.totalCharge

Number

Total charge

data.totalCurrencyCharge

Object

Total currency charge

data.totalCurrencyCharge.base

Object

Base currency charge

data.totalCurrencyCharge.base.currency

String

Currency code

data.totalCurrencyCharge.base.value

Number

Currency value

data.totalCurrencyCharge.display

Object

Display currency charge

data.totalCurrencyCharge.display.currency

String

Currency code

data.totalCurrencyCharge.display.value

Number

Currency value

data.totalPrice

Number

Total currency price

data.totalCurrencyPrice

Object

Currency value price

data.totalCurrencyPrice.base

Object

Base currency price

data.totalCurrencyPrice.base.currency

String

Currency code

data.totalCurrencyPrice.base.value

Number

Currency value

data.totalCurrencyPrice.display

Object

Display currency price

data.totalCurrencyPrice.display.currency

String

Currency code

data.totalCurrencyPrice.display.value

Number

Currency value

data.passengers

Array

List of passengers

data.passengers[].passengerId

String

Passenger ID (UUID)

data.passengers[].paxSegments

Array

List of passenger segments

data.passengers[].paxSegments[].paxSegmentId

String

Passenger segment ID (UUID)

data.passengers[].paxSegments[].offers

Array

List of offers

data.passengers[].paxSegments[].offers[].offerId

String

Offer ID (UUID)

data.passengers[].paxSegments[].offers[].area

String

Offer area

data.passengers[].paxSegments[].offers[].price

Number

Offer price

data.passengers[].paxSegments[].offers[].currencyPrice

Object

Offer currency price

data.passengers[].paxSegments[].offers[].currencyPrice.base

Object

Offer base currency price

data.passengers[].paxSegments[].offers[].currencyPrice.base.currency

String

Offer base currency price currency code

data.passengers[].paxSegments[].offers[].currencyPrice.base.value

Number

Offer base currency price value

data.passengers[].paxSegments[].offers[].currencyPrice.display

Object

Offer display currency price

data.passengers[].paxSegments[].offers[].currencyPrice.display.currency

String

Offer display currency price currency code

data.passengers[].paxSegments[].offers[].currencyPrice.display.value

Number

Offer display currency price value

data.passengers[].paxSegments[].offers[].ancillaries

Array

List of ancillaries

data.passengers[].paxSegments[].offers[].quantity

Number

Offer quantity

data.passengers[].paxSegments[].offers[].active

Boolean

Is offer available

data.passengers[].totalCharge

Number

Total charge

data.passengers[].totalCurrencyCharge

Object

Total currency charge

data.passengers[].totalCurrencyCharge.base

Object

Base currency charge

data.passengers[].totalCurrencyCharge.base.currency

String

Currency code

data.passengers[].totalCurrencyCharge.base.value

Number

Currency value

data.passengers[].totalCurrencyCharge.display

Object

Display currency charge

data.passengers[].totalCurrencyCharge.display.currency

String

Currency code

data.passengers[].totalCurrencyCharge.display.value

Number

Currency value

data.passengers[].fareCharge

Number

Fare charge

data.passengers[].fareCurrencyCharge

Object

Fare currency charge

data.passengers[].fareCurrencyCharge.base

Object

Base currency charge

data.passengers[].fareCurrencyCharge.base.currency

String

Currency code

data.passengers[].fareCurrencyCharge.base.value

Number

Currency value

data.passengers[].fareCurrencyCharge.display

Object

Display currency charge

data.passengers[].fareCurrencyCharge.display.currency

String

Currency code

data.passengers[].fareCurrencyCharge.display.value

Number

Currency value

data.passengers[].totalFee

Number

Total fee

data.passengers[].totalCurrencyFee

Object

Total currency fee

data.passengers[].totalCurrencyFee.base

Object

Base currency fee

data.passengers[].totalCurrencyFee.base.currency

String

Currency code

data.passengers[].totalCurrencyFee.base.value

Number

Currency value

data.passengers[].totalCurrencyFee.display

Object

Display currency fee

data.passengers[].totalCurrencyFee.display.currency

String

Currency code

data.passengers[].totalCurrencyFee.display.value

Number

Currency value

data.passengers[].firstName

String

Passenger first name

data.passengers[].lastName

String

Passenger last name

data.passengers[].birthday

Array

Passenger birthday

data.passengers[].documentNumber

String

Passenger document number

data.passengers[].documentType

String

Passenger document type

data.passengers[].citizenship

String

Passenger citizenship

data.passengers[].documentExpireDate

Array

Passenger document expire date

data.passengers[].paxType

Object

Passenger type

data.passengers[].paxType.type

String

Passenger type

data.passengers[].paxType.seatIncluded

Boolean

Is seat included

data.passengers[].paxType.unn

Boolean

Is UNN

data.passengers[].farePrice

Number

Fare price

data.passengers[].price

Number

Price

data.passengers[].taxxPrice

Number

Tax Price

data.passengers[].currencyTaxxPrice.base.currency

String

Tax price currency

data.passengers[].currencyTaxxPrice.base.value

Number

Tax price base value

data.passengers[].currencyTaxxPrice.display.currency

String

Tax price display currency

data.passengers[].currencyTaxxPrice.display.value

Number

Tax price display value

data.passengers[].taxCharge

Number

Tax Charge

data.passengers[].currencyTaxCharge.base.currency

String

Tax charge currency

data.passengers[].currencyTaxCharge.base.value

Number

Tax charge base value

data.passengers[].currencyTaxCharge.display.currency

String

Tax charge display currency

data.passengers[].currencyTaxCharge.display.value

Number

Tax charge display value

data.passengers[].farePrice

Number

Fare Price

data.totalFarePrice

Number

Total fare price

data.totalCurrencyFarePrice.base.currency

String

Fare price currency

data.totalCurrencyFarePrice.base.value

Number

Fare price base value

data.totalCurrencyFarePrice.display.currency

String

Fare price display currency

data.totalCurrencyFarePrice.display.value

Number

Fare price display value

data.totalTaxPrice

Number

Total fare price

data.totalCurrencyTaxPrice.base.currency

String

Tax price currency

data.totalCurrencyTaxPrice.base.value

Number

Tax price base value

data.totalCurrencyTaxPrice.display.currency

String

Tax price display currency

data.totalCurrencyTaxPrice.display.value

Number

Tax price display value

data.totalFeePrice

Number

Total fare price

data.totalCurrencyFeePrice.base.currency

String

Fee price currency

data.totalCurrencyFeePrice.base.value

Number

Fee price base value

data.totalCurrencyFeePrice.display.currency

String

Fee price display currency

data.totalCurrencyFeePrice.display.value

Number

Fee price display value

data.totalFareCharge

Number

Total fare charge

data.totalCurrencyFareCharge.base.currency

String

Fare price base currency

data.totalCurrencyFareCharge.base.value

Number

Fare charge base value

data.totalCurrencyFareCharge.display.currency

String

Fare price display currency

data.totalCurrencyFareCharge.display.value

Number

Fare charge display value

data.route

Object

Route

data.route.legs

Array

List of route legs

data.route.legs[].flightId

String

Flight ID (UUID)

data.route.legs[].flightNumber

String

Flight number

data.route.legs[].origin

Object

Origin airport

data.route.legs[].origin.city

String

City code

data.route.legs[].origin.cityName

String

City name

data.route.legs[].origin.airportCode

String

Airport code

data.route.legs[].origin.airportName

String

Airport name

data.route.legs[].departureDateTime

Array

Departure date and time

data.route.legs[].destination

Object

Destination airport

data.route.legs[].destination.city

String

City code

data.route.legs[].destination.cityName

String

City name

data.route.legs[].destination.airportCode

String

Airport code

data.route.legs[].destination.airportName

String

Airport name

data.route.legs[].arrivalDateTime

Array

Arrival date and time

data.route.legs[].duration

Number

Flight duration in seconds

data.route.legs[].aircraft

String

Aircraft name

data.route.legs[].alternativeFlight

Boolean

Is this alternative flight

data.route.legs[].departureDate

Array

Departure date

data.route.legs[].arrivalDate

Array

Arrival date

data.route.legs[].departureTime

String

Departure time

data.route.legs[].arrivalTime

String

Arrival time

data.route.legs[].arriveDateOffset

Number

Number of days between departure and arrival

data.route.stops

Array

List of stops

data.route.stops[].airport

Object

Stop airport

data.route.stops[].airport.city

String

City code

data.route.stops[].airport.cityName

String

City name

data.route.stops[].airport.airportCode

String

Airport code

data.route.stops[].airport.airportName

String

Airport name

data.route.stops[].airportCode

String

Airport code

data.route.stops[].duration

Number

Stop duration in seconds

data.route.totalDuration

Number

Total route duration in seconds

data.fare

Object

Fare

data.fare.fareFrameId

String

Fare frame ID (UUID)

data.fare.fareId

String

Fare ID (UUID)

data.fare.name

String

Fare name

data.fare.cabinClass

String

Cabin class

data.fare.managingRules

Array

List of managing rules

data.fare.managingRules[].name

String

Rule name

data.fare.managingRules[].penalty

Object

Penalty amount

data.fare.managingRules[].penalty.value

Number

Penalty value

data.fare.managingRules[].penalty.type

String

Penalty type

data.fare.managingRules[].timeBeforeDeparture

Number

Time before departure

data.fare.baggageRules

Array

List of baggage rules

data.fare.baggageRules[].quantity

Number

Baggage quantity

data.fare.baggageRules[].type

String

Baggage type

data.fare.baggageRules[].weight

Number

Baggage weight

data.fare.price

Number

Fare price

Get exchange calendar by specified filter

Endpoint for getting exchange calendar by specified filter.

HTTP Request
GET /v1/agency-api/bookings/00000000-0000-0000-0000-000000000000/exchange/calendar?origin=ALA&destination=TSE&outboundDateFrom=2025-06-05&outboundDateTo=2025-06-10&oldRouteId=d83621ac-71c7-4720-ac9c-06238a984d52&legCount=1&fareFrameId=dc6e07df-6791-4775-833c-7ff06d80a82d HTTP/1.1
Accept: application/json;charset=UTF-8
Table 39. Path params
Parameter Description

bookingId

Booking id (UUID)

Booking Exchange calendar request fields
GET /v1/agency-api/bookings/00000000-0000-0000-0000-000000000000/exchange/calendar?origin=ALA&destination=TSE&outboundDateFrom=2025-06-05&outboundDateTo=2025-06-10&oldRouteId=d83621ac-71c7-4720-ac9c-06238a984d52&legCount=1&fareFrameId=dc6e07df-6791-4775-833c-7ff06d80a82d HTTP/1.1
Accept: application/json;charset=UTF-8

The response flight dates for specified request.

HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 60

{
  "dates" : [ "2022-01-01", "2022-01-02", "2022-01-03" ]
}
Table 40. Booking Exchange calendar response fields
Path Type Description

dates

Array

List of dates satisfying the conditions on which you can change the flight

Service Payload

Each service has additional parameters, which depend on the category of the service.

Table 41. Service Payload Description

Service Category

Payload Path

Type

Description

BAGGAGE

payload.type

String

Type of baggage: Cabin or Check-in

BAGGAGE

payload.weight

Short

Baggage weight

Errors code

Agency API uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc). Codes in the 5xx range indicate an error with Agency API’s servers (these are rare).

Some 4xx errors that could be handled programmatically (e.g., a card is declined) include an error code that briefly explains the error reported.

Table 42. HTTP Status code summary

HTTP Code

Description

200, 201, 202 - OK

Everything worked as expected.

304 - Not Modified

The request redirection response code indicates that there is no need to retransmit the requested resources. It is an implicit redirection to a cached resource.

400 - Bad Request

The request was unacceptable, often due to missing a required parameter.

401 - Unauthorized

No valid API key provided.

403 - Forbidden

Forbidden. The API key doesn’t have permissions to perform the request.

404 - Not Found

The requested resource doesn’t exist.

500, 502, 503, 504 - Server Errors

Something went wrong on Agency API’s end. (These are rare.)