Skip to main content
POST
/
api
/
flights
/
booking
/
create
Create Flight Booking
curl --request POST \
  --url http://localhost:8080/api/flights/booking/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "flight_id": "fl_123",
  "flight_details": {
    "id": "<string>",
    "total_price": 123,
    "currency": "<string>",
    "outbound": {
      "segments": [
        {
          "carrier_name": "<string>",
          "flight_number": "<string>",
          "origin": "<string>",
          "destination": "<string>",
          "departure_at": "2023-11-07T05:31:56Z"
        }
      ]
    }
  },
  "total_price": 15000.5,
  "currency": "INR",
  "passengers": [
    {
      "title": "mr",
      "first_name": "John",
      "last_name": "Doe",
      "pax_type": "ADULT",
      "gender": "m",
      "born_on": "1990-01-01"
    }
  ],
  "contact": {
    "email": "[email protected]",
    "phone": "+919876543210"
  }
}
'
{
  "success": true,
  "data": {
    "booking_id": "<string>",
    "pnr": "ABCDEF",
    "status": "CONFIRMED",
    "total_price": 123,
    "currency": "<string>",
    "created_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
flight_id
string
required
Example:

"fl_123"

flight_details
object
required
total_price
number
required
Example:

15000.5

currency
string
required
Example:

"INR"

passengers
object[]
required
contact
object
required

Response

Booking created successfully

success
boolean
data
object