I'm testing out flight-create-order API and tried to create an order with 01 Adult and 01 Child.
But alas I'm getting the below cryptic error. Please kindly help me to debug this issue.
Works fine when only adults are selected. Once i add either a child or held_infant, this error or TOO_OLD error get returned.
[errors] => Array
(
[0] => stdClass Object
(
[status] => 400
[code] => 4926
[title] => INVALID DATA RECEIVED
[detail] => There is not enough adults to accompany infants and children
)
)
The JSON payload I'm posting is mentioned below.
{
"data": {
"type": "flight-order",
"flightOffers": [
{
"type": "flight-offer",
"id": "1",
"source": "GDS",
"instantTicketingRequired": false,
"nonHomogeneous": false,
"oneWay": false,
"lastTicketingDate": "2023-12-27",
"lastTicketingDateTime": "2023-12-27",
"numberOfBookableSeats": 9,
"itineraries": [
{
"duration": "PT3H40M",
"segments": [
{
"departure": {
"iataCode": "CMB",
"at": "2023-12-27T00:30:00"
},
"arrival": {
"iataCode": "DEL",
"terminal": "3",
"at": "2023-12-27T04:10:00"
},
"carrierCode": "UL",
"number": "191",
"aircraft": {
"code": "320"
},
"operating": {
"carrierCode": "UL"
},
"duration": "PT3H40M",
"id": "17",
"numberOfStops": 0,
"blacklistedInEU": false
}
]
},
{
"duration": "PT3H40M",
"segments": [
{
"departure": {
"iataCode": "DEL",
"terminal": "3",
"at": "2024-01-27T05:10:00"
},
"arrival": {
"iataCode": "CMB",
"at": "2024-01-27T08:50:00"
},
"carrierCode": "UL",
"number": "192",
"aircraft": {
"code": "32A"
},
"operating": {
"carrierCode": "UL"
},
"duration": "PT3H40M",
"id": "41",
"numberOfStops": 0,
"blacklistedInEU": false
}
]
}
],
"price": {
"currency": "LKR",
"total": "261138.00",
"base": "116200.00",
"fees": [
{
"amount": "0.00",
"type": "SUPPLIER"
},
{
"amount": "0.00",
"type": "TICKETING"
}
],
"grandTotal": "261138.00"
},
"pricingOptions": {
"fareType": [
"PUBLISHED"
],
"includedCheckedBagsOnly": false
},
"validatingAirlineCodes": [
"UL"
],
"travelerPricings": [
{
"travelerId": "1",
"fareOption": "STANDARD",
"travelerType": "ADULT",
"price": {
"currency": "LKR",
"total": "138869.00",
"base": "66400.00"
},
"fareDetailsBySegment": [
{
"segmentId": "17",
"cabin": "ECONOMY",
"fareBasis": "NE1MLK",
"class": "N",
"includedCheckedBags": {
"weight": 30,
"weightUnit": "KG"
}
},
{
"segmentId": "41",
"cabin": "ECONOMY",
"fareBasis": "NE1MLK",
"class": "N",
"includedCheckedBags": {
"weight": 30,
"weightUnit": "KG"
}
}
]
},
{
"travelerId": "2",
"fareOption": "STANDARD",
"travelerType": "CHILD",
"price": {
"currency": "LKR",
"total": "122269.00",
"base": "49800.00"
},
"fareDetailsBySegment": [
{
"segmentId": "17",
"cabin": "ECONOMY",
"fareBasis": "NE1MLKCH25",
"class": "N"
},
{
"segmentId": "41",
"cabin": "ECONOMY",
"fareBasis": "NE1MLKCH25",
"class": "N"
}
]
}
]
}
],
"travelers": [
{
"id": "1",
"name": {
"firstName": "Jhon",
"lastName": "Doe"
},
"dateOfBirth": "2020-10-10",
"gender": "MALE",
"documents": [
{
"documentType": "PASSPORT",
"number": "N8144555",
"holder": true,
"nationality": "LK",
"expiryDate": "2025-02-24",
"issuanceCountry": "LK"
}
]
},
{
"id": "2",
"name": {
"firstName": "Jhon",
"lastName": "Doe"
},
"dateOfBirth": "2020-10-10",
"gender": "MALE",
"documents": [
{
"documentType": "PASSPORT",
"number": "N8144555",
"holder": true,
"nationality": "LK",
"expiryDate": "2025-02-24",
"issuanceCountry": "LK"
}
]
}
],
"contacts": [
{
"phones": [
{
"deviceType": "MOBILE",
"countryCallingCode": "94",
"number": "071 473 7212"
}
],
"emailAddress": "jhondoe@gmail.com"
}
]
}
You receive this error message, because you have indeed no adult defined in the API request. You have two travelers with "dateOfBirth": "2020-10-10"
. If you change the date of birth of one travelers to be an adult, you won't receive this error anymore.