Skip to main content

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

FieldTypeRequiredDescription
systemstringYesSystem code (e.g., VN, VJ, 1A)
contactobjectNoMain contact info (see below)
guestContactobjectNoGuest contact info (optional, see below)
passengersarrayYesList of passengers (see below)
flightValuesarrayYesList of encoded flight values from Select/Search
tourCodestringNoTour code (for agency/group bookings)
caCodestringNoCorporate account code
autoIssuebooleanNoAuto-issue ticket flag

Contact Object

FieldTypeRequiredDescription
namestringYesFull name (minLength: 1)
genderbooleanNoGender (true: Male, false: Female)
titlestringNoTitle (MR/MS)
phonestringYesPhone number (minLength: 1)
emailstringYesEmail address (minLength: 1)
addressstringNoAddress
citystringNoCity
countrystringNoCountry
remarkstringNoNote
receiveEmailbooleanNoReceive confirmation email

Passenger Object

FieldTypeRequiredDescription
indexintegerNoPassenger order
passengerIdstringNoPassenger ID (from RetrievePNR)
givenNamestringYesGiven name (minLength: 1)
surnamestringYesSurname (minLength: 1)
typestringYesPassenger type: ADT, CHD/CH/CNN, INF (minLength: 1)
genderbooleanNoGender
dateOfBirthstringNoDate of birth (date format)
parentIdintegerNoParent passenger ID (for infants)
titlestringNoTitle (MR/MS/MRS/MSTR/MISS)
phonestringNoPhone number
emailstringNoEmail address
documentobjectNoDocument info (passport/ID, see Passport)
seatMapsarrayNoPre-booked seats (array of strings)
baggagesarrayNoPre-booked baggages (array of strings)
ancillariesarrayNoPre-booked ancillaries (array of strings)
membershipobjectNoMembership 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

  • system must match the system code from the flight search/selection.
  • flightValues must 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, dateOfBirth is required and must be valid.
  • Only available after a successful flight search and select.
  • Payment method must be supported by the airline/system.
  • If autoIssue is true, ticketing will be attempted immediately after booking.
  • Session/offer expiry may apply; always verify session if required.

Response Structure

FieldTypeNullableDescription
systemstringYesName of the airline system
statusbooleanNotrue if successful, false if failed
errorobjectYesError details (if any)
descriptionstringYesError description (if any)
trackingIdstringYesTracking ID for request logs
trackingTimestringYesTime for request tracking
bookingCodestringYesBooking code (PNR)
bookingTimestringYesBooking creation time
totalAmountnumberYesTotal booking amount (fare + tax + fees)
totalFareAmountnumberYesTotal fare (excluding tax/fees)
totalTaxAmountnumberYesTotal tax
expirationDatestringYesHold expiration date
timePurchasestringYesPayment deadline
contactobjectYesContact info (see above)
guestContactobjectYesGuest contact info (if provided)
passengersarrayYesList of passengers (see BookingPassenger)
flightsarrayYesList of flight segments (see Flight)
isNDCbooleanNoWhether 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.