The booking journey can be summarised as follows and this section details how to implement each of these steps:
Gather the set of available locations.
Checking the availability of Airports/Ports for a specific date/time range.
Generating a full pricing breakdown for a specific product.
Sending all booking information and payment details to the API, and receiving booking confirmation.
The API can provide a list of available airports and/or ports, should you wish to use it.
Here is how to obtain them from the API:
Note: You can create your own list instead using the list of IATA codes found in the Resources section.
using (var service = new AirportService.AirportServiceContractClient()) { var request = new AirportDTO(); var response = service.AllByCountry("GB"); // Get airports filtered by country // Loop through response foreach (var item in response) { // Airport code string code = item.Code; //Airport name string name = item.Name; } }
<?php // SOAP headers $headers = new SoapHeader($ns, 'ApiKey', $apikey); // Soap client $client = new SoapClient('http://sandbox.travelparkingapps.com/api/v3/AirportService.svc?wsdl'); // Soap parameters $request = array("countryCode" => "GB"); // Soap results $results = $client->__soapCall("AllByCountry", array($request), null, $headers); // Loop through airport results foreach($results->AllByCountryResult->AirportDTO as $item) { // Airport code $code = $item->Code; // Airport name $name = $item->Name; } ?>
Our API offers 2 web services for each of the product types we support; Airport Parking and Port Parking. This page provides example code snippets for implementing a search in both C# and PHP.
This process sends details of a chosen airport and date/time range to the API, and receives a list of available products and prices by return. This list is referred to as a 'quote'
and each item returned in the quote is called a 'product'
.
using (var service = new AirportParkingService.AirportParkingServiceContractClient()) { // Prepare search criteria var request = new AirportParkingQuoteItineraryDTO() { Airport = new AirportParkingService.AirportDTO() { Code = code }, Dates = new AirportParkingService.DateRangeDTO() { From = new AirportParkingService.DateTimeDTO() { Date = dropdate, Time = droptime }, To = new AirportParkingService.DateTimeDTO() { Date = returntime, Time = returndate } } }; // Send the request var response = service.SearchAvailability(request); }
<?php // SOAP headers $headers = new SoapHeader($ns, 'ApiKey', $apikey); // Soap client $client = new SoapClient('http://sandbox.travelparkingapps.com/api/v3/AirportParkingService.svc?wsdl'); // Soap parameters $request = array( "itinerary" => array( "Airport" => array( "Code" => $code ), "Dates" => array( "From" => array( "Date" => $dateFrom, "Time" => $timeFrom ), "To" => array( "Date" => $dateTo, "Time" => $timeTo ) ) ) ); // Soap results $results = $client->__soapCall("SearchAvailability", array($request), null, $headers); $quoteid = $results->SearchAvailabilityResult->Id; ?>
If you can't create a full integration, we can offer a deep-link search service via the Looking4.com website.
The base search urls are:
Culture | Url |
---|---|
en-GB |
Not Available |
fr-FR |
Not Available |
de-DE |
Not Available |
it-IT |
https://www.looking4.com/it/parcheggio-stazione-treni/risultati-della-ricerca |
es-ES |
https://www.looking4.com/es/aparcamiento-en-la-estación-de-tren/resultados-de-busqueda |
Below are details of the parameter names and values that must be specified in order to successfully generate a deep-linked search request.
NB: In order for deep-link searches to be traceable back to your application you must supply the campaign code issued by your account manager.
Parameter | Type | Description | Required |
---|---|---|---|
LocationCode |
string | The unique identifier for the location | |
Dates.From.Date |
date [yyyy-MM-dd] | The outbound date | |
Dates.From.Time |
time [HH:mm] | The outbound time | |
Dates.To.Date |
date [yyyy-MM-dd] | The return date | |
Dates.To.Time |
time [HH:mm] | The return time | |
DiscountCode |
string | A valid promotional discount code | |
Campaign |
string | Your unique TPA campaign code as supplied by the Travel Parking Group |
Parking location codes can be found here: https://www.travelparkingapps.com/api/docs/Parking/Locations
Once a car park (a product) has been selected, we must retrieve the quoteID
and productID
they wish to purchase, to the order form page.
using (var service = new AirportParkingService.AirportParkingServiceContractClient()) { // Retrieve quotation var response = service.GenerateQuotation(quoteId, productId); // Get to and from dates from itineray departureDate = Convert.ToDateTime(response.Itinerary.Dates.From.Date + " " + response.Itinerary.Dates.From.Time); arrivalDate = Convert.ToDateTime(response.Itinerary.Dates.To.Date + " " + response.Itinerary.Dates.To.Time); }
<?php // SOAP headers $headers = new SoapHeader($ns, 'ApiKey', $apikey); // Soap client $client = new SoapClient('http://sandbox.travelparkingapps.com/api/v3/AirportParkingService.svc?wsdl'); // Soap parameters $request = array("quoteId" => $quoteid, "productId" => $productid); // Soap results $results = $client->__soapCall("GenerateQuotation", array($request), null, $headers); ?>
This takes all of the contents of the order form and sends them along with the quoteID
and productID
to the API. A response is returned containing the new order's reference.
using (var service = new AirportParkingService.AirportParkingServiceContractClient()) { // Prepare booking itinerary criteria var request = new BookingItineraryDTO() { QuoteId = quoteId, ProductId = productId, Customer = new CustomerDTO() { Name = name, EmailAddress = emailAddress, ContactNumber = contactNumber }, Card = new CardDTO() { CardHolderName = cardHoldersName, CardType = cardType, CardNumber = cardNumber, ExpiryMonth = Convert.ToInt16(cardExpiryMonth), ExpiryYear = Convert.ToInt16(cardExpiryYear), SecurityNumber = cardSecurityCode }, Vehicle = new VehicleDTO() { Make = carMake, Model = carModel, Registration = carRegistration, Colour = carColour }, Journey = new JourneyDTO() { DepartureInfo = new JourneyInfoDTO() { Date = departureDate, NumberOfPassengers = passengerCount }, ArrivalInfo = new JourneyInfoDTO() { Date = arrivalDate, NumberOfPassengers = passengerCount }, PassengerCount = passengerCount }, ThirdPartyEmailsEnabled = termsAgree }; // Post booking and get response var response = service.GenerateBooking(request); // Get order reference from the response orderRef = response.OrderReference; }
<?php // SOAP headers $headers = new SoapHeader($ns, 'ApiKey', $apikey); // Soap client $client = new SoapClient($port_parking_wsdl); // Soap parameters $request = array( "itinerary" => array( "QuoteId" => $quoteid, "ProductId" => $productid, "Customer" => array( "Name" => $name, "EmailAddress" => $email, "ContactNumber" => $tel ), "Card" => array( "CardHolderName" => $card_name, "CardType" => $card_type, "CardNumber" => $card_number, "ExpiryMonth" => $card_expiry_month, "ExpiryYear" => $card_expiry_year, "SecurityNumber" => $card_cvs ), "Vehicle" => array( "Make" => $car_make, "Model" => $car_model, "Registration" => $car_reg, "Colour" => $car_colour ), "Journey" => array( "DepartureInfo" => array( "Date" => $destinationdateformat, "NumberOfPassengers" => $passenger_count ), "ArrivalInfo" => array( "Date" => $arrivaldateformat, "NumberOfPassengers" => $passenger_count ), "PassengerCount" => $passenger_count ), "ThirdPartEmailsEnabled" => $agree ) ); // Soap results $results = $client->__soapCall("GenerateBooking", $request, null, $headers); ?>
Localised content is available in two forms:
Both of which are explained below.
In order to get localised product information for search results and inside additional information windows / modals
the API provides a Culture
custom SOAP header for specifying which locale you would like the content returned in.
For example (and by default) if set the Culture
header to en-GB
the content will be returned in English. However, if fr-FR
is provided then the content will be returned in French*.
Note: Internally we map these to .NET CultureInfo instances so we only support valid .NET combinations.
using (var service = new AirportParkingService.AirportParkingServiceContractClient()) { using (new OperationContextScope(service.InnerChannel)) { // Here we explicitly define the culture to use but normally // you would pick this up from a customer's preferences CultureInfo culture = CultureInfo.GetCultureInfo("en-GB"); // Create and insert message header for required culture e.g en-GB MessageHeader headerNS = MessageHeader.CreateHeader("Culture", ConfigurationManager.AppSettings["NameSpace"].ToString(), culture); OperationContext.Current.OutgoingMessageHeaders.Add(headerNS); // Prepare search criteria var request = new AirportParkingQuoteItineraryDTO() { .... }; // Send the request, each product in the response will now have localised information. var response = service.SearchAvailability(request); } }
<?php // Here we explicitly define the culture to use but normally // you would pick this up from a customer's preferences $culture = "en-GB"; // Create and insert message header for required culture e.g en-GB $headers[] = new SoapHeader($ns, 'Culture', $culture); // Soap client $client = new SoapClient($airport_parking_wsdl); // Soap parameters $request = array( "itinerary" => array( "Airport" => array( "Code" => $code ), "Dates" => array( "From" => array( "Date" => $dateFrom, "Time" => $timeFrom ), "To" => array( "Date" => $dateTo, "Time" => $timeTo ) ) ) ); // Send the request, each product in the response will now have localised information. $results = $client->__soapCall("SearchAvailability", array($request), null, $headers); ?>
*One small caveat with this is that if translations don’t exist for the content in the requested locale the API will return back English instead.
Currency conversion is instantiated at search level and propagated throughout the rest of the process.
To explicitly request a specific currency for the pricing to be calculated in you would use
the CurrencySymbol
field on the
AirportParkingQuoteItineraryDTO /
PortParkingQuoteItineraryDTO.
This tells the API that you want prices sending back in this currency.
By default the API will actually use the default currency of the current culture’s country which is again
set using the Culture
Header, so for en-GB
the default currency is GBP
but for en-US
the default
currency will be USD
, and fr-FR
is EUR
, Etc.
See out Supported Currencies section for more details on specific currency support.
using (var service = new AirportParkingService.AirportParkingServiceContractClient()) { using (new OperationContextScope(service.InnerChannel)) { // Here we explicitly define the currency but normally // you would pick this up from a customer's preferences. string currencyCode = "SEK" // Prepare search criteria var request = new AirportParkingQuoteItineraryDTO() { Airport = new AirportParkingService.AirportDTO() { Code = code }, Dates = new AirportParkingService.DateRangeDTO() { From = new AirportParkingService.DateTimeDTO() { Date = dropdate, Time = droptime }, To = new AirportParkingService.DateTimeDTO() { Date = returntime, Time = returndate } }, // Here we assign the desired currency for pricing CurrencySymbol = currencyCode }; // Send the request, pricing will be returned calculated in the requested currency. var response = service.SearchAvailability(request); } }
<?php // Here we explicitly define the currency but normally // you would pick this up from a customer's preferences. $currencyCode = "SEK" // SOAP headers $headers[] = new SoapHeader($ns, 'Culture', $culture); // Soap client $client = new SoapClient($airport_parking_wsdl); // Soap parameters $request = array( "itinerary" => array( "Airport" => array( "Code" => $code ), "Dates" => array( "From" => array( "Date" => $dateFrom, "Time" => $timeFrom ), "To" => array( "Date" => $dateTo, "Time" => $timeTo ) ), "CurrencySymbol" => $currencyCode ) ); // Send the request, pricing will be returned calculated in the requested currency. $results = $client->__soapCall("SearchAvailability", array($request), null, $headers); ?>
Terms and Conditions are available through the GetTermsConditions action on the InformationService and takes a TermsInformationDTO as request parameter.
The action returns a HTML string containing the terms and conditions content,
optionally localised into the language specified in the Locale
field of the request object.
using (var service = new InformationService.InformationServiceContractClient()) { // Prepare request var request = new TermsInformationDTO() { Type = TermsInformationDTO.TermsType.Parking }; // Send the request to get the terms and conditions. var response = service.GetTermsConditions(request); }
<?php global $ns, $apikey, $information_wsdl, $culture; // SOAP headers $headers[] = new SoapHeader($ns, 'ApiKey', $apikey); $headers[] = new SoapHeader($ns, 'Culture', $culture); // Soap client $client = new SoapClient($information_wsdl); // Soap parameters $request = array( "information" => array( "Type" => "Parking" ) ); // Soap results $results = $client->__soapCall("GetTermsConditions", array($request), null, $headers); // Get the terms and conditions. $results->GetTermsConditionsResult; ?>