Rezgo XML API Implementation Guide
Rezgo XML API Implementation Guide
rezgo
XML Gateway API - Implementation Manual
Copyright ©2009
1 of 37
Sentias Software Corp. Rezgo XML API Implementation
Revision History
Primary Author Description Rezgo Version API Doc Version Date
Jeffrey Qua Rezgo API – Tour Module Implementation 3.8.5 1.0 08 May 2008
Jeffrey Qua Rezgo API – Revision 3.8.5 1.1 08 May 2008
Jeffrey Qua Rezgo API – Major Functionality Revision 4.0.0 2.0 28 Oct 2008
Jeffrey Qua Rezgo API – Revision 4.1.4 2.1 02 Mar 2009
Jeffrey Qua Rezgo API – Revision 4.1.4 2.2 13 Mar 2009
Jeffrey Qua Rezgo API – Revision/XML Changes 4.7.0 2.3 02 Nov 2009
Miyuki Shiomi Rezgo API – Revision/XML Changes 4.8.0 2.4 12 Nov 2009
Revision Notes
Implentation v2.3/2.4 - Rezgo Version 4.8.0 (XML changes)
-group pricing, re-check item details on Booking Details page(4.8)
-modifications to i=search_items query, i=month query(4.7)
-external XML queries now require use of valid API key (4.2)
Copyright ©2009
2 of 37
Sentias Software Corp. Rezgo XML API Implementation
Table of Contents
Before You Start............................................................................................................................................................... 4
Introduction...................................................................................................................................................................... 4
Site Template.................................................................................................................................................................... 4
General Tracking Code.............................................................................................................................................................. 5
Company Name............................................................................................................................................................................ 5
About.................................................................................................................................................................................. 6
Contact................................................................................................................................................................................ 7
Tour Module...................................................................................................................................................................... 9
Main Page..................................................................................................................................................................................... 9
Tags............................................................................................................................................................................................. 10
Tagged Products...................................................................................................................................................................... 10
Item Page................................................................................................................................................................................... 12
Calendar..................................................................................................................................................................................... 16
Booking Details ........................................................................................................................................................................ 18
Payment Details ....................................................................................................................................................................... 24
Commit ........................................................................................................................................................................... 28
Transaction Details .................................................................................................................................................... 30
Searching ........................................................................................................................................................................ 33
Date Search................................................................................................................................................................................ 33
Advanced Search...................................................................................................................................................................... 35
Voucher ........................................................................................................................................................................... 37
Copyright Notice
This document and the software to which it refers to is copyrighted by Sentias Software Corp. Use of this documentation
and the software to which it refers is subject to the acceptance of the Terms of Use referenced in this documentation
and available online at http://www.rezgo.com. All rights reserved. All other trademarks, and registered trademarks
are the property of their respective owners.
Copyright ©2009
3 of 37
Sentias Software Corp. Rezgo XML API Implementation
Introduction
To explain the implementation of the booking server process, we will go through each step of the booking
process on Rezgo. During each step, we will examine the gateway calls made and how the response is used in
the implementation of the interface. If you require any in-depth explanation of calls, please refer to the API
Reference Manual. At this point, we assume you have a general understanding of the XML Gateway, as well as
a basic understanding of the Rezgo Admin System where you can modify your site settings. All examples in
this document will use transcode=1 as our test company. The transcode/company id can be found in Rezgo
Admin > Settings. Any external queries also require a valid API key, and added with the key parameter.
The API Key is required for third-party parsers and can be located for each Rezgo client in Rezgo Admin >
Settings.
This is an example of our implementation, you may implement your system in a different layout and flow to
achieve the same results. However, the commit query data must be the same to create proper bookings.
Site Template
The Rezgo front-end pages are split into 3 vertical sections: the header, the page content, and the footer.
This is the same for all pages in the site. Every page is set so that the template data is retriever from the
i=headers query before the content is generated. The template data is set in Rezgo Admin > Settings > My
Site Template.
Headers query:
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=headers
The XML returns the template in two XML variables: header and footer. The system separates the two from
the location of the [rezgo] tag. Everything above is set as the header and everything after is set in after. The
following example is using the default Rezgo template.
Copyright ©2009
4 of 37
Sentias Software Corp. Rezgo XML API Implementation
[template.jpg]
If a General Tracking Code has been set in Rezgo Admin > Settings > My Rezgo Analytics, you would also grab
that code from the same query above and use the code in analytics_general and paste that into the code of
any pages that you want to be tracked.
Company Name
The name of the company ‘Booking Server Test’ is found in the i=company query, we will cover this more in
depth in the Contact section.
Copyright ©2009
5 of 37
Sentias Software Corp. Rezgo XML API Implementation
About
http://testcompany.rezgo.com/about
The About page uses the i=about query to obtain the information about the company. The site introduction,
about us text, and terms and conditions data are located in Rezgo Admin > Settings > My Site Pages.
About query:
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=about
The about text is taken from the about field from the i=about query.
[about.jpg]
The intro text is displayed on the main tour page. (Refer to Tour Module > Main Page)
Copyright ©2009
6 of 37
Sentias Software Corp. Rezgo XML API Implementation
Contact
http://testcompany.rezgo.com/contact
The contact page is a generic contact form used to send form content as an e-mail query. The company
address information is taken from the i=company query. You can change your company contact information
in Rezgo Admin > Settings > My Company Profile.
Company query:
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=company
[contact.jpg]
Copyright ©2009
7 of 37
Sentias Software Corp. Rezgo XML API Implementation
You can also display other company information that we have chosen not to show like fax, and email.
Copyright ©2009
8 of 37
Sentias Software Corp. Rezgo XML API Implementation
Tour Module
http://testcompany.rezgo.com/tour
This is a step-by-step walkthrough of viewing tours going through to a complete booking. We will show
queries to get data, send data, and the different possibilities of received data depending on what has been
sent.
Main Page
Our main tour page displays site introduction, tags, and a list of tours. We get a list of all tours using the
i=search_items query using a wildcard search. For vendors, there is also an option to indicate which tours
are ‘featured’.
[tours.jpg]
Site introduction may describe your tour or site. The site introduction information is taken from the i=about
query. You can create and manage your site introduction in Rezgo Admin > Settings > My Site Pages.
Your items are managed from your inventory located at: Rezgo Admin > Tours > Inventory. You may also
create rules to be applied to the items at Rezgo Admin > Tours > Rules to create complex availability and
pricing guidelines to further refine your item information.
Copyright ©2009
9 of 37
Sentias Software Corp. Rezgo XML API Implementation
Items may also be organized using tags to classify the type of tour and is fully customized by the Rezgo user.
You can create and manage your tags in Rezgo Admin > Tours > Categories. (pending rename to Tags).
In order to get the list of tags (for the tag cloud), we must iterate through all the tag nodes from the i=tags
query response. From each node, we can grab the tag properties.
You can also create special trigger codes or promotional codes in the Rules to enable a different rule set
than what is set normally. This can be used like a coupon code to enable discounts if your users know the
promotional code.
If you want to pass a promotional code to the gateway to activate a rule, you must pass it as the variable
trigger_code in your search_items query, month query, as well as the commit query.
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=about
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=search_items&t=name&a=group&q=*
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=search_items&t=name&a=group,featured&q=*
Tags
We can obtain the data for the tags being used with the following query:
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=tags
The query returns all the tags being used and information related to each tag like the tag id, and the count
of how many items use that tag.
Copyright ©2009
10 of 37
Sentias Software Corp. Rezgo XML API Implementation
Tagged products
http://testcompany.rezgo.com/tag/Walking+Tours
We can also list tours for a tag we have chosen. We obtain the data for these tours using the following query.
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=search_items&t=category&a=group&q=12
This query searches for the items with the search_items query. It returns any items having a tag with uid of
12.
Since we have set a=group, the result we receive from the XML contains ONE instance of each tour, so you
only get one result from each tour group.
If a=group is not set, then the result we receive from the XML contains ALL instances of each tour AND
time/tour option, so you will get multiple results for each tour.
The item image is available if the item image flag is set to 1. If it is available, then the image for the item
can be accessed at the following URL format:
http://images.rezgo.com/items/<company_id>-<common_id>.jpg.
Copyright ©2009
11 of 37
Sentias Software Corp. Rezgo XML API Implementation
Item Page
http://testcompany.rezgo.com/tour/6573/Awesome-Tour
http://testcompany.rezgo.com/tour/6573/Awesome-Tour/6573/2009-03-03
The following are examples of the item page with no date set, and with a date set.
[tour.jpg]
The item description contains tour information like descriptions and notes in the main item node as well as
children nodes such as schedule, details, image_gallery, and video_gallery.
If we pass a date, then we use a query like the following to obtain all the availability information for the tour
with the matching common id for that day.
The rules to enable promotional codes and set the change in pricing and availability it triggers is found in
Rezgo Admin > Tours > Rules > Details.
Copyright ©2009
12 of 37
Sentias Software Corp. Rezgo XML API Implementation
Search_items query:
http://xml.rezgo.com/xml? key=REZGO_API_KEY&transcode=1&i=search_items&t=com&q=*
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=search_items&t=com&q=6573&d=2009-03-03
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=search_items&t=com&q=6573&d=2009-03-
31&trigger_code=discount20
[tourWithDate.jpg]
Copyright ©2009
13 of 37
Sentias Software Corp. Rezgo XML API Implementation
[tourWithDateAndPromo.jpg]
Copyright ©2009
14 of 37
Sentias Software Corp. Rezgo XML API Implementation
Please note that you will have to figure out how to display your requirements for each item if any of the
requirement flags are active. eg (per, adult_required, child_required, senior_required, price4_required,
price5_required, price6_required, price7_required, price8_required, price9_required).
Copyright ©2009
15 of 37
Sentias Software Corp. Rezgo XML API Implementation
Calendar
http://testcompany.rezgo.com/tour/6573/Awesome-Tour/6573/2009-03-03
The following two images are of the availability calendar. The first image is the default view, and the second
one depicts specific availability for a day that the user has clicked.
[calendar.jpg]
[calendarDateSelected.jpg]
Copyright ©2009
16 of 37
Sentias Software Corp. Rezgo XML API Implementation
Calendar query:
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=month&g=1&q=6573&d=2009-03-01
This query obtains the overall availability for each item within the day for the specified month. It is up to
you to determine to show if it is available or not. If the XML returns with an attribute value of inactive i,
unavailable u, past date p, or cutoff c, we have chosen to display it as greyed out with no availability.
Otherwise, the date node will return with an attribute value of active a. The popup availability functionality
uses the same data and display the date, item time, and available spots.
Copyright ©2009
17 of 37
Sentias Software Corp. Rezgo XML API Implementation
Booking Details
https://testcompany.rezgo.com/tour
The URL for the booking details page is /tour.php because we re-route to a secure https server and pass the
booking information via POST.
We pass relevant chosen item information such as the date, item uid, and item name. We also pass the
number of spots the user has requested for each price option. Please note that not all the variables passed
are required. Some of the variables are passed so that the server does not need to send more queries to
request information that hasn’t changed.
Some information is not passed either because they are not required, such as price4 – price9 options since we
did not book any, and the item itself does not allow booking for the price options either.
The following tables are examples of what we send to the booking details page from the item page:
At this point, you should pass a query to search_items with the number of spots being booked to re-check if
any group pricing rules change the prices and to retrieve the details for the item.
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=search_items&t=com&q=6573&d=2009-03-
03&adult_num=1&child_num=1
Copyright ©2009
18 of 37
Sentias Software Corp. Rezgo XML API Implementation
[booking_details_summary.jpg]
On this page, we show a summary subtotal to the user to indicate what the approximate cost of the booking
should cost. The user should then be provided a form to enter their billing info, and their passenger info. The
billing info is required for ALL bookings. The only field that is optional is the Address2 field.
The passenger information is optional unless the the group field for the booked item (using the
i=search_items query) is set to require.
Copyright ©2009
19 of 37
Sentias Software Corp. Rezgo XML API Implementation
[booking_detailsFilled.jpg]
This page shows triggerable fees as selected as they are required in this case and must be chosen. These
triggerable fees are added on to the total on the next page. Other triggerable fees may not be required and
given as options to let the customer choose what kind of extras or customizations they want. Triggerable fees
may be positive or negative.
Copyright ©2009
20 of 37
Sentias Software Corp. Rezgo XML API Implementation
The information for these forms is taken from the i=search_items query as the forms field. We can see the
difference here as the Deluxe Dinner option as required (indicated by the red star), and shown to each
passenger, while the Special requests form is optional and is only shown under Additional Information so it
presents it only once for the whole booking. The forms can be examined by the following node
representations.
The special requests form under “Additional Information” is a form that is only shown once to the group. It is
a choice that only the person making the booking, usually the primary passenger, needs to choose. These are
usually options for the whole group.
Copyright ©2009
21 of 37
Sentias Software Corp. Rezgo XML API Implementation
In addition to all the item booking data passed through POST, we now include the passenger information
entered on this page.
We pass the passenger form information in the following format (in HTML form POST) for our own
convenience, you should implement these by your own preference.
This is an example POST data return from submitting the booking details form.
Copyright ©2009
22 of 37
Sentias Software Corp. Rezgo XML API Implementation
Array
(
[item] => 6573
[date] => 2009-03-03
[promo_code] =>
[book] => 2
[price1_num] => 1
[price2_num] => 1
[billing] => Array
(
[first_name] => Sentias
[last_name] => Software
[address1] => 92 Lonsdale Ave.
[address2] => Suite 200
[city] => North Vancouver
[state] => BC
[country] => ca
[postal_code] => V7M2E6
[phone] => 604-983-0083
[email] => [email protected]
)
[passenger] => Array
(
[price1_num] => Array
(
[1] => Array
(
[first_name] => Big
[last_name] => Bird
[phone] =>
[email] =>
[forms] => Array
(
[1234] => on
)
)
)
[price2_num] => Array
(
[1] => Array
(
[first_name] => Elmo
[last_name] =>
[phone] =>
[email] =>
[forms] => Array
(
[1234] => on
)
)
)
)
Copyright ©2009
23 of 37
Sentias Software Corp. Rezgo XML API Implementation
Payment Details
https://testcompany.rezgo.com/tour
Like the Booking Details page, we use a secure https server and pass the booking information via POST.
All the information passed to this page is outlined in the previous section with all the billing information,
passenger data, and group information. The billing information is mostly self explanatory, but I will explain
the format of the passenger and group data.
Price option - can take on the following values: price1_num, price2_num, price3_num, price4_num,
price5_num, price6_num, price7_num, price8_num, price9_num
Example:
The first name of the first Adult – passenger[price1_num][1][first_name]
The email of the third Child – passenger[price2_num][3][email]
Our Payment Details page recaps the cost of the booking, including any new costs incurred by triggerable
fees, as well as calculating the cost of taxes.
[payment_details_summary.jpg]
Copyright ©2009
24 of 37
Sentias Software Corp. Rezgo XML API Implementation
[payment_booking_details.jpg]
Copyright ©2009
25 of 37
Sentias Software Corp. Rezgo XML API Implementation
After summarizing all the previous information, we present to the user the different payment options.
Your payment options can be set in Rezgo Admin > Settings > My Payment Methods.
[payment_details.jpg]
The terms and conditions are obtained from the i=company query, and can be set in Rezgo Admin > Settings
> My Site Pages.
If the booking is being processed by credit card, then the fields in the image shown above are required. The
CVV number may or may not be required, depending on the gateway. You can determine if it is required for
the booking if the get_cvv field is set to 1 in the i=company query. For any manual payment, there is no
need to pass any information.
Copyright ©2009
26 of 37
Sentias Software Corp. Rezgo XML API Implementation
payment_method: this can either be Credit Cards, PayPal (if you accept it), or anything you input in to the
Manual Payment fields (eg. Cheques).
If the payment_method is set to Credit Cards, then we have to record the details of the credit card. Refer
to the following chart for details.
The following is only necessary if the chosen payment methods is Credit Cards
Copyright ©2009
27 of 37
Sentias Software Corp. Rezgo XML API Implementation
Commit
Upon submission of this form, we submit the commit query to the server. Our sample query for the
transaction is:
https://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=commit&date=2009-03-
03&book=6573&trigger_code=&adult_num=1&child_num=1&tour_first_name=Sentias&tour_last_name=Softwa
re&tour_address_1=92+Lonsdale+Ave.&tour_address_2=Suite+200&tour_city=North+Vancouver&tour_statepro
v=BC&tour_country=ca&tour_postal_code=V7M2E6&tour_phone_number=604-983-
0083&tour_email_address=info%40sentias.com&tour_group[adult][1][first_name]=Big&tour_group[adult][1]
[last_name]=Bird&tour_group[adult][1][phone]=&tour_group[adult][1][email]=&tour_group[adult][1][forms]
[1234]=on&tour_group[child][1][first_name]=Elmo&tour_group[child][1][last_name]=&tour_group[child][1]
[phone]=&tour_group[child][1][email]=&tour_group[child][1][forms]
[1234]=on&tour_forms[1233]=How+to+get+to+Sesame+St
%3F&payment_method=Credit+Cards&tour_card_name=Sentias+Software&tour_card_type=Visa&tour_card_nu
mber=4111111111111111&tour_card_expiry_month=12&tour_card_expiry_year=10&tour_card_cvv=123&agree
_terms=1
Please note that agree_terms=1 MUST be set to confirm the commit. It is a flag used to indicate that the
user has agreed to the terms.
The variables names passed here may not be the same as in the previous example, the following table will
list out the correlation between each.
Copyright ©2009
28 of 37
Sentias Software Corp. Rezgo XML API Implementation
The XML response from the commit query will return Booking complete, if the commit is successful, else an
error has occurred.
For errors processing the payment, the XML will respond with Payment has been declined by the gateway.
Any other errors will return the description of the error in the response.
Copyright ©2009
29 of 37
Sentias Software Corp. Rezgo XML API Implementation
Transaction Details
http://testcompany.rezgo.com/complete/T1ZrMFJUaFBObFV5Umc9PXxPVmswUlRoUE5sVXlSZz09
If the commit is successful and receive a Booking complete message, then we display a complete page
showing the transaction details. The data for the booking is retrieved with the i=search_bookings query.
The tour data returned in the first section is obtained from running the i=search_items query using the item
id from the booking.
Search_bookings query:
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=search_bookings&q=9Y4E8O6U2F
[complete1.jpg]
Copyright ©2009
30 of 37
Sentias Software Corp. Rezgo XML API Implementation
The second section contains the transaction details including billing information and payment method:
[complete2.jpg]
Copyright ©2009
31 of 37
Sentias Software Corp. Rezgo XML API Implementation
The third section contains the passenger information and any custom fields data:
[complete3.jpg]
Copyright ©2009
32 of 37
Sentias Software Corp. Rezgo XML API Implementation
Searching
We will go through a couple of different examples of searching through items. The first few will be the
search feature used on the Rezgo front-end, and then we will go through some examples of searching on
vendors.
Date Search
http://testcompany.rezgo.com/tour?search_from=2009-01-01&search_to=
[search.jpg]
The search above is using the i=search_items query looking for tours that are available from Jan 1, 2009
onwards.
Search_items query:
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=search_items&a=group&t=date&q=2009-01-
01,&
The query searches for tours with date ranges falling into the search range.
Copyright ©2009
33 of 37
Sentias Software Corp. Rezgo XML API Implementation
The query variable q must be a string with two dates, separated by comma.
The variable q must be in the following format:
q={start_date},{end_date}
start_date is required
end_date is optional
If the first date is set, and the second one is empty, we run a general search looking for all tours that are
available starting from the first date. If the second date is set, then we only search for items that are
available in that window between the two dates.
Searching for unreal/unconstrained date ranges such as having a start date after the end date will produce
odd results. It is up to you to implement error checking.
Copyright ©2009
34 of 37
Sentias Software Corp. Rezgo XML API Implementation
Advanced Search
You can run more advanced search queries on vendors. There is functionality for searching through more
item properties in the vendor system such as filtering by region, classification, or even a general keyword
search. Please note that the queries to the vendor gateway should have a transcode starting with a p.
http://xml.rezgo.com/xml?
key=REZGO_API_KEY&transcode=p4&i=search_items&t=name&a=group&q=*&f[description]=*city+tour*
2) Search for tours in Vancouver, BC, Canada (VANCOUVER/BC/CA) with ‘Biking’ as the classification
http://xml.rezgo.com/xml?
key=REZGO_API_KEY&transcode=p4&i=search_items&t=name&a=group&q=*&f[country]=*CA*&f[state]=*BC*&f
[city]=*VANCOUVER*&f[classification]=*Biking*
Search_items query: Searching for all tours with region and classification selected
element variable example (value assigned to variable)
transcode transcode p4
instruction i search_items
class l tour
target t name
additional arguments a group
query q *
country f[country] *city tour*
state/province f[state] *BC*
city f[city] *VANCOUVER*
classification f[classification] *Biking*
Copyright ©2009
35 of 37
Sentias Software Corp. Rezgo XML API Implementation
3) Keyword search; search for tours matching the term *city* in name, description, or location
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=p4&i=search_items&t=smart&a=group&q=*city*
Copyright ©2009
36 of 37
Sentias Software Corp. Rezgo XML API Implementation
Voucher
The voucher codes that are generated will be available from the Rezgo server accessed at the following url:
http://[company-name].rezgo.com/voucher/[encoded transaction number]. Currently this feature can not
be generated from third party parsers as the transaction encoding is not provided.
Voucher Link
http://testcompany.rezgo.com/voucher/T1ZrMFJUaFBObFV5Umc9PXxPVmswUlRoUE5sVXlSZz09
Copyright ©2009
37 of 37