Business - Estimates
The Admin interface handles web service calls from the Admin web gui. The base url for this is at:
/api/business-admin
A JSON file with OpenAPI data about all business-related admin APIs can be downloaded here
.
Estimate reservation cost
Returns a range of estimation for a given set of vehicle categories based on the reservation data.
- POST /v1/estimate/reservation
Roughly calculates and returns the cost estimations for a reservation
- Status Codes
200 OK – Success
The API accepts in input a JsonBody with the following format:
{
User: "c53cb5e1-fa0c-4e5b-be38-b4795691ab2f" // Guid
StartTime: "2020/01/01 10:00:00", // DateTime
EndTime: "2020/01/01 11:00:00", // DateTime
ResourceGroups: ["86c17e07-a7f5-4e3a-988b-d0d192a220ed", ... ] // Guid array
ResourceCategories: ["700b9bfa-5911-4335-b6e3-5c97eb37ad49", ...], // Guid array
}
The API will take in account the provided groups/category and the user’s community and resource groups, then will check the tariffs that applies to those filters and the start/end time provided and return a response as follows:
{[
{
Category: "700b9bfa-5911-4335-b6e3-5c97eb37ad49", // Guid
Labels: "City Car", // String
MinPrice: 10, // Decimal
MaxPrice: 20, // Decimal
Tariffs: "1,2,..." // String (nullable)
},
...
]}
Where Category
is the guid of a vehicle category and Labels
the label localized in the reservation’s user preferred language,
MaxPrice
and MinPrice
are a rough estimation of the max and min
price the user will have to pay to satisfy his reservation with said vehicle category and Tariffs
is an array with the IDs
of the tariffs used to calculate this price range.
Possible errors are:
err_InvalidElement
No user, resource group or resource category has been set on the JsonBody
err_noUserFound
No user has been found for the specified user guid
err_InvalidStartDate
The start date is either not set, not valid or is in the past
err_InvalidEndDate
The end date is either not set, not valid or is earlier than the start date
err_NotEnoughBalance
Every estimate that has been found exceeds the payment capacity of the user’s wallet (only if the installation is in walled mode)