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
| Field | Type | Required | Description |
|---|---|---|---|
| system | string | Yes | Airline system code |
| adt | integer | Yes | Number of adult passengers |
| chd | integer | No | Number of child passengers |
| inf | integer | No | Number of infant passengers |
| flights | array | Yes | List of flight segments (see FlightRequest) |
| specialType | string | No | Special passenger type (STU - Student, YTH - Youth, LBR - Labor, SEA - Seaman, VFR - Family, EMI - Emigrant, VG2/4/6/8 - Group) |
| promoCode | string | No | Airline discount/coupon code |
| airlines | array | No | List of preferred airline codes (2-letter IATA codes) |
| pricingType | integer | No | Pricing type preference: 0 - All, 1 - NDC, 2 - ETK |
| combine | boolean | No | Combine multi-segment tickets (applies to VN) |
| accountCodes | array | No | Corporate account codes (see AccountCodeRequest below) |
| issueDate | DateOnly | No | Ticket issue date used for pricing rules when applicable (YYYY-MM-DD, applies to VN) |
FlightRequest Object
| Field | Type | Required | Description |
|---|---|---|---|
| leg | integer | No | Flight segment sequence number |
| startPoint | string | Yes | Departure airport code (3-letter IATA) |
| endPoint | string | Yes | Arrival airport code (3-letter IATA) |
| departDate | DateOnly | Yes | Departure date (YYYY-MM-DD format) |
| preferCabin | string | No | Cabin class: Y - Economy, F - First, C - Business, W - Premium Economy, M - Non-premium Economy |
AccountCodeRequest Object
| Field | Type | Required | Description |
|---|---|---|---|
| airline | string | No | Airline code (IATA 2-letter) |
| accountCode | string | No | Corporate 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.
departDatemust not be in the past.departDatemust not be more than 365 days from the current date.- Total adult and child passengers must not exceed 9:
adt + chd <= 9(chdis also referred to as CNN in some airline flows). - For round-trip searches, the return
departDatemust be greater than the outbounddepartDate, and the outbounddepartDatemust 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:
| Field | Type | Nullable | Description |
|---|---|---|---|
| system | string | Yes | System name (e.g., VN, VJ, 1A) |
| status | boolean | No | true if successful, false if failed |
| error | object | Yes | Error details (if any) |
| description | string | Yes | Error description (if any) |
| trackingId | string | Yes | Tracking ID for request logs |
| trackingTime | string | Yes | Time for request tracking (ISO 8601 format) |
| fareDatas | array | Yes | List of available flight options (see FareData) |
FareData Object
| Field | Type | Nullable | Description |
|---|---|---|---|
| fareDataId | integer | No | Unique identifier for this fare option |
| itinerary | integer | No | Itinerary sequence number |
| currency | string | Yes | Currency code (e.g., VND, USD) |
| adt | integer | No | Number of adults |
| chd | integer | No | Number of children |
| inf | integer | No | Number of infants |
| fareAdt | number | No | Base fare per adult |
| fareChd | number | No | Base fare per child |
| fareInf | number | No | Base fare per infant |
| taxAdt | number | No | Taxes and fees per adult |
| taxChd | number | No | Taxes and fees per child |
| taxInf | number | No | Taxes and fees per infant |
| priceAdt | number | No | Total price per adult (base fare + taxes) |
| priceChd | number | No | Total price per child (base fare + taxes) |
| priceInf | number | No | Total price per infant (base fare + taxes) |
| totalFare | number | No | Total base fare for all passengers |
| totalTax | number | No | Total taxes and fees for all passengers |
| totalPrice | number | No | Total amount for all passengers |
| discountAdt | number | No | Total discount for adult passengers (ADT) |
| discountChd | number | No | Total discount for child passengers (CHD) |
| discountInf | number | No | Total discount for infant passengers (INF) |
| specialType | string | Yes | Special passenger type code (if any) |
| pricingType | integer | Yes | Pricing type: 0 - All, 1 - GDS, 2 - NDC |
| isDomestic | boolean | No | Whether this is a domestic flight |
| isSelection | boolean | Yes | Latest fare data flag from airline |
| options | array | Yes | List of flight options (see Option) |
Option Object
| Field | Type | Nullable | Description |
|---|---|---|---|
| optionId | integer | No | Unique identifier for this fare option |
| flights | array | Yes | List of flight (see Option) |
Flight Object
| Field | Type | Nullable | Description |
|---|---|---|---|
leg | integer | No | Leg index: 0 - Outbound, 1 - Return |
startPoint | string | Yes | Departure airport code (IATA) |
endPoint | string | Yes | Arrival airport code (IATA) |
startPointUtcOffset | TimeSpan | Yes | UTC offset of departure location |
endPointUtcOffset | TimeSpan | Yes | UTC offset of arrival location |
startDate | datetime | Yes | Departure date and time (ISO 8601 format) |
endDate | datetime | Yes | Arrival date and time (ISO 8601 format) |
duration | integer | No | Total flight duration (in minutes, read-only) |
flightValue | string | Yes | Encoded flight value for use in related functions |
flightId | integer | No | Flight sequence number (assigned automatically) |
stopNum | integer | No | Number of stops (read-only) |
noRefund | boolean | No | true if the fare is non-refundable |
promo | boolean | No | true if this is a promotional fare |
timeLimit | datetime | Yes | Time limit to issue ticket |
segments | array | Yes | List of segments making up the flight (see Segment below) |
Segment Object
| Field | Type | Nullable | Description |
|---|---|---|---|
id | integer | No | Unique identifier for the segment |
startPoint | string | Yes | Departure airport code (IATA) |
endPoint | string | Yes | Arrival airport code (IATA) |
startPointUtcOffset | TimeSpan | Yes | UTC offset at departure |
endPointUtcOffset | TimeSpan | Yes | UTC offset at arrival |
startDate | datetime | Yes | Departure time (ISO 8601 format) |
endDate | datetime | Yes | Arrival time (ISO 8601 format) |
startTerminal | string | Yes | Departure terminal |
endTerminal | string | Yes | Arrival terminal |
flightNumber | string | Yes | Flight number |
plane | string | Yes | Aircraft code/model |
status | string | Yes | Booking status |
fareClass | string | Yes | Booking class (e.g., Y, M, B, etc.) |
fareBasis | string | Yes | Fare basis code |
duration | integer | No | Segment duration (minutes, read-only) |
cabinCode | string | Yes | Cabin code (Y - Economy, C - Business, F - First, etc.) |
hasStop | boolean | No | If the flight has technical or planned stop |
handBaggage | string | Yes | Cabin baggage allowance |
freeBaggage | string | Yes | Checked baggage allowance |
stopPoint | string | Yes | Stop airport code (if any) |
stopTime | number | Yes | Duration of stop (minutes) |
stopOvernight | boolean | No | Indicates if overnight stop exists |
changeStation | boolean | No | Indicates change of train/station |
changeAirport | boolean | No | Indicates change of airport |
marketingCarrier | string | Yes | Marketing carrier (IATA code) |
operatingCarrier | string | Yes | Operating carrier (IATA code) |
seatAvl | integer | No | Number of seats available for booking |
dayChange | boolean | No | Indicates if arrival is on different day than departure |
marriageGrp | boolean | Yes | Marriage group status |
flightsMiles | integer | Yes | Distance in miles |
technicalStop | string | Yes | Code/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:
- 01000 - Search Flight: Errors specific to flight search operations (01001-01010)
- 00000 - Flight Hub (General Errors): General system and authentication errors (00001-00056)
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.