API - Planyo Web Services - make_reservation

You are here: Planyo » Help » API » make_reservation



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
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 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).
force_status ReservationStatus optional
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.
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)
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
User's address
city string optional
User's city
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).
agent_id string optional
Optionally you can assign the new reservation to an existing agent whose user ID you can pass in this parameter.
creation_time DateTime optional
You can optionally pass an alternative creation time for this reservation.
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.
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.
admin_id int optional
Optionally you can assign the reservation creation to a specific administrator/moderator by passing their user id. The administrator must have access to the resource being reserved.
add_to_waitlist bool optional
Use this parameter only when waiting list is enabled for the resource. If this parameter is set to true and the resource is no longer available, the function will add a reservation request to the waiting list instead of returning an error message
method string required
must be set to make_reservation
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.


reservation_id int
Returns the ID of the newly created reservation (if successful).
shopping_cart_id int
Shopping cart ID. It's returned only for shopping cart reservations.
user_text string
Text to be displayed to the user with the status of their reservation
status ReservationStatus
Status of the new booking
total_price float
Total price for this reservation.
original_price float
Originally quoted price.
currency string
Currency used.
discount float
Discount from vouchers used (if any).
properties array
All custom reservation form items set for this reservation. This is an array whose key is property name.

API playground:

Click here to test this function in the API playground.