0% found this document useful (0 votes)
998 views

Rezgo XML API Implementation Guide

Implementation guide for the Rezgo Tour & Activity Booking Software XML API. Includes sample XML code and examples for implementing the XML API using the Rezgo white label.

Uploaded by

rezgo
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF or read online on Scribd
0% found this document useful (0 votes)
998 views

Rezgo XML API Implementation Guide

Implementation guide for the Rezgo Tour & Activity Booking Software XML API. Includes sample XML code and examples for implementing the XML API using the Rezgo white label.

Uploaded by

rezgo
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF or read online on Scribd
You are on page 1/ 37

Sentias Software Corp.

Rezgo XML API Implementation

rezgo
XML Gateway API - Implementation Manual

Implementation Manual - Version 2.4


Rezgo Version 4.8.0

Last Modified 12 Nov 2009

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)

Implentation v2.1/2.2 - Rezgo Version 4.1.4


-voucher
-revisions to xml responses

Implentation v2.0 - Rezgo Version 4.0 (major layout/functionality changes)


-xml query no longer uses http://booking-server.com/xml-gate?; now using http://xml.rezgo.com/xml?
-changed all instances of booking-server.com to rezgo.com
-new url structure using clean URLs with modrewrite
-default search_items query now uses common_id <com> as the primary search target

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

Before You Start


This document serves as a supplemental guide to implement the Rezgo/Booking-Server API interface. You
should have a copy of the XML Gateway API – Reference Manual in case you need to understand the technical
details to a higher level of depth. You may experience some differences in the interface depending on your
browser. For optimal results, please use Firefox.

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]

Element XML Tag Query


header header i=headers
footer footer i=headers

General Tracking Code

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]

Element XML Tag Query


about about i=about
intro intro i=about

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

The returned information will contain all the data.

[contact.jpg]

Copyright ©2009
7 of 37
Sentias Software Corp. Rezgo XML API Implementation

Element XML Tag Query


company name company_name i=company
contact information address_1, address_2, city, i=company
state_prov, postal_code, country
phone number phone i=company

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.

Site intro query:

http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=about

Element XML Tag Query


site intro intro i=about

All products query:

http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=search_items&t=name&a=group&q=*

Featured products query (for Vendors only):

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:

Tags query (for Suppliers only):

http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=tags

Element XML Tag Query


tag name name i=tags
tag uid uid i=tags
tag count (number of tour options count i=tags
tagged)

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.

Tag products/Search_items 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.

Element XML Tag Query


item name name i=search_items
item uid / option id uid i=search_items
item common id com i=search_items
tag id category i=search_items
time, duration, per, classification,
cutoff, availability, starting,
group, prices, currency_symbol,
currency_separator,
item details currency_decimals, i=search_items
currency_base, city, state,
country, lat, lon, zoom, taxes,
start_date, end_date, schedule,
details
item image flag image i=search_items

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.

Eg. http://images.rezgo.com/items/1-6573.jpg where company id = 1, and common id = 6573

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

Element XML Tag Query


item name name i=search_items
item uid uid i=search_items
schedule, details, departs,
unavailable, itinerary, pick_up,
drop_off, bring, introduction,
item details / item description i=search_items
overview, inclusions, exclusions,
cancellation, description,
image_gallery, video_gallery
geotag data lat, lon, zoom i=search_items
item image image i=search_items
item time time i=search_items
item duration duration i=search_items
option availability availability i=search_items
adult_label, child_label,
senior_label, price4_label,
price5_label, price6_label,
price7_label, price8_label,
price option price9_label, price_adult, i=search_items
price_child, price_senior, price4,
price5, price6, price7, price8,
price9, currency symbol,
currency_separator
per, adult_required, child_required,
senior_required, price4_required,
option requirements price5_required, price6_required, i=search_items
price7_required, price8_required,
price9_required
book button(label) book_now i=headers
item availability (refer to Calendar section) i=month

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:

POST variables: Item information


example (value assigned to
element variable
variable)
item uid item 160
booking date date 2009-03-03
trigger code promo_code

POST variables: Booking Request


example (value assigned to
element variable
variable)
number of adults adult_num 1
number of children child_num 1
number of senior senior_num
number of price4 price4_num
number of price5 price5_num
number of price6 price6_num
number of price7 price7_num
number of price8 price8_num
number of price9 price9_num

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.

Search items query:

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.

Here is our sample booking info:

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.

Deluxe Dinner form


Element XML Tag Value
We can’t see this on the form, but
form id id
it is 1234 in this case
display to each passenger, or
show group
primary passenger only
HTML input type type checkbox
Form label label Deluxe Dinner
Is this field required require 1
Price modification value price +20
(returned upon entry) – no value
Value of option after submission value
here
“The deluxe dinner for the cruise
Form description comments
requires a preparation fee”

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.

Special requests form


Element XML Tag Value
We can’t see this on the form, but
form id id
it is 1233 in this case
display to each passenger, or
show primary
primary passenger only
HTML input type type text
Form label label Special requests
Is this field required require 0
(returned upon entry) – no value
Value of option after submission value
here
“Do you have any special needs
Form description comments
you would like us to provide?”

Note: Triggerable fees are only allowed for checkbox forms.

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.

POST variables: Billing Information


element variable example (value assigned to variable)
first name billing[first_name] Sentias
last name billing[last_name] Software
address 1 billing[address1] 92 Lonsdale Ave.
address 2 billing[address2] Suite 200
city billing[city] North Vancouver
state / province billing[state] BC
country billing[country] Canada
postal code billing[postal_code] V7M2E6
phone number billing[phone] 604-983-0083
email address billing[email] [email protected]

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.

POST variables: Individual Passenger Information


element variable example (value assigned to variable)
passenger[price1_num][1]
Adult 1 – first name Big
[first_name]
passenger[price1_num][1]
Adult 1 – last name Bird
[last_name]
Adult 1 – phone passenger[price1_num][1][phone]
Adult 1 - email passenger[price1_num][1][email]
Adult 1 – Deluxe Dinner form - passenger[price1_num][1][forms]
on (checkbox value for checked)
form 1234 [1234]
passenger[price2_num][1]
Child 1 – first name Elmo
[first_name]
passenger[price2_num][1]
Child 1 – last name
[last_name]
Child 1 – phone passenger[price2_num][1][phone]
Child 1 - email passenger[price2_num][1][email]
Child 1 – Deluxe Dinner form - passenger[price2_num][1][forms]
on (checkbox value for checked)
form 1234 [1234]

POST variables: Group Information


element variable example (value assigned to variable)
Can you tell me how to get to Sesame
Special request form – form 1233 primary[forms][1233]
St?

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
)
)
)
)

[primary] => Array


(
[forms] => Array
(
[1233] => How to get to Sesame St?
)
)
)

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.

For the passenger data:


passenger[price option][x][field]

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

x – is an integer > 0, indicating the x-th person of the price option

field –passenger data fields: first_name, last_name, phone, email, forms

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]

The first name of the second Price4 – passenger[price4_num][2][first_name]


The last name of the second Price4 – passenger [price4_num][2][last_name]
The email of the second Price4 – passenger [price4_num][2][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]

Element XML Tag Query


payment methods payment_methods i=company
accepted credit cards cards i=company
accept cvv value get_cvv (1 if require; 0 if not) i=company
terms and conditions terms i=company

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

The payment variables we have to store are:

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.

POST variables: Payment Information


element variable example (value assigned to variable)
payment method payment[method] Credit Cards

The following is only necessary if the chosen payment methods is Credit Cards

POST variables: Credit Card Information


element variable example (value assigned to variable)
name of card holder payment[cc][card_holder_name] Sentias Software
card number payment[cc][card_number] 4111111111111111
expiry month payment[cc][expiry_month] 12
expiry year payment[cc][expiry_year] 2010
cvv number (card verification
payment[cc][cvv] 123
value)

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.

Commit Variables to send: Commit Information


variable data to be passed example (value assigned to variable)
i instruction commit
date tour booking date 2009-03-03
book tour id 6573
trigger_code promotional code
adult_num number of adults/price1 booked 1
child_num number of children/price2 booked 1
senior_num number of seniors/price3 booked
number of priceX booked (where
priceX_num
X is 4-9)
tour_first_name billing first name Sentias
tour_last_name billing last name Software
tour_address_1 billing address 1 92 Lonsdale Ave.
tour_address_2 billing address 2 Suite 200
tour_stateprov billing state/province BC
tour_country billing country ca
tour_postal_code billing postal code V7M2E6
tour_phone_number billing phone number 604-983-0083
tour_email_address billing email address [email protected]
tour_group[x][y][z] tour group info
x is the price option [adult, child,
senior, price4, price5, price6,
price7, price8, price9];
y is the x-th node of the price

Copyright ©2009
28 of 37
Sentias Software Corp. Rezgo XML API Implementation

option (starting from 1);


z is the type of field [first_name,
last_name, phone, email,
forms(covered in the next
section)];
the value of the form j for a
tour_group[x][y][forms][j] form [1234] = on
particular passenger
the value of the form j for the form[1233] = How to get to Sesame
tour_forms[j]
booking St?
payment_method payment method Credit Cards
tour_card_name name of card holder Sentias Software
tour_card_type type of credit card used Visa
tour_card_number card number 4111111111111111
tour_card_expiry_month expiry month 12
tour_card_expiry_year expiry year 2010
cvv number (card verification
tour_card_cvv 123
value)
value to indicate user has
agree_terms acknowledged they agree to the 1
terms

Commit Query Responses

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

The complete page contains a summary of the entire booking.


The first section contains the a detailed summary of the booking:

[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

Format for searching by date range is as follows:

Search_items query: Searching a date range


element variable example (value assigned to variable)
instruction i search_items
class l tour
target t date
additional arguments a group
query q 2009-01-01,

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.

1) Search for tours with “city tour” in their description

http://xml.rezgo.com/xml?
key=REZGO_API_KEY&transcode=p4&i=search_items&t=name&a=group&q=*&f[description]=*city+tour*

Search_items query: Searching for a keyword in description


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 *
description 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*

Search_items query: Searching for a keyword in multiple fields/smart search


element variable example (value assigned to variable)
transcode transcode p4
instruction i search_items
class l tour
target t smart
additional arguments a group
query q *

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

You might also like