All docs This doc
Skip to end of metadata
Go to start of metadata


Overview

The following operations allow you to work with reservations. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with reservations, see Sample configuration

OperationDescription
createReservationCreates a new reservation in the system.
getReservationByIdRetrieves details of a reservation.

listReservations

Retrieves all reservations that either start within the given time period or were entered into the system within the given time period.
searchReservationsSearches all reservations containing the text specified in the query parameter.

Operation details

This section provides further details on the operations related to reservations.

Creating a new reservation

The createReservation operation creates a new reservation in the system.

createReservation
<planyo.createReservation>
	<resourceId>{$ctx:resourceId}</resourceId>
	<startTime>{$ctx:startTime}</startTime>
	<endTime>{$ctx:endTime}</endTime>
	<quantity>{$ctx:quantity}</quantity>
	<isAdminMode>{$ctx:isAdminMode}</isAdminMode>
	<sendNotifications>{$ctx:sendNotifications}</sendNotifications>
	<forceStatus>{$ctx:forceStatus}</forceStatus>
	<sharingMode>{$ctx:sharingMode}</sharingMode>
	<rentalProperties>{$ctx:rentalProperties}</rentalProperties>
	<voucherCode>{$ctx:voucherCode}</voucherCode>
	<email>{$ctx:email}</email>
	<firstName>{$ctx:firstName}</firstName>
	<lastName>{$ctx:lastName}</lastName>
	<address>{$ctx:address}</address>
	<city>{$ctx:city}</city>
	<zip>{$ctx:zip}</zip>
	<state>{$ctx:state}</state>
	<country>{$ctx:country}</country>
	<phonePrefix>{$ctx:phonePrefix}</phonePrefix>
	<phoneNumber>{$ctx:phoneNumber}</phoneNumber>
	<mobilePrefix>{$ctx:mobilePrefix}</mobilePrefix>
	<mobileNumber>{$ctx:mobileNumber}</mobileNumber>
	<userNotes>{$ctx:userNotes}</userNotes>
	<adminNotes>{$ctx:adminNotes}</adminNotes>
	<cartId>{$ctx:cartId}</cartId>
	<firstReservationId>{$ctx:firstReservationId}</firstReservationId>
	<assignments>{$ctx:assignments}</assignments>
</planyo.createReservation>
Properties
  • resourceId: The ID of the resource to be reserved.
  • startTime: Defines the beginning of the rental.
  • endTime: Defines the end of the rental.
  • quantity: The number of units to be reserved.
  • isAdminMode: The Boolean value that defines whether the reservation is made in admin mode; defaults to "false".
  • sendNotifications: The Boolean value that defines whether to send customer notifications; defaults to "true".
  • forceStatus: If left empty, sets the default as per the normal Planyo rules. If set, the initial status will be set to this value.
  • sharingMode: Sets the Sharing mode; valid values are 0,1 and 2.
  • rentalProperties: An object consisting of resource-specific additional fields to be set.
  • voucherCode: Specifies a voucher code for the reservation.
  • email: The e-mail of the user.
  • firstName: The first name of the user.
  • lastName: The last name of the user.
  • address: The address of the user.
  • city: The city of the user.
  • zip: The zip code of the user.
  • state: The state of the user.
  • country: A two-letter country code of the user according to the ISO 3166-1 alpha-2 format.
  • phonePrefix: The user's telephone country code (e.g. 1 for USA and Canada).
  • phoneNumber: The user's telephone number excluding the country code.
  • mobilePrefix: The user's mobile country code (e.g. 1 for USA and Canada).
  • mobileNumber: The user's mobile number without the country code.
  • userNotes: Specifies the user's notes at the time of reservation.
  • adminNotes: Specifies the admin notes at the time of reservation.
  • cartId: Shopping cart identifier; this is only valid if the site works with shopping carts.
  • firstReservationId: Specifies a previous reservation ID belonging to the shopping cart specified by the cart ID parameter.
  • assignments: An object specifying the units to be reserved.
Sample Request

Following is a sample REST/JSON request that can be handled by the createReservation operation.

Sample Request for createReservation
{	"apiUrl":"http://api.planyo.com",
	"apiKey":"794f56460a03fc193ffdf2c45725ad87",
	"version":1,
	"language":"EN",
	"resourceId" : 41476,
	"startTime" : "2015-04-03",
	"endTime" : "2015-04-04",
	"quantity" : 2,
	"isAdminMode" : true,
	"sendNotifications" : true,
	"forceStatus" : 1,
	"sharingMode" : 1,
	"rentalProperties" :{
						"rental_prop_testProperty":"INV1",
						"rental_prop_number_of_children":2
					},
	"voucherCode" : "INV1",
	"email" : "test@test.com",
	"firstName" : "TestFN",
	"lastName" : "TestLN",
	"address" : "111,test,test",
	"city" : "CITY",
	"zip" : "10600",
	"state" : "STATE",
	"country" : "SL",
	"phonePrefix" : "1",
	"phoneNumber" : "114600200",
	"mobilePrefix" : "1",
	"mobileNumber" : "714600200",
	"userNotes" : "MyUserNotes",
	"adminNotes" : "MyAdminNotes",
	"cartId" : "111",
	"firstReservationId" : "222",
	"assignments" : {
					"assignment1":"INV1",
					"assignment2":2
				 }
}
Related Planyo Documentation  

Retrieving details of a reservation

The getReservationById operation retrieves details of a reservation by ID.

getReservationById
<planyo.getReservationById>
	<reservationId>{$ctx:reservationId}</reservationId>
</planyo.getReservationById>
Properties
  • reservationId: The ID of the reservation.
Sample Request

Following is a sample REST/JSON request that can be handled by the getReservationById operation.

Sample Request for getReservationById
{
	"apiUrl":"http://api.planyo.com",
	"language":"EN",
	"apiKey":"45fd0acfee3f0388aeb8e7823179d21d",
	"version":1,
	"reservationId":946246
}
Related Planyo Documentation

https://www.planyo.com/api.php?topic=get_reservation_data

Retrieving all reservations 

The listReservations operation retrieves all reservations that either start within the given time period or were entered into the system within the given time period.

listReservations
<planyo.listReservations>
     <startTime>{$ctx:startTime}</startTime>
     <resourceId>{$ctx:resourceId}</resourceId>
     <sortField>{$ctx:sortField}</sortField>
     <page>{$ctx:page}</page>
     <detailLevel>{$ctx:detailLevel}</detailLevel>
     <userId>{$ctx:userId}</userId>
     <isListByCreationDate>{$ctx:isListByCreationDate}</isListByCreationDate>
     <endTime>{$ctx:endTime}</endTime>
	<mustIncludeTimePoint>{$ctx:mustIncludeTimePoint}</mustIncludeTimePoint>
</planyo.listReservations>
Properties
  • startTime: The beginning of the time period.
  • resourceId: The ID of the resource.
  • sortField: Specifies the sort field. One of: "user", "user_id", "email", "phone", "resource_id", "resource", "reservation_id", "duration".
  • page: The zero-based page number.
  • detailLevel: The sum of one or more of the integer values (i.e. 1 = reservation info, 2 = reservation properties, 4 = pricing info. Default value: 1)
  • userId: The ID of the user.
  • isListByCreationDate: The Boolean value that specifies whether the reservations have been created between the given start time and end time.
  • endTime: The end of time period.
  • mustIncludeTimePoint: Specifies a point in time.
Sample Request

Following is a sample REST/JSON request that can be handled by the listReservations operation.

Sample Request for listReservations
{
	"apiUrl":"http://api.planyo.com",
	"language":"EN",
	"apiKey":"45fd0acfee3f0388aeb8e7823179d21d",
	"version":1,
	"startTime":"2015-02-07",
	"resourceId":41456,	
	"sortField":"user_id",
	"page":0,
	"detailLevel":1,
	"userId":"U469771",
	"isListByCreationDate":"false",	
	"endTime":"2015-03-10",
	"mustIncludeTimePoint":"2015-02-08"
}
Related Planyo Documentation

https://www.planyo.com/api.php?topic=list_reservations

Searching all reservations containing the text specified in the query parameter

The searchReservations operation searches all reservations containing the text specified in the query parameter. 

searchReservations
<planyo.searchReservations>
	<sortField>{$ctx:sortField}</sortField>
    <query>{$ctx:query}</query>
</planyo.searchReservations>
Properties
  • sortField: Specifies the sort field. One of: "user", "user_id", "email", "phone", "resource_id", "resource", "reservation_id", "duration".
  • query: The search query. Specifying more than one word narrows down the search results.
Sample Request

Following is a sample REST/JSON request that can be handled by the searchReservations operation.

Sample Request for searchReservations
{
	"apiUrl":"http://api.planyo.com",
	"apiKey":"794f56460a03fc193ffdf2c45725ad87",
	"version":1,
	"language":"EN",
	"query" : "My R",
	"sortField" : "user_id"
}
Related Planyo Documentation

https://www.planyo.com/api.php?topic=reservation_search

Sample Configuration

Following is a sample proxy service that illustrates how to connect to Planyo with the init operation and use the createReservation operation. The sample request for this proxy can be found in the createReservation sample request. You can use this sample as a template for using other operations in this category.

Sample proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="planyo_createReservation" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
	<target>
		<inSequence>
			<property name="apiUrl" expression="json-eval($.apiUrl)" />
			<property name="apiKey" expression="json-eval($.apiKey)" />
			<property name="version" expression="json-eval($.version)" />
			<property name="language" expression="json-eval($.language)" />
			<property name="resourceId" expression="json-eval($.resourceId)" />
			<property name="startTime" expression="json-eval($.startTime)" />
			<property name="endTime" expression="json-eval($.endTime)" />
			<property name="quantity" expression="json-eval($.quantity)" />
			<property name="isAdminMode" expression="json-eval($.isAdminMode)" />
			<property name="sendNotifications" expression="json-eval($.sendNotifications)" />
			<property name="forceStatus" expression="json-eval($.forceStatus)" />
			<property name="sharingMode" expression="json-eval($.sharingMode)" />
			<property name="rentalProperties" expression="json-eval($.rentalProperties)" />
			<property name="voucherCode" expression="json-eval($.voucherCode)" />
			<property name="email" expression="json-eval($.email)" />
			<property name="firstName" expression="json-eval($.firstName)" />
			<property name="lastName" expression="json-eval($.lastName)" />
			<property name="address" expression="json-eval($.address)" />
			<property name="city" expression="json-eval($.city)" />
			<property name="zip" expression="json-eval($.zip)" />
			<property name="state" expression="json-eval($.state)" />
			<property name="country" expression="json-eval($.country)" />
			<property name="phonePrefix" expression="json-eval($.phonePrefix)" />
			<property name="phoneNumber" expression="json-eval($.phoneNumber)" />
			<property name="mobilePrefix" expression="json-eval($.mobilePrefix)" />
			<property name="mobileNumber" expression="json-eval($.mobileNumber)" />
			<property name="userNotes" expression="json-eval($.userNotes)" />
			<property name="adminNotes" expression="json-eval($.adminNotes)" />
			<property name="cartId" expression="json-eval($.cartId)" />
			<property name="firstReservationId" expression="json-eval($.firstReservationId)" />
			<property name="assignments" expression="json-eval($.assignments)" />
			<planyo.init>
				<apiUrl>{$ctx:apiUrl}</apiUrl>
				<language>{$ctx:language}</language>
				<apiKey>{$ctx:apiKey}</apiKey>
				<version>{$ctx:version}</version>
			</planyo.init>
			<planyo.createReservation>
				<resourceId>{$ctx:resourceId}</resourceId>
				<startTime>{$ctx:startTime}</startTime>
				<endTime>{$ctx:endTime}</endTime>
				<quantity>{$ctx:quantity}</quantity>
				<isAdminMode>{$ctx:isAdminMode}</isAdminMode>
				<sendNotifications>{$ctx:sendNotifications}</sendNotifications>
				<forceStatus>{$ctx:forceStatus}</forceStatus>
				<sharingMode>{$ctx:sharingMode}</sharingMode>
				<rentalProperties>{$ctx:rentalProperties}</rentalProperties>
				<voucherCode>{$ctx:voucherCode}</voucherCode>
				<email>{$ctx:email}</email>
				<firstName>{$ctx:firstName}</firstName>
				<lastName>{$ctx:lastName}</lastName>
				<address>{$ctx:address}</address>
				<city>{$ctx:city}</city>
				<zip>{$ctx:zip}</zip>
				<state>{$ctx:state}</state>
				<country>{$ctx:country}</country>
				<phonePrefix>{$ctx:phonePrefix}</phonePrefix>
				<phoneNumber>{$ctx:phoneNumber}</phoneNumber>
				<mobilePrefix>{$ctx:mobilePrefix}</mobilePrefix>
				<mobileNumber>{$ctx:mobileNumber}</mobileNumber>
				<userNotes>{$ctx:userNotes}</userNotes>
				<adminNotes>{$ctx:adminNotes}</adminNotes>
				<cartId>{$ctx:cartId}</cartId>
				<firstReservationId>{$ctx:firstReservationId}</firstReservationId>
				<assignments>{$ctx:assignments}</assignments>
			</planyo.createReservation>
			<respond />
		</inSequence>
		<outSequence>
			<send />
		</outSequence>
	</target>
	<description />
</proxy>                              
  • No labels