PHP code example of travel-paq / packages-api

1. Go to this page and download the library: Download travel-paq/packages-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

travel-paq / packages-api example snippets

 php

 TravelPAQ\PackagesAPI\PackagesAPI;

$params = [
	'order_type' => "ASC",
	'order_field' => "PRICE",
	'currency' => "USD",
	'origin_place' => "EZE",
	'destination_place' => "IGR",
	'month_departure' => 9,
	'year_departure' => 2016,
	'Room' => [
		[
			'adult' => 2,
			'Children' => []
		]
	]
];

$tp = new PackagesAPI(['api_key' => 'YOUR_API_KEY','item_per_page' => 10]);
$list = json_decode($tp->getPackageList($params),true);
var_dump($list);
$package = json_decode($tp->getPackage($list['result'][0]['id']));
var_dump($package);