Listing AirPort Search
The Car Listings API allows users to search for rental cars across multiple Global Distribution Systems (GDS)
and suppliers and to reserve cars with discount and/or coupon codes.
For more information about the Listings API, see Listings API documentation.
1. Build the request object using the classes defined in the SDK
GetCarsListingsOperationParams getCarsListingsOperationParams =
GetCarsListingsOperationParams.builder().partnerTransactionId("EWSCar_Automation")
//Three letter code for the airport at which the customer would like to pick up the car.
//Supported values: standard 3 letter IATA Airport Code.
//Cannot coexist with other pickup parameters, only one pickup parameter is allowed per
//request.
.pickupAirport("MCO")
//Three letter code for the airport at which the customer would like to drop off the
//car.
//Supported values: standard 3 letter IATA Airport Code.
//Cannot coexist with other drop off parameters, only one drop off parameter is allowed
//per request.
//If no drop off location is specified, it is assumed that the customer will be dropping
//the car off at the same location at which they picked it up.
.dropOffAirport("MCO")
//Requested car pickup date and time.
//Date should be ISO8601 Date format.The supported search window is today to 330 days in
//the future.
//(Note that each rental counter has different hours of operation. If you select a time
//in the middle of the night there may be no inventory available as all locations may be
//closed.)
.pickupTime(LocalDateTime.now().plusDays(5))
//Requested car drop off date and time.
//Date should be ISO8601 Date format.The supported search window is today to 330 days in
//the future.
//The drop-off datetime should occur at least 2 hours after the pickup datetime.
.dropOffTime(LocalDateTime.now().plusDays(8))
//The maximum number of search results that will be returned by the query.
.limit(5).links(linksList).build();
GetCarsListingsOperation getCarsListingsOperation =
new GetCarsListingsOperation(getCarsListingsOperationParams);
2. Make the API call using service client.
Response<CarListingsResponse> carListingsResponse =
xapClient.execute(getCarsListingsOperation);