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

Quantity is missing in traveller node in PNR_AddMultiElements

Open singhanil221 opened this issue 4 years ago • 2 comments

Hi, I am not getting the quantity tag in xml when creating the PNR_AddMultiElements request, below is my request code. Amadeus support told me to add the missing quantity tag as

<passengerData>
<travellerInformation>
	<traveller>
		<surname>Singh</surname>
		<quantity>1</quantity>
	</traveller>
<passenger>

Below is my php code for PNR_AddMultiElements request

$travellers = array();
$t=0;
foreach($passangersArr as $pass)
{
	//print_r($pass);
	$t++;
	$travellers[] = new Amadeus\Client\RequestOptions\Pnr\Traveller([
		'number' => $t,
		'firstName' => $pass['firstName'],
		'lastName' => $pass['lastName']
	]);
	
}

$opt = new Amadeus\Client\RequestOptions\PnrCreatePnrOptions();
$opt->actionCode = 0;
$opt->travellers = $travellers;
$opt->itineraries[] = new Amadeus\Client\RequestOptions\Pnr\Itinerary([
	'segments' => [
		new Amadeus\Client\RequestOptions\Pnr\Segment\Miscellaneous([
			'status ' => Amadeus\Client\RequestOptions\Pnr\Segment::STATUS_CONFIRMED,
			'company' => '1A',
			'date' => \DateTime::createFromFormat('dmy', $departureDate, new \DateTimeZone('UTC')),
			'cityCode' => $origin,
			'freeText' => 'DUMMY MISCELLANEOUS SEGMENT'
		])
	]
]);
$opt->elements[] = new Amadeus\Client\RequestOptions\Pnr\Element\Ticketing([
	'ticketMode' => Amadeus\Client\RequestOptions\Pnr\Element\Ticketing::TICKETMODE_OK
]);
$opt->elements[] = new Amadeus\Client\RequestOptions\Pnr\Element\Contact([
	'type' => Amadeus\Client\RequestOptions\Pnr\Element\Contact::TYPE_PHONE_MOBILE,
	'value' => '+918527239178'
]);

$createdPnr = $client->pnrCreatePnr($opt);

singhanil221 avatar Mar 16 '20 18:03 singhanil221

Have you tried starting counting from 1? I don't think passenger number 0 is a valid entry.

Have you checked the request & response log to see what XML message was generated?

DerMika avatar May 04 '20 08:05 DerMika

Did that fix your problem? If so, please close the ticket

DerMika avatar May 27 '20 22:05 DerMika