amadeus4dev / amadeus-code-examples

Self-contained examples for Amadeus REST APIs
MIT License
83 stars 39 forks source link

Flight Create Order Example is broken #38

Closed asbachb closed 2 years ago

asbachb commented 2 years ago

When executing the example there is an error during price confirmation. The result of offer search seems to be invalid as parameter for price confirmation.

Response(statusCode=400, parsed=true, result={"errors":[{"code":32171,"title":"MANDATORY DATA MISSING","detail":"type needed","source":{"pointer":"/data/flightOffers[0]/price/additionalServices[0]/type"},"status":400}]}, data=null, warnings=null, body={"errors":[{"code":32171,"title":"MANDATORY DATA MISSING","detail":"type needed","source":{"pointer":"/data/flightOffers[0]/price/additionalServices[0]/type"},"status":400}]}, request=Request(verb=POST, scheme=https, host=test.api.amadeus.com, path=/v1/shopping/flight-offers/pricing, params=null, body={"data":{"type":"flight-offers-pricing","flightOffers":[{"type":"flight-offer","id":"2","source":"GDS","instantTicketingRequired":false,"disablePricing":false,"nonHomogeneous":false,"oneWay":false,"paymentCardRequired":false,"lastTicketingDate":"2022-07-08","numberOfBookableSeats":9,"itineraries":[{"duration":"PT12H50M","segments":[{"departure":{"iataCode":"ORY","terminal":"1","at":"2022-11-01T15:20:00"},"arrival":{"iataCode":"LIS","terminal":"1","at":"2022-11-01T16:50:00"},"carrierCode":"TP","number":"439","aircraft":{"code":"32Q"},"operating":{"carrierCode":"TP"},"duration":"PT2H30M","id":"3","numberOfStops":0,"blacklistedInEU":false},{"departure":{"iataCode":"LIS","terminal":"1","at":"2022-11-01T18:50:00"},"arrival":{"iataCode":"EWR","terminal":"B","at":"2022-11-01T23:10:00"},"carrierCode":"TP","number":"203","aircraft":{"code":"32Q"},"operating":{"carrierCode":"TP"},"duration":"PT8H20M","id":"4","numberOfStops":0,"blacklistedInEU":false}]},{"duration":"PT10H30M","segments":[{"departure":{"iataCode":"JFK","terminal":"1","at":"2022-11-08T22:00:00"},"arrival":{"iataCode":"LIS","terminal":"1","at":"2022-11-09T09:40:00"},"carrierCode":"TP","number":"210","aircraft":{"code":"339"},"operating":{"carrierCode":"TP"},"duration":"PT6H40M","id":"5","numberOfStops":0,"blacklistedInEU":false},{"departure":{"iataCode":"LIS","terminal":"1","at":"2022-11-09T11:00:00"},"arrival":{"iataCode":"ORY","terminal":"1","at":"2022-11-09T14:30:00"},"carrierCode":"TP","number":"442","aircraft":{"code":"32Q"},"operating":{"carrierCode":"TP"},"duration":"PT2H30M","id":"6","numberOfStops":0,"blacklistedInEU":false}]}],"price":{"currency":"EUR","total":"381.57","base":"126.00","fees":[{"amount":"0.00","type":"SUPPLIER"},{"amount":"0.00","type":"TICKETING"}],"grandTotal":"381.57","additionalServices":[{"amount":"150.00"}]},"pricingOptions":{"includedCheckedBagsOnly":false,"fareType":["PUBLISHED"],"refundableFare":false,"noRestrictionFare":false,"noPenaltyFare":false},"validatingAirlineCodes":["TP"],"travelerPricings":[{"travelerId":"1","fareOption":"STANDARD","travelerType":"ADULT","price":{"currency":"EUR","total":"381.57","base":"126.00"},"fareDetailsBySegment":[{"segmentId":"3","cabin":"ECONOMY","fareBasis":"TFRDSI8D","class":"T","isAllotment":false,"includedCheckedBags":{"quantity":0,"weight":0}},{"segmentId":"4","cabin":"ECONOMY","fareBasis":"TFRDSI8D","brandedFare":"DISCOUNT","class":"T","isAllotment":false,"includedCheckedBags":{"quantity":0,"weight":0}},{"segmentId":"5","cabin":"ECONOMY","fareBasis":"TFRDSI8D","class":"T","isAllotment":false,"includedCheckedBags":{"quantity":0,"weight":0}},{"segmentId":"6","cabin":"ECONOMY","fareBasis":"TFRDSI8D","brandedFare":"DISCOUNT","class":"T","isAllotment":false,"includedCheckedBags":{"quantity":0,"weight":0}}]}]}]}}, bearerToken=Bearer U1nStdjPbUwXT474RGcbUAGjCtEJ, clientVersion=6.1.0, languageVersion=17.0.3, appId=null, appVersion=null, ssl=true, port=443, headers={Authorization=Bearer U1nStdjPbUwXT474RGcbUAGjCtEJ, X-HTTP-Method-Override=GET, Accept=application/json, application/vnd.amadeus+json, User-Agent=amadeus-java/6.1.0 java/17.0.3, Content-Type=application/vnd.amadeus+json}, uri=https://test.api.amadeus.com:443/v1/shopping/flight-offers/pricing?, connection=sun.net.www.protocol.https.DelegateHttpsURLConnection:https://test.api.amadeus.com:443/v1/shopping/flight-offers/pricing?))

minjikarin commented 2 years ago

Hello @asbachb thanks for the reporting, which Language SDK you have tried?

asbachb commented 2 years ago

@minjikarin java-sdk.

It seems that it does not fail all the time. But some responses from OfferSearch seem not compatible with price search.

minjikarin commented 2 years ago

@asbachb , thanks! yes, it is possible that when pricing, the result from offersearch is not available so it fails. meaning we won't be able to proceed to book, need to go back to the offersearch to choose other flight to proceed pricing & booking. :)

asbachb commented 2 years ago

@minjikarin I need to double check the reposne. But when I remember there as a price in that offer which produces a fail on pricing side.

I'll double-check later.

minjikarin commented 2 years ago

@asbachb , yes the pricing step is the validation step as the result from flight offer search is Cache data. please check and let us know via discord https://discord.com/invite/cVrFBqx. i believe this is not a concern/issue from SDK side, so we can close the issue :)

minjikarin commented 2 years ago

Discord link has been updated, sorry for confusion