PHP code example of oberonamsterdam / travelbase-api-client
1. Go to this page and download the library: Download oberonamsterdam/travelbase-api-client 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/ */
oberonamsterdam / travelbase-api-client example snippets
$client = new \Oberon\TravelbaseClient\ApiClient("https://example.com", "APIKEY");
//Send as a model
$allotment = new \Oberon\TravelbaseClient\Model\Allotment();
$allotment->setAmount(1); // as array
$allotmentCollection[] = [
'amount' => 1, //
//Send as a model
$tripPricing = new \Oberon\TravelbaseClient\Model\TripPricing();
$tripPricing->setDuration(1);
$tripPricing->setDate(new \DateTime('2022-01-01'));
$tripPricing->setPrice(100.50); // ion' => 1, // itId, $tripPricingCollection);
// To delete all trip pricings for a specific rentalunit, only supply the first parameter.
// To delete all trips for a specific datetime supply first and second parameter.
// To delete all trips for a specific duration supply first and third parameter
// To delete a specific trip pricing supply all paramters
$client->deleteTrips($yourRentalUnitId, new \DateTime(), 1);
//Send as a model
$datePricing = new \Oberon\TravelbaseClient\Model\DatePricing();
$datePricing->setDate(new \DateTime('2022-01-01'));
$datePricing->setNightPrice(100.50); // Price(40); // tePricing;
//send as array
$datePricingCollection[] = [
'date' => '2022-01-02', // quired
'departureAllowed' => false //
// Delete pricings starting from a specific datetime
$client->deleteDatePricings($yourRentalUnitId, new \DateTime('2022-01-01'));
// Delete pricings within a specific datetime range
$client->deleteDatePricings($yourRentalUnitId, new \DateTime('2022-01-01 12:00:00'), new \DateTime('2022-01-01 18:00:00'));
//Send as a model
$datePricingModifier = new \Oberon\TravelbaseClient\Model\DatePricingModifier();
$datePricingModifier->setStartDate(new \DateTime('2022-01-01')); // ); // d as array
$datePricingModifier = [
'startDate' => '2022-01-01', // teDatePricingModifier($yourRentalUnitId, $datePricingModifier);
//Send as a model
$datePricingModifier = new \Oberon\TravelbaseClient\Model\DatePricingModifier();
$datePricingModifier->setStartDate(new \DateTime('2023-01-01')); // ); // array
$datePricingModifier = [
'startDate' => '2023-01-01', // DatePricingModifier($yourDatePricingModifierId, $datePricingModifier);
// To delete all trip pricings for a specific rentalunit, only supply the first parameter.
// To delete all trips for a specific datetime supply first and second parameter.
// To delete all trips for a specific duration supply first and third parameter
// To delete a specific trip pricing supply all paramters
$client->completePendingBooking($yourBookingId, true);
// Send as a model
$timeslot = new \Oberon\TravelbaseClient\Model\TimeslotInput(
$yourRateGroupId, // 1, // ion[] = [
'rateGroupId' => $yourRateGroupId, // rnalId' => 'id1', //
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.