Skip to main content

Search Flight

Search for available flights based on origin, destination, travel dates, and passenger information. This is the primary endpoint for finding flight options before booking.


Endpoint

  • URL: /api/v1/flight/search
  • Method: POST
  • Auth Required: Yes (Bearer Token/X-API-KEY)
  • Content-Type: application/json

Authentication

This endpoint requires a valid JWT Bearer token in the Authorization header:

Authorization: Bearer <access_token>

Obtain tokens via /api/v1/sign-in (POST) with your credentials.


Request Structure

FieldTypeRequiredDescription
systemstringYesAirline system code
adtintegerYesNumber of adult passengers
chdintegerNoNumber of child passengers
infintegerNoNumber of infant passengers
flightsarrayYesList of flight segments (see FlightRequest)
specialTypestringNoSpecial passenger type (STU, YTH, SEA, ...)
promoCodestringNoAirline discount/coupon code
airlinesarrayNoList of preferred airline codes (2-letter IATA codes)
pricingTypeintegerNoPricing type preference: 0 - All, 1 - GDS, 2 - NDC
combinebooleanNoCombine multi-segment tickets (applies to VN)

FlightRequest Object

FieldTypeRequiredDescription
legintegerYesFlight segment sequence number
startPointstringYesDeparture airport code (3-letter IATA)
endPointstringYesArrival airport code (3-letter IATA)
departDateDateOnlyYesDeparture date (YYYY-MM-DD format)

Example Request:

{
"system": "VN",
"adt": 1,
"chd": 0,
"inf": 0,
"flights": [
{
"leg": 1,
"startPoint": "SGN",
"endPoint": "HAN",
"departDate": "2024-06-02"
}
],
"specialType": null,
"promoCode": null,
"airlines": ["VN"],
"pricingType": 0,
"combine": false
}

Request Constraints & Business Rules

  • At least one adult passenger (adt >= 1) is required.
  • Child passengers must be accompanied by adults.
  • Infant passengers count cannot exceed adult passenger count.
  • departDate must be in the future.
  • Airport codes must be valid 3-letter IATA codes.
  • Special types have specific eligibility requirements:
    • STU: Student
    • SEA: Seaman
    • LAB: Labor
    • VG2/VG4/VG6/VG8: Groups are specific for Vietnam Airlines
  • Multi-city searches can include up to 6 segments.

Response Structure

Returns an array of TripOtaFlightSearchResponse objects:

FieldTypeNullableDescription
systemstringYesSystem name (e.g., VN, VJ, 1A)
statusbooleanNotrue if successful, false if failed
errorobjectYesError details (if any)
descriptionstringYesError description (if any)
trackingIdstringYesTracking ID for request logs
trackingTimestringYesTime for request tracking (ISO 8601 format)
fareDatasarrayYesList of available flight options (see FareData)

FareData Object

FieldTypeNullableDescription
fareDataIdintegerNoUnique identifier for this fare option
itineraryintegerNoItinerary sequence number
currencystringYesCurrency code (e.g., VND, USD)
systemstringYesBooking system code
adtintegerNoNumber of adults
chdintegerNoNumber of children
infintegerNoNumber of infants
fareAdtnumberNoBase fare per adult
fareChdnumberNoBase fare per child
fareInfnumberNoBase fare per infant
taxAdtnumberNoTaxes and fees per adult
taxChdnumberNoTaxes and fees per child
taxInfnumberNoTaxes and fees per infant
priceAdtnumberNoTotal price per adult (base fare + taxes)
priceChdnumberNoTotal price per child (base fare + taxes)
priceInfnumberNoTotal price per infant (base fare + taxes)
totalFarenumberNoTotal base fare for all passengers
totalTaxnumberNoTotal taxes and fees for all passengers
totalPricenumberNoTotal amount for all passengers
pricingTypeintegerYesPricing type: 0 - All, 1 - GDS, 2 - NDC
isDomesticbooleanNoWhether this is a domestic flight
optionsarrayYesList of flight options (see Option)

Option Object

FieldTypeNullableDescription
optionIdintegerNoUnique identifier for this fare option
flightsarrayYesList of flight (see Option)

Flight Object

FieldTypeNullableDescription
legintegerNoLeg index: 0 - Outbound, 1 - Return
startPointstringYesDeparture airport code (IATA)
endPointstringYesArrival airport code (IATA)
startPointUtcOffsetTimeSpanYesUTC offset of departure location
endPointUtcOffsetTimeSpanYesUTC offset of arrival location
startDatedatetimeYesDeparture date and time (ISO 8601 format, e.g., 2025-12-20T18:55:00)
endDatedatetimeYesArrival date and time (ISO 8601 format, e.g., 2025-12-20T21:00:00)
durationintegerNoTotal flight duration (in minutes, read-only)
flightValuestringYesEncoded flight value for use in related functions
stopNumintegerNoNumber of stops (read-only)
noRefundbooleanNotrue if the fare is non-refundable
promobooleanNotrue if this is a promotional fare
timeLimitdatetimeYesTime limit to issue ticket
segmentsarrayYesList of segments making up the flight (see Segment below)

Segment Object

FieldTypeNullableDescription
idintegerNoUnique identifier for the segment
startPointstringYesDeparture airport code (IATA)
endPointstringYesArrival airport code (IATA)
startPointUtcOffsetTimeSpanYesUTC offset at departure
endPointUtcOffsetTimeSpanYesUTC offset at arrival
startDatedatetimeYesDeparture time (ISO 8601 format, e.g., 2025-12-20T18:55:00)
endDatedatetimeYesArrival time (ISO 8601 format, e.g., 2025-12-20T21:00:00)
startTerminalstringYesDeparture terminal
endTerminalstringYesArrival terminal
flightNumberstringYesFlight number
planestringYesAircraft code/model
statusstringYesBooking status
fareClassstringYesBooking class (e.g., Y, M, B, etc.)
fareBasisstringYesFare basis code
durationintegerNoSegment duration (minutes, read-only)
cabinCodestringYesCabin code (Y - Economy, C - Business, F - First, etc.)
hasStopbooleanNoIf the flight has technical or planned stop
handBaggagestringYesCabin baggage allowance
freeBaggagestringYesChecked baggage allowance
stopPointstringYesStop airport code (if any)
stopTimenumberYesDuration of stop (minutes)
stopOvernightbooleanNoIndicates if overnight stop exists
changeStationbooleanNoIndicates change of train/station
changeAirportbooleanNoIndicates change of airport
marketingCarrierstringYesMarketing carrier (IATA code)
operatingCarrierstringYesOperating carrier (IATA code)
dayChangebooleanNoIndicates if arrival is on different day than departure
marriageGrpbooleanYesMarriage group status
flightsMilesintegerYesDistance in miles
technicalStopstringYesCode/location for technical stop (if any)

Example Response:

[
{
"system": "string",
"status": true,
"error": {
"id": 0,
"message": "string"
},
"description": "string",
"trackingId": "string",
"timeTracking": "2025-08-25T08:18:53.001Z",
"fareDatas": [
{
"fareDataId": 0,
"itinerary": 0,
"currency": "string",
"adt": 0,
"chd": 0,
"inf": 0,
"fareAdt": 0,
"fareChd": 0,
"fareInf": 0,
"taxAdt": 0,
"taxChd": 0,
"taxInf": 0,
"priceAdt": 0,
"priceChd": 0,
"priceInf": 0,
"totalFare": 0,
"totalTax": 0,
"totalPrice": 0,
"pricingType": 0,
"isDomestic": true,
"options": [
{
"optionId": 0,
"flights": [
{
"leg": 0,
"startPoint": "string",
"endPoint": "string",
"startPointUtcOffset": {},
"endPointUtcOffset": {},
"startDate": "2025-08-25T08:18:00",
"endDate": "2025-08-25T10:18:00",
"duration": 0,
"flightValue": "string",
"stopNum": 0,
"noRefund": true,
"promo": true,
"timeLimit": "2025-08-25T08:18:53.001Z",
"segments": [
{
"id": 0,
"id": 0,
"startPoint": "string",
"endPoint": "string",
"startPointUtcOffset": {},
"endPointUtcOffset": {},
"startDate": "2025-08-25T08:18:00",
"endDate": "2025-08-25T10:18:00",
"startTerminal": "string",
"endTerminal": "string",
"flightNumber": "string",
"plane": "string",
"status": "string",
"fareClass": "string",
"fareBasis": "string",
"duration": 0,
"cabinCode": "string",
"hasStop": true,
"handBaggage": "string",
"freeBaggage": "string",
"stopPoint": "string",
"stopTime": 0.0,
"stopOvernight": true,
"changeStation": true,
"changeAirport": true,
"marketingCarrier": "string",
"operatingCarrier": "string",
"dayChange": true,
"marriageGrp": true,
"flightsMiles": 0,
"technicalStop": "string"
}
],
"timeLimit": "2025-08-25T08:18:53.001Z"
}
]
}
]
}
]
}
]

Error Codes

See Error Codes for details on possible error responses.


Security & Validation

  • All input is validated for type and required fields.
  • Only authenticated users can access this endpoint.
  • Airport codes are validated against IATA standards.
  • Date validation ensures future travel dates only and less than 365 from current.
  • Passenger count validation ensures logical combinations.

Validation Questions

  • What is the maximum number of passengers allowed per search?
  • Are there restrictions on how far in advance flights can be searched?
  • How are connecting flights handled in multi-city searches?
  • What special types are available for each airline system?

For integration support, see Contact Support.