Retrieves a set ofRates and Vehicles.
A RatesResponse containing the requestedRates.
Use this method to queryRates and Vehicles for specific car rental data. In detail, you will need base date and time information, such as DepartureDateTime and ArrivalDateTime. Moreover, you'll have to specify the CurrencyCode for the Currency of the returnedRates.
In addition to above mentioned data, you will have to specify the departure and arrival Locations or Regions. There's a major difference in using both entities.
If you're using Locations as departure and arrival, this method will return you the vehicles and rates for given departure location.
In contrast, if you're using Regions as departure and arrival, this method will return you the best choices of vehicles and rates based on the locations assigned to the given departure region. This "Regional Rate Query" - or "Best Offer" rate calculation - is probably one of the most exciting features of this Web Service. You can find an in-depth discussion of both calculation schemes in the Carena.
NoteDepending on which calculation scheme you are using, the overall car rental process changes significantly. Consider this when designing your client implementation of this Web Service.
Apart from above "fundamental rate caclulation" data, you may additionally specify a VehicleTypeId as well as a VehicleAirConditionPreference and VehicleAutomaticGearPreference to narrow the results from this method.
Use Case Scenario | Resolution Path |
---|---|
You have a departure and arrival location as well as departure and arrival date and time and want to find available vehicles / rates. | Query rates with DepartureLocationId set to the id of the departure location and ArrivalLocationId set to the id of the arrival location. |
You want to query the best rates for Miami, whereby the customer prefers vehicles having air condition. | Query rates with DepartureRegionId and ArrivalRegionId set to the id of the region for Miami as well as setting VehicleAirConditionPreference set to Required. |
Your customer arrives at Düsseldorf Airport and wants to rent a luxury-class car having automatic gear shifting and air condition. |
|
Error Code | Description |
---|---|
E_INTERNAL_SERVICE | An internal service error occured during the process. |
E_TICKET_TOKEN_INVALID | The provided token is invalid. This error occurs if:
|
E_RATE_NOT_FOUND | Rate(s) or vehicle(s) for given reference data were not found. This error occurs if:
|
E_DEPARTURE_DATE_TIME_INVALID | The given departure date / time is invalid This error occurs if:
|
E_ARRIVAL_DATE_TIME_INVALID | The given arrival date / time is invalid This error occurs if:
|
E_DEPARTURE_DATE_TIME_TOO_EARLY | The given departure date / time is too early. This error occurs if:
|
E_ARRIVAL_DATE_TIME_TOO_EARLY | The given arrival date / time is too early. This error occurs if:
|
E_RENTAL_DURATION_TOO_SHORT | The rental duration is too short. This error occurs if:
|
E_RENTAL_DURATION_TOO_LONG | The rental duration is too long. This error occurs if:
|
E_REQUEST_AMBIGIOUS | The request is ambigious. This error occurs if:
|
E_REQUEST_INVALID | The performed request is invalid or malformed. |
Warning Code | Description |
---|---|
W_ADDITIONAL_RENTAL_DAY_APPLIED_DUE_24HOUR_RULE | The rental duration is increased by one rental day. This warning occurs if:
|
W_CURRENCY_NOT_SUPPORTED | The requested currency code is not supported for rate query. Using default currency instead. |
Example: Query best rates for Munich, but only returning vehicles with air condition.
[C#]
RatesRequest rq = new RateRequest();
rq.Ticket = this.serviceTicket;
rq.Operation.Target = OperationTarget.Production;
// set rate data, we are setting the region id's of munich causing
// the web service to switch into "best offer" rate calulation mode.
rq.DepartureRegionId = rq.ArrivalRegionId = 595 // region id of munich
// set air condition preference
rq.VehicleAirConditionPreference = Preference.Required;
// set rental duration - note that we will get a warning of
// W_ADDITIONAL_RENTAL_DAY_APPLIED_DUE_24HOUR_RULE, because 24 hour
// division of the duration has a remainder > 0
rq.DepartureDateTime = "2005-06-01T10:00:00";
rq.ArrivalDateTime = "2005-06-03T18:00:00";
// finally set the currency to US dollars
rq.CurrencyCode = "USD";
// go for the rates
RatesResponse rs = this.service.GetRates(rq);
// display results
foreach (Rate rate in rs.Rate)
{
Console.WriteLine("{0}\t{1}\t\t{2} {3}", rate.Vehicle.Code, rate.Vehicle.Name, rate.Value, rate.CurrencyCode);
// this line is like "BB1 Opel Corsa 57 USD";
Console.WriteLine("{0} is {1} and of type {2}", rate.Vehicle.Code, rate.RateServiceType.Name, rate.Vehicle.VehicleType.Name);
// this line is like "BB1 is All Inclusive and of type Small Car";
Console.WriteLine("{0}{1}{2} and {3} doors. Capacity of {4} passengers and {5} baggages.",
rate.Vehicle.Code,
rate.Vehicle.HasAirCondition ? " has air conditioning" : "",
rate.Vehicle.HasAutomaticGear ? " has automatic gear shift" : "",
rate.Vehicle.DoorCount,
rate.Vehicle.PassengerCount,
rate.Vehicle.BaggageCount
);
// this line is like "BB1 has airconditioning and 2 doors. Capacity of 2 passengers and 3 baggages.";
Console.WriteLine("");
}
CarRentalAgentService Class | SunnyCars.Services.Osi.WsReservation Namespace