als_insert_voucher.cgi

Top 

Description

The als_insert_voucher.cgi interface inserts a new voucher just like if a user was entering a voucher using the AL-Pro client. There is quite a bit of data validation contained in the als_insert_voucher.cgi call in order to make sure that only clean data is processed and accepted by AL-Pro.

 

Since vouchers can contain multiple products and rates, the als_insert_voucher.cgi allows for multiple pricing codes and quantities to be processed. All products MUST be from the same vendor and a check is done to insure that any pricing codes all come from the same vendor.

 

As is normal for all Put calls a valid webusercode is required.

 

 

Description of Required Inputs

 

A webusercode:Integer must be included that represents the Web Interface user code supplied to you by Activity Link Systems.

A client:Integer must be included that represents the client code:integer from the clients table.

An activitydate:Date must be included that represents the date of the activity.

An activitytime:time must be included that represents the time of the activity.

 

Description of Optional Inputs

An optional notes:string field is allowed for description and informational text.

 

Description of Variable Rate Inputs

Any activity has an associated vendor rate with it. These rates can be gathered from the als_get_rates.cgi. Rates may vary for adults, children and infants for instance so there may indeed be multiple rates on a single voucher.

 

The count:Integer param must be included that signifies the number of rates included on the voucher.

 

For each rate included there must be 2 other params of pricingcode and quantity (abbreviated as qty).

 

To identify each pricing code and quality an ordinal number must be appended to it. An example of valid inputs is presented below showing 2 rates for a party of 3.

 

Count=2

pricingcode1=358

qty1=2

pricingcode2=360

qty2=1

 

Note:When count=XX  there must be 1..Count number of pricingCodeXX and qtyXX pairs or an error will be returned.

 

 

 

 

Example Usage          

 

http://127.0.0.1/als_insert_voucher.cgi?pricingcode1=358&pricingcode2=360&count=2&client=100437&webusercode=1&activitydate=2005-05-31&activitytime=10:00&qty1=1&qty2=3

 

 

 

 

Inputs

Parameter

Description

Required

Example

Data Type

webusercode

Code from WiUsers required for insert access

 

Required

webusercode=5

Integer

client

Code of the Client

 

Required

client=1001

Integer

activitydate

date of the activity

Required

activitydate=2005-12-25

 

Date

activitytime

time of the activity

 

Required

time=10:00

Time

notes

Free Text field

 

Optional

wheelchair access required

String

count

Number of Rates

 

Required

count=2

Integer

pricingcodeXX

Value representing the pricing code for this rate

 

Required

pricingcode1=358

Integer

qtyXX

A quantity of the pricing code.

 

Required

qty1=1

Integer

 

 

Returned Fields

#

Field Name

Description

Data Type

1

 

 

 

 

 

 

 

 

XML Example

 

 

<?xml version="1.0" encoding="utf-8" ?>

- <vouchers>

- <Inputs>

<Param pricingcode1="358" />

<Param pricingcode2="360" />

<Param count="2" />

<Param client="100437" />

<Param webusercode="1" />

<Param activitydate="2005-05-31" />

<Param activitytime="10:00" />

<Param qty1="1" />

<Param qty2="3" />

</Inputs>

- <data>

<row vendorname="Maui Downhill" vendorcode="13" pricingcode="358" prodratecode="188" productcode="72" pricingrate="150" netrate="109.37" totaltax="6.25" ratewithtax="156.25" commission="46.88" ratewithtax_1="156.25" productname="Super Day Tour" prodrateuseswebinterface="True" />

<row vendorname="Maui Downhill" vendorcode="13" pricingcode="360" prodratecode="191" productcode="73" pricingrate="57.6" netrate="42" totaltax="2.4" ratewithtax="60" commission="18" ratewithtax_1="60" productname="Van Rider" prodrateuseswebinterface="True" />

</data>

</vouchers>