make_reservation (version 1)
Enters a new reservation into the system. The ID of the new reservation is available in 'reservation_id' in case of success. If you're using the PRO-COMM payment model, the commission will be calculated for API-entered reservations.
resource_id int required
ID of the resource
Beginning of rental
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 reservation will be entered in the admin mode meaning that the required fields (as defined in the reservation form) will not be required, except for the first name and reservation dates/times. Also other restrictions set in resource settings will not be checked and the email verification step (if used in the resource) will be skipped. The default value is false
send_notifications bool optional
If set to true
(default), the customer notifications will be sent, otherwise the initial notifications will be blocked (similar as the 'Send emails to client' checkbox in the reservation form when entering a reservation as the administrator).
If left empty, the default status will be set, as per the normal Planyo rules. If set, the initial status will be set to this value.
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)
rental_prop_voucher string optional
You can apply a voucher code to the reservation by using this parameter. This will apply the voucher discount to the price.
custom_price string optional
You can use this parameter to set a custom price for the reservation. If not specified, Planyo will calculate the price for you using your pricing manager rules. Note that this parameter cannot be used together with 'rental_prop_voucher'.
user_id int optional
Optionally you can pass an existing user ID for the reservation. If you don't do this, planyo will identify the user ID by their email address.
email string required
User's email address. This field is obligatory only if user_id
is not set.
first_name string required
User's first name. This field is obligatory only if user_id
is not set.
last_name string optional
User's last name
address string optional
city string optional
zip string optional
Zip or postal code
state string optional
State or province
country string optional
Two-letter country code (ISO 3166-1 alpha-2)
phone_prefix string optional
Phone country code (e.g. 1 for USA and Canada)
phone_number string optional
Phone number (excluding country code)
mobile_prefix string optional
Mobile country code (e.g. 1 for USA and Canada)
mobile_number string optional
Mobile number (excluding country code)
user_notes string optional
User's notes at the time of reservation
admin_notes string optional
Admin notes at the time of reservation
refcode string optional
Referer code. You can use it in order to track the original source of the booking. This value will be later visible in reservation details and available as the tag $(refcode).
cart_id int optional
This parameter can be only used if your site works with shopping carts, you can then optionally pass an existing shopping cart ID. Otherwise a new cart will be created. Note: if you pass this parameter you must also pass ID of a previous reservation belonging to the same shopping cart in the first_reservation_id
assignment1 string optional
If the resource has named units, then you can specify the unit to be reserved here. If reserving more than one unit, pass the other ones in assignment2, assignment3, etc.
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
Returns the ID of the newly created reservation (if successful).
Text to be displayed to the user with the status of their reservation
Status of the new booking
Total price for this reservation.
Originally quoted price.
Discount from vouchers used (if any).
All custom reservation form items set for this reservation. This is an array whose key is property name.
Click here to test this function in the API playground.