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

The listVouchers operation retrieves all vouchers.

listVouchers
<planyo.listVouchers>
    <rentalStartTime>{$ctx:rentalStartTime}</rentalStartTime>
    <rentalEndTime>{$ctx:rentalEndTime}</rentalEndTime>
    <resourceId>{$ctx:resourceId}</resourceId>
    <siteId>{$ctx:siteId}</siteId>
    <voucherCodePrefix>{$ctx:voucherCodePrefix}</voucherCodePrefix>
	<isCheckReservationTime>{$ctx:isCheckReservationTime}</isCheckReservationTime>
</planyo.listVouchers>
Properties
  • rentalStartTime: Returns the rental to start on the specified date.
  • rentalEndTime: Returns the rental to end on the specified date.
  • resourceId: Lists vouchers which can be used for this resource ID.
  • siteId: Lists vouchers compatible with multiple resources when setting the site ID and not specifying any resource ID.
  • voucherCodePrefix: Lists only vouchers starting with the given code when you enter a voucher code or just a voucher code prefix. 
  • isCheckReservationTime: If "true", returns only vouchers used for reservations entered at the time of making this call.
Sample request

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

Sample Request for listVouchers
{
	"apiUrl":"http://api.planyo.com",
	"apiKey":"d3314e7094e0ad10714156181eff0cf4",
	"version":1,
	"language":"EN",
	"rentalStartTime":"2015-03-18",
	"rentalEndTime":"2015-02-28",
	"resourceId":41474,
	"siteId":17231,
	"voucherCodePrefix":"VOC",
	"isCheckReservationTime":true
}
Related Planyo documentation

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

Sample configuration

Following is a sample proxy service that illustrates how to connect to Planyo with the init operation and use the listVouchers operation. The sample request for this proxy can be found in the listVouchers 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_listVouchers"
       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="rentalStartTime" expression="json-eval($.rentalStartTime)"/>
         <property name="rentalEndTime" expression="json-eval($.rentalEndTime)"/>
         <property name="resourceId" expression="json-eval($.resourceId)"/>
         <property name="siteId" expression="json-eval($.siteId)"/>
         <property name="voucherCodePrefix" expression="json-eval($.voucherCodePrefix)"/>
         <property name="isCheckReservationTime" expression="json-eval($.isCheckReservationTime)"/>
         <planyo.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <apiKey>{$ctx:apiKey}</apiKey>
            <version>{$ctx:version}</version>
            <language>{$ctx:language}</language>
         </planyo.init>
         <planyo.listVouchers>
            <rentalStartTime>{$ctx:rentalStartTime}</rentalStartTime>
            <rentalEndTime>{$ctx:rentalEndTime}</rentalEndTime>
            <resourceId>{$ctx:resourceId}</resourceId>
            <siteId>{$ctx:siteId}</siteId>
            <voucherCodePrefix>{$ctx:voucherCodePrefix}</voucherCodePrefix>
            <isCheckReservationTime>{$ctx:isCheckReservationTime}</isCheckReservationTime>
         </planyo.listVouchers>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>                                                                                                                                          
  • No labels