API - Planyo Web Services - can_make_reservation

Jesteś tutaj: Planyo » Pomoc » API » can_make_reservation

can_make_reservation (version 1)

Description:

Returns true if reservation can be made or false if it's not possible. A reservation may not be possible because of lack of availability or because of other constraints such as required start/end weekday, not enough free time after previous rental etc.

Input:

resource_id int required
ID of the resource
start_time DateTime required
Beginning of rental
end_time DateTime required
End of rental. 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. to reserve 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, meaning that for example dates which are vacationed will still be reservable. This is the same as when the administrator makes a reservation using the UI (the conditions are much less strict as for regular customers). The default value is false.
wants_share SharingMode optional
Set the desired sharing mode (used only when sharing is possible)
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)
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.
return_availability bool optional
If set to true, the output will include the key is_resource_available which will indicate whether the resource is available during the period requested (this is the same as calling the is_resource_available API function with the same parameters). Please note that it's possible for a resource to be available but not reservable because of one or more restrictions. By default availability information is not returned.
return_price bool optional
If set to true, the output will include the key price (float) which will indicate the price for given resource, period and all other parameters (same price as you can get by calling the get_rental_price API function with the same parameters). By default price information is not returned. Price will not be returned if the resource cannot be reserved unless the value of return_price is set to force.
version float optional
you can optionally specify the version of the API that you're using. Use the value of latest or simply skip this parameter to use the latest API version. The latest version is: 1
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:

is_reservation_possible bool
True if reservation can be made or false otherwise.
problem_time DateTime
If resource is not available, this indicates the first conflicting hour
reason string
Explanation of why a reservation cannot be made (if is_reservation_possible is false) that can be displayed to the end user

API playground:

Click here to test this function in the API playground.