API - Planyo Web Services - get_rental_price

Ti trovi qui: Planyo » Aiuto » API » get_rental_price

get_rental_price

Description:

Returns the price of a rental for given resource and start/end times. Price is returned even if resource is not available in given period (because of vacations defined or existing reservations).

Note that if you want to fetch prices for multiple periods (up to 50), you can pass optional parameters start_time_x and end_time_x (e.g. start_time_2=...&end_time_2=...&start_time_3=...&end_time_3=....) where x is in range from 2 to 50. In such case the output will include extra_times with the prices for the extra times. You can also customize result number x by passing quantity_x, resource_id_x, shopping_cart_position_x, rental_prop_x_YYY

Input:

resource_id int required
ID of the resource
start_time DateTime required
Beginning of rental. Can be a timestamp or text.
end_time DateTime required
End of rental. Can be a timestamp or text. In case of whole-day reservations, enter either the date following the rental date without time or the actual end date with the hour set to 23:59. E.g. for the entire day: 1st of January 2013, enter 2013-01-01 23:59:00 as the end time. In case of night reservations (e.g. accommodations), enter the departure date without any time. E.g. to reserve a single night of the 1st of January 2013, enter 2013-01-02 (=departure date).
quantity int required
Number of units
admin_mode bool optional
If set to true, the response will be given for the admin and not for a regular customer. This normally makes no difference, except when using a custom pricing script which returns different pricing for the admins. The default value is false.
rental_prop_xyz string optional
Resource-specific additional fields (defined in the admin panel in the Reservation form layout). E.g. if you define additional reservation property 'number of children', this should be passed as rental_prop_number_of_children (where '_' replaces all space characters). You can also pass the voucher code in rental_prop_voucher.
shopping_cart_position int optional
Corresponds to the pricing manager rule 'Position in the shopping cart'. You can set this if making a query for an item which would be placed in a shopping cart at given position
shopping_cart_resource_quantity int optional
Corresponds to the pricing manager rule 'Total resource quantity in cart'. You can pass this if making a query for an item which would be a part of a shopping cart
shopping_cart_resource_hours float optional
Corresponds to the pricing manager rule 'Total hours in shopping cart'.
shopping_cart_total_price float optional
Corresponds to the pricing manager rule 'Total price of shopping cart'.
wants_share SharingMode optional
Set the desired sharing mode (used only when sharing is possible)
user_id int optional
You can optionally pass the user ID of a customer if your pricing depends on user properties. Note: if you only know the user's email address, you can pass it instead in the user_email parameter.
method string required
must be set to get_rental_price
language string optional
by specifying a 2-letter (ISO 639-1) language code (all capital letters e.g. EN, DE, FR, ES, IT) you can change the language of the text values returned
api_key string required
your API key - Click here to get your key. If your API key uses a hash key, you must also include the parameters hash_key and hash_timestamp.

Output:

currency string
Currency in which the price is expressed (3-letter ISO 4217 code)
total float
Total price
pricing_log_applied_rules array
A detailed listing of the pricing manager rules being applied
pricing_log_products array
A detailed listing of additional products added by default and included in the price

API playground:

Click here to test this function in the API playground.