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 Select/Search |
| tourCode | string | No | Tour code (for agency/group bookings) |
| caCode | string | No | Corporate account code |
| autoIssue | boolean | No | Auto-issue ticket flag |
Contact Object
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Full name (minLength: 1) |
| gender | boolean | No | Gender (true: Male, false: Female) |
| title | string | No | Title (MR/MS) |
| phone | string | Yes | Phone number (minLength: 1) |
| string | Yes | Email address (minLength: 1) | |
| address | string | No | Address |
| city | string | No | City |
| country | string | No | Country |
| remark | string | No | Note |
| receiveEmail | boolean | No | Receive confirmation email |
Passenger Object
| Field | Type | Required | Description |
|---|---|---|---|
| index | integer | No | Passenger order |
| passengerId | string | No | Passenger ID (from RetrievePNR) |
| givenName | string | Yes | Given name (minLength: 1) |
| surname | string | Yes | Surname (minLength: 1) |
| type | string | Yes | Passenger type: ADT, CHD/CH/CNN, INF (minLength: 1) |
| gender | boolean | No | Gender |
| dateOfBirth | string | No | Date of birth (date format) |
| parentId | integer | No | Parent passenger ID (for infants) |
| title | string | No | Title (MR/MS/MRS/MSTR/MISS) |
| phone | string | No | Phone number |
| string | No | Email address | |
| document | object | No | Document info (passport/ID, see Passport) |
| seatMaps | array | No | Pre-booked seats (array of strings) |
| baggages | array | No | Pre-booked baggages (array of strings) |
| ancillaries | array | No | Pre-booked ancillaries (array of strings) |
| membership | object | No | Membership card (see Membership) |
Example Request:
{
"system": "VN",
"contact": {
"name": "Nguyen Van A",
"gender": true,
"title": "MR",
"phone": "+84901234567",
"email": "a@example.com"
},
"passengers": [
{
"index": 1,
"surname": "Nguyen",
"givenName": "Van A",
"type": "ADT",
"title": "MR",
"gender": true
}
],
"flightValues": [
"eyJmbGlnaHRJZCI6MSwiZGVwYXJ0RGF0ZSI6IjIwMjUtMDctMTAiLCJzdGFydFBvaW50IjoiU0dOIiwiZW5kUG9pbnQiOiJIQU4iLCJhaXJsaW5lIjoiVk4iLCJmYXJlQ2xhc3MiOiJZIn0="
],
"autoIssue": false
}
Request Constraints & Business Rules
systemmust match the system code from the flight search/selection.flightValuesmust be taken from the search/select result and not altered.- All passengers must have unique names and valid types (ADT, CHD, INF).
- Contact info must be valid and reachable.
- For infants/children,
dateOfBirthis required and must be valid. - 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 |
Example 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
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.
- 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.