Price

3 min. readlast update: 11.26.2024

Get Price Endpoint

The Get Price endpoint allows users to retrieve price information for booking a specific accommodation within a given date range, taking into account any applicable voucher codes and the number of persons staying. This endpoint is particularly useful for calculating the total booking cost, including any discounts or cancellation fund options that may apply.

Endpoint Overview

  • Endpoint: /get-price
  • Method: POST
  • Description: Retrieves the price details for booking an accommodation based on the provided search criteria.

Request Model

The request model for Get Price uses the PriceModel structure to define the search criteria for the price calculation.

PriceModel Parameters

Field Type Required Description
houseId Integer Optional The unique identifier for the accommodation to retrieve the price for.
startDate String Optional The start date of the booking in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.sssZ).
endDate String Optional The end date of the booking in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.sssZ).
nrPersons Integer Optional The number of persons included in the booking.
voucherCode String Optional A voucher code that may apply a discount to the total price.

Example Request Body

{
  "houseId": 0,
  "startDate": "2024-11-14T17:24:13.850Z",
  "endDate": "2024-11-14T17:24:13.850Z",
  "nrPersons": 0,
  "voucherCode": "string"
}

Response Model

The response from the Get Price endpoint provides detailed information about the booking price, including both full and discounted prices, as well as additional options such as cancellation fund and voucher discounts.

PriceResult Parameters

Field Type Description
startDate String The start date of the booking, matching the format in the request.
endDate String The end date of the booking, matching the format in the request.
nrPersons Integer The number of persons specified in the booking.
fullPrice Number The full, undiscounted price for the booking.
discountedPrice Number The price for the booking after applying any valid discounts or voucher codes.
cancellationFundPossible Boolean Indicates whether a cancellation fund is available for this booking.
cancellationFund Number The additional cost for the optional cancellation fund, if available.
voucherAmount Number The total amount discounted through the provided voucher code.

Example Response

{
  "startDate": "2024-11-14T17:24:13.848Z",
  "endDate": "2024-11-14T17:24:13.848Z",
  "nrPersons": 0,
  "fullPrice": 0,
  "discountedPrice": 0,
  "cancellationFundPossible": true,
  "cancellationFund": 0,
  "voucherAmount": 0
}

Usage Notes

  • Optional Parameters: All fields in the PriceModel are optional, allowing flexibility based on available data. However, providing more information, such as houseIdstartDate, and endDate, will improve accuracy in price calculations.
  • Discounts and Voucher Codes: The voucherCode parameter can be used to apply discounts, with the discount amount returned as voucherAmount in the response.
  • Cancellation Fund: If cancellationFundPossible is true, users may add a cancellation fund at the specified price (cancellationFund), providing additional booking protection.

By using the Get Price endpoint, users can easily calculate the cost of bookings, inclusive of any discounts and optional services. This information helps users make informed booking decisions and manage their travel costs effectively.

Was this article helpful?