Travelport / uapi-book-microservice

MIT License
3 stars 5 forks source link

Key reference not found for Fare with key reference inside Booking #2

Open Mirchev11 opened 10 months ago

Mirchev11 commented 10 months ago

Hello,

I am using this API to make a booking request, but I continuously stumble upon this mistake.

Key reference not found for Fare with key reference NRHr8wUqWDKAtBcWJAAAAA== inside Booking

I am first executing the following request against the uapi-search-microservice project, and its endpoint catalogofferings. { "CatalogOfferingsRequestAir": { "offersPerPage": 1, "PassengerCriteria": [ { "value": "ADT", "number": 1 } ], "SearchCriteriaFlight": [ { "@type": "SearchCriteriaFlight", "departureDate": "2023-12-20", "From": { "value": "DEN" }, "To": { "value": "LAX" } } ], "SearchModifiersAir": { "@type": "SearchModifiersAir", "CarrierPreference": { "@type": "CarrierPreference", "type": "Prohibited", "carriers": [ "NK" ] } }, "PseudoCityInfo": { "value": "PCC" } } }

I get the following response:

{ "CatalogOfferingsResponse": { "CatalogOfferings": { "id": "s1", "Identifier": { "value": "ef9dc4e3-cae9-4dac-94a3-67dbe6828778", "authority": "Travelport" }, "DefaultCurrency": { "code": "ETB" }, "CatalogOffering": [ { "@type": "CatalogOffering", "id": "o0", "ProductOptions": [ { "@type": "ProductOptions", "sequence": 1, "Product": [ { "@type": "ProductAir", "id": "p0", "totalDuration": "P0DT2H23M0S", "Quantity": 9, "FlightSegment": [ { "@type": "FlightSegment", "sequence": 1, "Flight": { "@type": "FlightID", "FlightRef": "ztREFxSqWDKAHEwFFAAAAA==" } } ], "PassengerFlight": [ { "@type": "PassengerFlight", "passengerQuantity": 1, "passengerTypeCode": "ADT", "FlightProduct": [ { "@type": "FlightProduct", "segmentSequence": [ 1 ], "classOfService": "T", "cabin": "Economy", "fareBasisCode": "TAA7AWEN", "privateFareInd": false, "Brand": { "@type": "Brand", "id": "1261914", "BrandRef": "ztREFxSqWDKAeEwFFAAAAA==", "name": "ECONOMY", "tier": 2 } } ] } ] } ] } ], "Price": { "@type": "Price", "currencyCode": "ETB", "Base": 7057.0, "TotalTaxes": 1374.0, "TotalPrice": 8431.0 }, "TermsAndConditions": { "@type": "TermsAndConditions", "validatingCarrier": "UA", "ExpiryDate": "2023-12-12T23:59:00.000+03:00", "BaggageAllowance": [ { "@type": "BaggageAllowance", "ProductRef": [ "p0" ], "BaggageItem": [ { "@type": "BaggageItem", "quantity": 0 } ] } ] } } ] }, "transactionId": "587FCB380A0D6A9242B75BB56FB2CF21", "Result": { "@type": "Result", "Warning": [ { "@type": "Warning", "StatusCode": 4039, "Message": "\"Result size exceeded the maximum allowable and some results were discarded. It may be necessary to narrow your search using search modifiers.\"" } ] }, "ReferenceList": [ { "@type": "ReferenceListFlight", "Flight": [ { "@type": "Flight", "id": "ztREFxSqWDKAHEwFFAAAAA==", "distance": 806, "duration": "PT2H23M", "carrier": "UA", "number": "1335", "equipment": [ "738" ], "Departure": { "@type": "Departure", "location": "DEN", "date": "2023-12-20", "time": "19:18:00.000-07:00" }, "Arrival": { "@type": "Arrival", "location": "ONT", "date": "2023-12-20", "time": "20:41:00.000-08:00" } }, { "@type": "Flight", "id": "ztREFxSqWDKAJEwFFAAAAA==", "distance": 832, "duration": "PT2H31M", "carrier": "UA", "number": "2666", "equipment": [ "7M8" ], "Departure": { "@type": "Departure", "location": "DEN", "date": "2023-12-20", "time": "07:50:00.000-07:00" }, "Arrival": { "@type": "Arrival", "location": "SNA", "date": "2023-12-20", "time": "09:21:00.000-08:00" } }, { "@type": "Flight", "id": "ztREFxSqWDKALEwFFAAAAA==", "distance": 832, "duration": "PT2H31M", "carrier": "UA", "number": "2153", "equipment": [ "320" ], "Departure": { "@type": "Departure", "location": "DEN", "date": "2023-12-20", "time": "13:40:00.000-07:00" }, "Arrival": { "@type": "Arrival", "location": "SNA", "date": "2023-12-20", "time": "15:11:00.000-08:00" } }, { "@type": "Flight", "id": "ztREFxSqWDKANEwFFAAAAA==", "distance": 832, "duration": "PT2H31M", "carrier": "UA", "number": "1511", "equipment": [ "319" ], "Departure": { "@type": "Departure", "location": "DEN", "date": "2023-12-20", "time": "15:57:00.000-07:00" }, "Arrival": { "@type": "Arrival", "location": "SNA", "date": "2023-12-20", "time": "17:28:00.000-08:00" } }, { "@type": "Flight", "id": "ztREFxSqWDKAPEwFFAAAAA==", "distance": 832, "duration": "PT2H31M", "carrier": "UA", "number": "2199", "equipment": [ "738" ], "Departure": { "@type": "Departure", "location": "DEN", "date": "2023-12-20", "time": "19:35:00.000-07:00" }, "Arrival": { "@type": "Arrival", "location": "SNA", "date": "2023-12-20", "time": "21:06:00.000-08:00" } } ] } ] } }

Then I use this response and the information from it to build a request that is send to buildfromproducts from uapi-price-microservice, which looks like this:

{ "OfferQueryBuildFromProducts": { "BuildFromProductsRequest": { "@type": "BuildFromProductsRequestAir", "PassengerCriteria": [ { "value": "ADT", "number": 1 } ], "ProductCriteriaAir": [ { "@type": "ProductCriteriaAir", "SpecificFlightCriteria": [ { "@type": "SpecificFlightCriteria", "carrier": "UA", "flightNumber": "1335", "departureDate": "2023-12-20", "departureTime": "19:18:00.000-07:00", "arrivalDate": "2023-12-20", "arrivalTime": "20:41:00.000-08:00", "from": "DEN", "to": "ONT", "cabin": "Economy", "classOfService": "T", "segmentSequence": "1" } ] } ] } } }

I get the following response:

{ "OfferSummary": { "id": "58826ABF0A0D6A946D91C2B20273962E", "Product": [ { "FlightSegment": [ { "@type": "FlightSegment", "id": "NRHr8wUqWDKAkBcWJAAAAA==", "sequence": 1, "Flight": { "@type": "Flight", "id": "NRHr8wUqWDKAkBcWJAAAAA==", "distance": 806, "duration": "PT2H23M", "carrier": "UA", "number": "1335", "operatingCarrier": "UA", "operatingCarrierName": "United Airlines Inc", "Departure": { "@type": "Departure", "location": "DEN", "date": "2023-12-20", "time": "19:18:00.000-07:00" }, "Arrival": { "@type": "Arrival", "location": "ONT", "date": "2023-12-20", "time": "20:41:00.000-08:00" } } } ], "PassengerFlight": [ { "@type": "PassengerFlight", "passengerQuantity": 1, "passengerTypeCode": "ADT", "FlightProduct": [ { "@type": "FlightProduct", "segmentSequence": [ 1 ], "classOfService": "T", "cabin": "Economy", "fareBasisCode": "TAA7AWEN", "privateFareInd": false, "Brand": { "@type": "Brand", "id": "1261914", "BrandRef": "NRHr8wUqWDKAtBcWJAAAAA==", "name": "ECONOMY", "tier": 2 } } ] } ] } ], "Price": { "@type": "PriceDetail", "currencyCode": "ETB", "Base": 7057.0, "TotalTaxes": 1374.0, "TotalPrice": 8431.0, "PriceBreakdown": [ { "@type": "PriceBreakdownAir", "requestedPassengerType": "ADT", "Amount": { "Base": 7057.0, "Taxes": { "Tax": [ { "value": 317.0, "taxCode": "AY" }, { "value": 530.0, "taxCode": "US" }, { "value": 255.0, "taxCode": "XF" }, { "value": 272.0, "taxCode": "ZP" } ] }, "Total": 8431.0 } } ] }, "TermsAndConditionsFull": [ { "@type": "TermsAndConditionsFull", "ExpiryDate": "2023-12-12T23:59:00.000+03:00" } ] } } But as far as I understood form the documentation and other issues opened - https://github.com/Travelport/travelport-uapi-tutorial-c-sharp/issues/63

I don't get a proper information from the response, so I debugged the code and got the value I use for FareInfoRef -> NRHr8wUqWDKAtBcWJAAAAA== from AirPriceRsp/AirPriceResult/AirPriceSolution/AirPriceingInfo/FareRuleKey/FareInfoRef, so I formed the following request to be sent to reservation endpoint of this project.

{ "ReservationSummary": { "id": "reservation_asd123", "Offer": [ { "Identifier": { "value": "ULi+U7Q2BKAbOlFCAAAAA==" }, "Product": [ { "FlightSegment": [ { "Flight": { "id": "j6NEFxVqWDKAFnDBFAAAAA==", "FlightRef": "0", "carrier": "UA", "number": "1335", "Departure": { "location": "DEN", "date": "2023-12-20", "time": "19:18:00.000-07:00" }, "Arrival": { "location": "ONT", "date": "2023-12-20", "time": "20:41:00.000-08:00" } } } ], "PassengerFlight": [ { "passengerTypeCode": "ADT", "FlightProduct": [ { "classOfService": "T", "cabin": "Economy", "fareBasisCode": "TAA7AWEN", "Brand": { "id": "1261914", "BrandRef": "NRHr8wUqWDKAtBcWJAAAAA==" } } ] } ] } ] } ], "Traveler": [ { "dob": "1985-04-20", "gender": "Male", "passengerTypeCode": "ADT", "PersonName": { "Given": "John", "Surname": "Smith" }, "Telephone": [ { "@type": "Telephone", "countryAccessCode": "1", "areaCityCode": "303", "phoneNumber": "1234567", "cityCode": "DEN" } ] } ], "FormOfPaymentCash": [ { "id": "formOfPayment_1", "FormOfPaymentRef": "formOfPayment_1", "cashInd": true } ], "Payment": [ { "@type": "Credit", "Amount": { "value": 8431.0, "code": "ETB" }, "FormOfPaymentIdentifier": { "id": "formOfPaymentIdentifier", "FormOfPaymentRef": "PDz8y7xu4hGdeB/wYIhwmw==" }, "Taxes": { "@type": "Taxes", "TotalTaxes": 8431.0 } } ] } }

as a provider I am using 1G.

where I get the following error. I would be very grateful if someone can assist me on that issue.