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 - Student, YTH - Youth, LBR - Labor, SEA - Seaman, VFR - Family, EMI - Emigrant, VG2/4/6/8 - Group)
promoCodestringNoAirline discount/coupon code
airlinesarrayNoList of preferred airline codes (2-letter IATA codes)
pricingTypeintegerNoPricing type preference: 0 - All, 1 - NDC, 2 - ETK
combinebooleanNoCombine multi-segment tickets (applies to VN)
accountCodesarrayNoCorporate account codes (see AccountCodeRequest below)
issueDateDateOnlyNoTicket issue date used for pricing rules when applicable (YYYY-MM-DD, applies to VN)

FlightRequest Object

FieldTypeRequiredDescription
legintegerNoFlight segment sequence number
startPointstringYesDeparture airport code (3-letter IATA)
endPointstringYesArrival airport code (3-letter IATA)
departDateDateOnlyYesDeparture date (YYYY-MM-DD format)
preferCabinstringNoCabin class: Y - Economy, F - First, C - Business, W - Premium Economy, M - Non-premium Economy

AccountCodeRequest Object

FieldTypeRequiredDescription
airlinestringNoAirline code (IATA 2-letter)
accountCodestringNoCorporate account code

Sample Request:

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

Request Constraints & Business Rules

  • At least one adult passenger (adt >= 1) is required.
  • Child/Infant passengers must be accompanied by adults.
  • Infant passengers count cannot exceed adult passenger count.
  • departDate must not be in the past.
  • departDate must not be more than 365 days from the current date.
  • Total adult and child passengers must not exceed 9: adt + chd <= 9 (chd is also referred to as CNN in some airline flows).
  • For round-trip searches, the return departDate must be greater than the outbound departDate, and the outbound departDate must be greater than or equal to the current date.
  • Airport codes must be valid 3-letter IATA codes.
  • Special types have specific eligibility requirements:
    • STU: Student studying abroad
    • YTH: Student or youth
    • LBR: Labor passenger
    • SEA: Seaman
    • VFR: Visiting friends or relatives
    • EMI: Emigrant
    • VG2/VG4/VG6/VG8: Group passenger type 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)
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
discountAdtnumberNoTotal discount for adult passengers (ADT)
discountChdnumberNoTotal discount for child passengers (CHD)
discountInfnumberNoTotal discount for infant passengers (INF)
specialTypestringYesSpecial passenger type code (if any)
pricingTypeintegerYesPricing type: 0 - All, 1 - GDS, 2 - NDC
isDomesticbooleanNoWhether this is a domestic flight
isSelectionbooleanYesLatest fare data flag from airline
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)
endDatedatetimeYesArrival date and time (ISO 8601 format)
durationintegerNoTotal flight duration (in minutes, read-only)
flightValuestringYesEncoded flight value for use in related functions
flightIdintegerNoFlight sequence number (assigned automatically)
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)
endDatedatetimeYesArrival time (ISO 8601 format)
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)
seatAvlintegerNoNumber of seats available for booking
dayChangebooleanNoIndicates if arrival is on different day than departure
marriageGrpbooleanYesMarriage group status
flightsMilesintegerYesDistance in miles
technicalStopstringYesCode/location for technical stop (if any)

Sample Response:

[
{
"system": "string",
"status": true,
"error": {
"id": "string",
"message": "string"
},
"description": "string",
"trackingId": "string",
"trackingTime": "2026-06-03T09:00:11.785Z",
"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,
"discountAdt": 0,
"discountChd": 0,
"discountInf": 0,
"specialType": "string",
"pricingType": 0,
"isDomestic": true,
"isSelection": true,
"options": [
{
"optionId": 0,
"flights": [
{
"leg": 0,
"startPoint": "string",
"endPoint": "string",
"startPointUtcOffset": {
"ticks": 0,
"days": 0,
"hours": 0,
"milliseconds": 0,
"microseconds": 0,
"nanoseconds": 0,
"minutes": 0,
"seconds": 0,
"totalDays": 0,
"totalHours": 0,
"totalMilliseconds": 0,
"totalMicroseconds": 0,
"totalNanoseconds": 0,
"totalMinutes": 0,
"totalSeconds": 0
},
"endPointUtcOffset": {
"ticks": 0,
"days": 0,
"hours": 0,
"milliseconds": 0,
"microseconds": 0,
"nanoseconds": 0,
"minutes": 0,
"seconds": 0,
"totalDays": 0,
"totalHours": 0,
"totalMilliseconds": 0,
"totalMicroseconds": 0,
"totalNanoseconds": 0,
"totalMinutes": 0,
"totalSeconds": 0
},
"startDate": "2026-06-03T09:00:11.785Z",
"endDate": "2026-06-03T09:00:11.785Z",
"duration": 0,
"flightValue": "string",
"flightId": 0,
"stopNum": 0,
"noRefund": true,
"promo": true,
"timeLimit": "2026-06-03T09:00:11.785Z",
"segments": [
{
"startPoint": "string",
"endPoint": "string",
"startPointUtcOffset": {
"ticks": 0,
"days": 0,
"hours": 0,
"milliseconds": 0,
"microseconds": 0,
"nanoseconds": 0,
"minutes": 0,
"seconds": 0,
"totalDays": 0,
"totalHours": 0,
"totalMilliseconds": 0,
"totalMicroseconds": 0,
"totalNanoseconds": 0,
"totalMinutes": 0,
"totalSeconds": 0
},
"endPointUtcOffset": {
"ticks": 0,
"days": 0,
"hours": 0,
"milliseconds": 0,
"microseconds": 0,
"nanoseconds": 0,
"minutes": 0,
"seconds": 0,
"totalDays": 0,
"totalHours": 0,
"totalMilliseconds": 0,
"totalMicroseconds": 0,
"totalNanoseconds": 0,
"totalMinutes": 0,
"totalSeconds": 0
},
"startDate": "2026-06-03T09:00:11.785Z",
"endDate": "2026-06-03T09:00:11.785Z",
"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,
"stopOvernight": true,
"changeStation": true,
"changeAirport": true,
"marketingCarrier": "string",
"operatingCarrier": "string",
"id": 0,
"seatAvl": 0,
"dayChange": true,
"marriageGrp": "string",
"flightsMiles": 0,
"technicalStop": "string"
}
]
}
]
}
]
}
]
}
]

Error Codes

This endpoint may return the following error codes:

For a complete list of error codes, see Error Codes.


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 departure dates are not in the past and are not more than 365 days from the current date.
  • 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.