Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Booking two one-way tickets #403

Open
tolya1984a opened this issue May 28, 2020 · 23 comments
Open

Booking two one-way tickets #403

tolya1984a opened this issue May 28, 2020 · 23 comments

Comments

@tolya1984a
Copy link

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)

@DerMika
Copy link
Collaborator

DerMika commented May 28, 2020

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.

@tolya1984a
Copy link
Author

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

@DerMika
Copy link
Collaborator

DerMika commented May 28, 2020

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.

@tolya1984a
Copy link
Author

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?

@DerMika
Copy link
Collaborator

DerMika commented Jun 2, 2020

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...

@tolya1984a
Copy link
Author

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

@DerMika
Copy link
Collaborator

DerMika commented Jun 2, 2020

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.

@tolya1984a
Copy link
Author

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?

@rifkydj
Copy link

rifkydj commented Jun 12, 2020

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

@tolya1984a
Copy link
Author

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

@rifkydj
Copy link

rifkydj commented Jun 12, 2020

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.

@tolya1984a
Copy link
Author

tolya1984a commented Jun 12, 2020

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?

@rifkydj
Copy link

rifkydj commented Jun 13, 2020

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

@tolya1984a
Copy link
Author

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)

@rifkydj
Copy link

rifkydj commented Jun 13, 2020

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 ?

@tolya1984a
Copy link
Author

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.

@rifkydj
Copy link

rifkydj commented Jun 15, 2020

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.

@tolya1984a
Copy link
Author

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);
    }

...

@rifkydj
Copy link

rifkydj commented Jun 15, 2020

I get Results like this,

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

@rifkydj
Copy link

rifkydj commented Jun 15, 2020

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

@tolya1984a
Copy link
Author

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"

@deep12650
Copy link

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.

@Annieyz74
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants