amadeus-ws-client icon indicating copy to clipboard operation
amadeus-ws-client copied to clipboard

Booking two one-way tickets

Open tolya1984a opened this issue 4 years ago • 23 comments

Hello!

Can I Booking two one-way tickets instead of a round-trip flight under one PNR. This is necessary in order to calculate the cost of a round-trip flight by two oneway (different companies or I can get you greater savings at times, for example)

tolya1984a avatar May 28 '20 08:05 tolya1984a

Yeah, why not?

You can use MasterPricer or the Air_Availability call to do that... You'll have to implement all the logic yourself though.

DerMika avatar May 28 '20 09:05 DerMika

You can explain in more detail the steps to explain how to implement this.

tolya1984a avatar May 28 '20 09:05 tolya1984a

I no longer work in this domain, so even if I could find the time (I can't), I have forgotten too much and I no longer have inside information (the documentation site).

You should contact Amadeus Support with this question.

Also it helps a lot to have access to a person who knows Amadeus Selling platform: They will be able to explain the flow to you. Then you just have to translate their cryptic commands into web services calls.

DerMika avatar May 28 '20 10:05 DerMika

Dear Colleagues, can anyone know how to do this? At least an approximate algorithm of actions. As subagents, we do not have access to Amadeus support.

When searching, do we need to use the multiTicket option?

tolya1984a avatar Jun 02 '20 08:06 tolya1984a

you can't do a masterpricer search to book multiple separate PNR's at once. One masterpricer search would usually result in 1 PNR (unless it gets split afterwards).

So the logical thing to do is to do 2 separate searches and book 2 separate PNR's...

DerMika avatar Jun 02 '20 08:06 DerMika

This means that you can’t make it possible to book two one-way tickets in one PNR? On some sites this is implemented.

tolya1984a avatar Jun 02 '20 09:06 tolya1984a

Ah, you want it in 1 PNR?

Yeah i guess that's possible. It would probably still need 2 separate masterpricer calls, 2 separate sellFromRecommtdation calls (into the same active PNR).

Again, i have not worked for/on Amadeus for a few years now. Amadeus Support is your best bet. Otherwise you should ask any travel agent who works with Amadeus Selling Platform how they'd do it and then mimic their workflow of cryptic calls into similar Web Services calls.

DerMika avatar Jun 02 '20 09:06 DerMika

How can I make it so that I can book two flights (round trip, but two oneway tickets), inside the one reservation with saving data only once. It is necessary to create one order with two flights and two PNR. However, do it in one order. How to organize it better?

tolya1984a avatar Jun 11 '20 14:06 tolya1984a

i recommend not to do round trip but two oneway tickets. Do MPTB with included All Air segments then Search. Then create PNR.

rifkydj avatar Jun 12 '20 15:06 rifkydj

Thanks for the answer. Maybe you have an example implementation? Something more specific?

tolya1984a avatar Jun 12 '20 15:06 tolya1984a

1st Use Fare_MasterPricerTravelBoardSearch And Add Itenaries Use Search, Use Below Example

new MPItinerary([
            'departureLocation' => new MPLocation(['city' => 'BRU']),
            'arrivalLocation' => new MPLocation(['city' => 'MAD']),
            'date' => new MPDate([
                'dateTime' => new \DateTime('2017-03-05T10:00:00+0000', new \DateTimeZone('UTC')),
                'timeWindow' => 5,
                'rangeMode' => MPDate::RANGEMODE_MINUS_PLUS,
                'range' => 1
            ])
        ]),
        new MPItinerary([
            'departureLocation' => new MPLocation(['city' => 'MAD']),
            'arrivalLocation' => new MPLocation(['city' => 'BRU']),
            'date' => new MPDate([
                'dateTime' => new \DateTime('2017-03-12T18:00:00+0000', new \DateTimeZone('UTC')),
                'timeWindow' => 5,
                'rangeMode' => MPDate::RANGEMODE_PLUS,
                'range' => 1
            ])

#235 connecting recommendation with flighs & baggage info. Select Air Segments As many As You want.

The Call for Aircell Recommendation . & use Stateful session. Then Go For Pnr Creation Process.

rifkydj avatar Jun 12 '20 16:06 rifkydj

Thank you very much for your help!

Is it possible with this approach to do, that the tickets to/from will be of different airlines, even if they are not part of the alliance. Is this possible?

tolya1984a avatar Jun 12 '20 17:06 tolya1984a

Thank you very much for your help!

Is it possible with this approach to do, that the tickets to/from will be of different airlines, even if they are not part of the alliance. Is this possible?

Yes Fare_MasterPricerTravelBoardSearch Gives You Diffrent Types OF Airlines For Itenaries

Refer This link It Contains All Search Options

rifkydj avatar Jun 13 '20 05:06 rifkydj

I basically have just one airline company round trip. What is the options?![tt](https://user-images.githubusercontent.com/54751402/84566605-49440a80-ad7b-11ea-9f0b-74d1efe8043f.png)

tolya1984a avatar Jun 13 '20 10:06 tolya1984a

Did u Use Fare_MasterPricerTravelBoardSearch Msg? It will Give All possible Iternaries And You Should Connect it with fares. seen the pic on last comment. Is it your interface ?

rifkydj avatar Jun 13 '20 12:06 rifkydj

Yes i used method Fare_MasterPricerTravelBoardSearch and in the screenshot you can see my interface. I almost always get round-trip tickets for one airline. Not different.

tolya1984a avatar Jun 15 '20 10:06 tolya1984a

Cn u post your Fare_MasterPricerTravelBoardSearch CODE. SO i can give look. Or U may be forward your query to amadeus and ask them or it may be related to your search parameters. Try different different dates & cities.

rifkydj avatar Jun 15 '20 14:06 rifkydj

private function _fareMasterPricerSearch() { $data = $this->getRouteData(); $cabinClass = $this->getCabinClass($data['flightClass']); $itinerary = []; $requestedFlightTypes = []; $feeIds = [];

    $passengers = [
        new MPPassenger([
            'type' => MPPassenger::TYPE_ADULT,
            'count' => $data['quantityAdults']
                ])
    ];

    if ($data['quantityChild'] > 0) {
        $passengers[] = new MPPassenger([
            'type' => MPPassenger::TYPE_CHILD,
            'count' => $data['quantityChild']
        ]);
    }

    if ($data['quantityInfant'] > 0) {
        $passengers[] = new MPPassenger([
            'type' => MPPassenger::TYPE_INFANT,
            'count' => $data['quantityInfant']
        ]);
    }

    if ($data['flightType'] == 'multiway') {
        foreach ($data['segments'] as $segment) {
            $itinerary[] = new MPItinerary([
                'departureLocation' => new MPLocation(['city' => $segment['departureId']]),
                'arrivalLocation' => new MPLocation(['city' => $segment['arrivalId']]),
                'date' => new MPDate(['dateTime' => new \DateTime($segment['departureDate'], new \DateTimeZone('UTC'))])
            ]);
        }
    } else {
        $itinerary = [
            new MPItinerary([
                'departureLocation' => new MPLocation(['city' => $data['departureId']]),
                'arrivalLocation' => new MPLocation(['city' => $data['arrivalId']]),
                'date' => new MPDate(['dateTime' => new \DateTime($data['departureDate'], new \DateTimeZone('UTC'))])
                    ])
        ];

        if ($data['flightType'] == 'roundtrip') {
            $itinerary[] = new MPItinerary([
                'departureLocation' => new MPLocation(['city' => $data['arrivalId']]),
                'arrivalLocation' => new MPLocation(['city' => $data['departureId']]),
                'date' => new MPDate(['dateTime' => new \DateTime($data['arrivalDate'], new \DateTimeZone('UTC'))])
            ]);
        }
    }

    //только прямые рейсы и без пересадок
    if ($data['directFlightsOnly']) {
        $requestedFlightTypes = [
            FareMasterPricerTbSearch::FLIGHTTYPE_DIRECT,
            FareMasterPricerTbSearch::FLIGHTTYPE_NONSTOP
        ];
    }

    if (count($itinerary) < 3) {
        $feeIds = [
            new MPFeeId(['type' => MPFeeId::FEETYPE_FARE_FAMILY_INFORMATION, 'number' => 2]),
            new MPFeeId(['type' => MPFeeId::FEETYPE_HOMOGENOUS_UPSELL, 'number' => 2])
        ];
    }

    $config = WSConfig::getInstance();

    $Request = new FareMasterPricerTbSearch([
        'nrOfRequestedResults' => $config->get('nrOfRequestedResults', 'int', 30),
        'nrOfRequestedPassengers' => $data['quantityAdults'] + $data['quantityChild'], //не включаем младенцев
        'passengers' => $passengers,
        'itinerary' => $itinerary,
        'cabinClass' => $cabinClass,
        'cabinOption' => FareMasterPricerTbSearch::CABINOPT_MANDATORY,
        'requestedFlightTypes' => $requestedFlightTypes,
        'flightOptions' => [
            FareMasterPricerTbSearch::FLIGHTOPT_PUBLISHED,
            FareMasterPricerTbSearch::FLIGHTOPT_TICKET_AVAILABILITY_CHECK
        ],
        'feeIds' => $feeIds,
        'currencyOverride' => $config->get('currencyOverride')
    ])

    $Сlient = new Client(AmadeusConfig::get());
    $Response = $Сlient->fareMasterPricerTravelBoardSearch($Request);

    if ($Response->status != Result::STATUS_OK) {
        $errorCode = $Response->messages[0]->code;
        if ($errorCode == "977") { //No available flight found for the requested segment 
            throw new FlightNotAvailableException();
        }

        WSLogger::requestError('fareMasterPricerTravelBoardSearch', $Request, $Response);
        throw new AmadeusResponseException($Response);
    }

...

tolya1984a avatar Jun 15 '20 14:06 tolya1984a

I get Results like this,

Screenshot from 2020-06-05 00-53-59 2

rifkydj avatar Jun 15 '20 14:06 rifkydj

Your Code is fine. Then You Must Contact Amadeus & send them your XML request & response. So they will investigate.

rifkydj avatar Jun 15 '20 14:06 rifkydj

Hello to you all.

What is the best way to book two one way routes within two bookings, but in one action. For this, it seems to me that the Multi-Ticket option is suitable, it can give recommendations for a round-trip route within a single request. This is necessary, including to obtain more favorable prices, and the client can choose two flights one way instead of a round trip flight, but do it in one action.

From the documentation: "The Multi-Ticket option allows to return at the same time: • Recommendations that require one single pricing transaction to be booked • Recommendations that require individual pricing transactions per proposed segment to be booked (the search is done on the same office id for the whole itinerary). This option is applicable only to round trip itinerary (2 requested segments). In order to target better prices, the traveler can choose two one-way flights instead of a round trip flight that is more expensive. All solutions are returned as following: • First all one-way recommendations that group the independent outbound are returned from the cheapest to the more expensive • Then all one-way recommendations that group the independent inbound are returned from the cheapest to the more expensive • And finally, all round trip recommendations that group round trip recommendations issued with 1 ticket are returned from the cheapest to the more expensive"

tolya1984a avatar Jul 15 '20 14:07 tolya1984a

Yes, it is the perfect solution. You may try adding “MTK” option to your Master Pricer requests. This option will enable a multi-ticket flow: you will be given not only “normal” round trip recommendations but also a set of one-way recommendations for outbound trip and another set for the inbound trip. Further, you may combine all these one-way recommendations in your own way. This will lead you creating one PNR but issuing two tickets for every passenger in this PNR: one for outbound trip and another for inbound one.

deep12650 avatar Oct 08 '20 00:10 deep12650

This means that you can’t make it possible to book two one-way tickets in one PNR? On some sites this is implemented.

Hi, yes you can. Book 2 one ways.The best thing is to price them as 2 one ways,two TSTs. Otherwise it may cause future problems if rebooking is needed and so on. Airlines will sometime object. Virtual interlining, 2 one ways, the traveler will probably perceive it as a return ticket though.

Annieyz74 avatar Oct 13 '20 20:10 Annieyz74