Book Flight
Create a new booking (PNR) for one or more passengers on selected flights. This endpoint finalizes the booking after flight selection and passenger data entry.
Endpoint
- URL:
/api/v1/flight/book - Method:
POST - Auth Required: Yes (Bearer Token)
- Content-Type:
application/json
Authentication
This endpoint requires a valid JWT Bearer token in the Authorization header:
Authorization: Bearer <access_token>
Request Structure
| Field | Type | Required | Description |
|---|---|---|---|
| system | string | Yes | System code (e.g., VN, VJ, 1A) |
| contact | object | No | Main contact info (see below) |
| guestContact | object | No | Guest contact info (optional, see below) |
| passengers | array | Yes | List of passengers (see below) |
| flightValues | array | Yes | List of encoded flight values from the response of API Select Flight |
| tourCode | string | No | Tour code (for agency/group bookings) |
| accountCode | string | No | Corporate account code. For GDS, this value is carried in the selected flight value; for VN, use the corporate account code provided by the airline. |
| autoIssue | boolean | No | Auto-issue ticket flag |
Contact Object
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Contact or agency/OTA name |
| gender | boolean | No | Gender flag for the contact |
| title | string | No | Title such as MR, MRS, MS, MSTR |
| phone | string | Yes | Contact phone number |
| string | Yes | Contact email address | |
| address | string | No | Contact address |
| city | string | No | Contact city |
| country | string | No | Contact country code or name |
| remark | string | No | Additional contact note |
| receiveEmail | boolean | No | Whether to send confirmation email |
| language | string | No | Email language. Defaults to Vietnamese if omitted |
Passenger Object
| Field | Type | Required | Description |
|---|---|---|---|
| index | integer | No | Passenger sequence number |
| passengerId | string | No | Passenger ID from Retrieve Booking when updating or reusing an existing passenger |
| givenName | string | Yes | Given and middle name |
| surname | string | Yes | Passenger surname |
| type | string | Yes | Passenger type: ADT, CHD, INF |
| gender | boolean | No | Passenger gender |
| dateOfBirth | string | Conditional | Required when passenger type is CHD or INF. Passenger date of birth |
| parentId | integer | No | Adult passenger reference for infant passengers |
| title | string | No | Title such as MR, MRS, MS, MSTR |
| phone | string | No | Passenger phone number |
| string | No | Passenger email address | |
| document | object | No | Passenger document information (see Passport Object) |
| seatMaps | array | No | Pre-selected seat values for this passenger |
| baggages | array | No | Pre-selected baggage values for this passenger |
| ancillaries | array | No | Pre-selected ancillary service values for this passenger |
| membership | object | No | Loyalty or frequent flyer membership (see Membership Object) |
Passport Object
| Field | Type | Required | Description |
|---|---|---|---|
| surName | string | Conditional | Required when document is provided. Surname as shown on the document |
| givenName | string | Conditional | Required when document is provided. Given name as shown on the document |
| dateOfBirth | string | Conditional | Required when the passenger type is CHD or INF. Date of birth |
| gender | boolean | No | Document holder gender |
| number | string | Conditional | Required when document is provided. Document number, maximum 15 characters |
| type | string | Conditional | Required when document is provided. Document type: P - passport, I - national ID |
| national | string | No | Nationality, 3-character country code |
| expiryDate | string | Conditional | Required when document is provided, except when type = I. Document expiry date |
| issueCountry | string | No | Issuing country, 3-character country code |
| issueDate | string | No | Document issue date |
Membership Object
| Field | Type | Required | Description |
|---|---|---|---|
| airline | string | No | Airline code |
| membershipId | string | No | Membership or frequent flyer number |
| level | string | No | Membership tier level |
| skyTeamLevel | string | No | SkyTeam tier level, if applicable |
Sample Request
{
"system": "VN",
"contact": {
"name": "Nguyen Van A",
"gender": true,
"title": "MR",
"phone": "+84901234567",
"email": "a@example.com",
"address": "123 Le Loi",
"city": "Ho Chi Minh City",
"country": "VN",
"remark": "Primary booking contact",
"receiveEmail": true,
"language": "en"
},
"guestContact": {
"name": "Tran Thi B",
"gender": false,
"title": "MS",
"phone": "+84907654321",
"email": "guest@example.com",
"address": "456 Nguyen Hue",
"city": "Ho Chi Minh City",
"country": "VN",
"remark": "Guest contact for itinerary notification",
"receiveEmail": true,
"language": "en"
},
"passengers": [
{
"index": 1,
"surname": "Nguyen",
"givenName": "Van A",
"type": "ADT",
"title": "MR",
"gender": true,
"dateOfBirth": "1990-01-01",
"phone": "+84901234567",
"email": "a@example.com",
"document": {
"surName": "NGUYEN",
"givenName": "VAN A",
"dateOfBirth": "1990-01-01",
"gender": true,
"number": "C1234567",
"type": "P",
"national": "VNM",
"expiryDate": "2030-01-01",
"issueCountry": "VNM",
"issueDate": "2020-01-01"
},
"seatMaps": [
"encoded_seat_value"
],
"baggages": [
"encoded_baggage_value"
],
"ancillaries": [
"encoded_ancillary_value"
],
"membership": {
"airline": "VN",
"membershipId": "MEM123456",
"level": "GOLD",
"skyTeamLevel": "ELITE"
}
},
{
"index": 2,
"surname": "Nguyen",
"givenName": "Baby",
"type": "INF",
"title": "MSTR",
"gender": true,
"dateOfBirth": "2024-01-01",
"parentId": 1,
"document": {
"surName": "NGUYEN",
"givenName": "BABY",
"dateOfBirth": "2024-01-01",
"gender": true,
"number": "I1234567",
"type": "P",
"national": "VNM",
"expiryDate": "2030-01-01",
"issueCountry": "VNM",
"issueDate": "2024-02-01"
}
}
],
"flightValues": [
"eyJmbGlnaHRJZCI6MSwiZGVwYXJ0RGF0ZSI6IjIwMjUtMDctMTAiLCJzdGFydFBvaW50IjoiU0dOIiwiZW5kUG9pbnQiOiJIQU4iLCJhaXJsaW5lIjoiVk4iLCJmYXJlQ2xhc3MiOiJZIn0="
],
"tourCode": "TOUR2026",
"accountCode": "CORP001",
"autoIssue": false
}
Request Constraints & Business Rules
systemmust match the system code from the flight search/selection.flightValuesmust be taken from the Select Flight response and must not be altered.- Do not use raw
flightValuevalues from Search Flight directly for booking; call Select Flight first to verify availability and pricing. - All passengers must have unique names and valid types (ADT, CHD, INF).
- Contact info must be valid and reachable.
- For
CHDandINFpassengers, passengerdateOfBirthis required and must be valid. - For
CHDandINFpassengers with document information, documentdateOfBirthis required. - If passenger
documentis provided,type(DocumentType),number,surName,givenName, andexpiryDateare required. - If passenger
document.typeisI,expiryDateis optional. - Only available after a successful flight search and select.
- Payment method must be supported by the airline/system.
- If
autoIssueis true, ticketing will be attempted immediately after booking. - Session/offer expiry may apply; always verify session if required.
Response Structure
| Field | Type | Nullable | Description |
|---|---|---|---|
| system | string | Yes | Name of the airline system |
| 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 |
| bookingCode | string | Yes | Booking code (PNR) |
| bookingTime | string | Yes | Booking creation time |
| totalAmount | number | Yes | Total booking amount (fare + tax + fees) |
| totalFareAmount | number | Yes | Total fare (excluding tax/fees) |
| totalTaxAmount | number | Yes | Total tax |
| expirationDate | string | Yes | Hold expiration date |
| timePurchase | string | Yes | Payment deadline |
| contact | object | Yes | Contact info (see above) |
| guestContact | object | Yes | Guest contact info (if provided) |
| passengers | array | Yes | List of passengers (see BookingPassenger) |
| flights | array | Yes | List of flight segments (see Flight) |
| isNDC | boolean | No | Whether this is an NDC booking |
Sample Response:
{
"system": "VN",
"status": true,
"bookingCode": "ABC123",
"bookingTime": "2025-07-01T08:00:00Z",
"totalAmount": 5000000,
"totalFareAmount": 4500000,
"totalTaxAmount": 500000,
"expirationDate": "2025-07-02T08:00:00Z",
"timePurchase": "2025-07-01T18:00:00Z",
"contact": {
"title": "Mr",
"name": "Nguyen Van A",
"phone": "+84901234567",
"email": "a@example.com"
},
"passengers": [
{
"index": 1,
"surname": "Nguyen",
"givenName": "Van A",
"type": "ADT",
"title": "MR",
"gender": true
}
],
"flights": [
{
"leg": 0,
"startPoint": "SGN",
"endPoint": "HAN",
"startDate": "2025-07-10T08:00:00",
"endDate": "2025-07-10T10:00:00",
"flightValue": "...",
"segments": []
}
],
"isNDC": false,
"trackingId": "abc123",
"trackingTime": "2025-07-01T08:01:00.000Z"
}
Error Codes
This endpoint may return the following error codes:
- 06000 - Book: Errors specific to flight booking operations (06000-06016)
- 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.
- The endpoint is protected against unauthorized booking attempts and data tampering.
- Use HTTPS for all requests. Handle and store personal data in compliance with GDPR and other relevant regulations.
Validation Questions
- Are there limits on the number of passengers per booking?
- Are there restrictions on combining certain passenger types (e.g., INF/CHD/ADT ratios)?
- What are the supported payment methods for each airline/system?
- Are there time limits for holding bookings before payment/issuance?
For integration support, see Contact Support.