rezgo xml api implementation guide

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

Upload: rezgo

Post on 16-Nov-2014

685 views

Category:

Documents


6 download

DESCRIPTION

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.

TRANSCRIPT

Page 1: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

rezgo

XML Gateway API - Implementation Manual

Implementation Manual - Version 2.4Rezgo Version 4.8.0

Last Modified 12 Nov 2009

Copyright ©20091 of 39

Page 2: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Revision HistoryPrimary Author Description Rezgo

VersionAPI 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 2009Jeffrey Qua Rezgo API – Revision 4.1.4 2.2 13 Mar 2009Jeffrey Qua Rezgo API – Revision/XML Changes 4.7.0 2.3 02 Nov

2009Miyuki 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 ©20092 of 39

Page 3: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Table of Contents

Before You Start............................................................................................................................................................... 4

Introduction...................................................................................................................................................................... 4

Site Template.................................................................................................................................................................... 4General Tracking Code................................................................................................................................................................. 5Company Name............................................................................................................................................................................... 5

About.................................................................................................................................................................................. 6

Contact................................................................................................................................................................................ 7

Tour Module...................................................................................................................................................................... 9Main Page......................................................................................................................................................................................... 9 Tags................................................................................................................................................................................................. 10 Tagged Products......................................................................................................................................................................... 10 Item Page....................................................................................................................................................................................... 12 Calendar......................................................................................................................................................................................... 16 Booking Details ........................................................................................................................................................................... 18Payment Details .......................................................................................................................................................................... 24

Commit ........................................................................................................................................................................... 28

Transaction Details .................................................................................................................................................... 30

Searching ........................................................................................................................................................................ 33Date Search.................................................................................................................................................................................... 33Advanced Search.......................................................................................................................................................................... 35

Voucher ........................................................................................................................................................................... 37

Copyright NoticeThis 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 ©20093 of 39

Page 4: Rezgo XML API Implementation Guide

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 ©20094 of 39

Page 5: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

[template.jpg]

Element XML Tag Queryheader header i=headersfooter 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 ©20095 of 39

Page 6: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Abouthttp://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 Queryabout about i=aboutintro intro i=about

The intro text is displayed on the main tour page. (Refer to Tour Module > Main Page)

Copyright ©20096 of 39

Page 7: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Contacthttp://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 ©20097 of 39

Page 8: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Element XML Tag Querycompany name company_name i=companycontact information address_1, address_2, city,

state_prov, postal_code, country

i=company

phone number phone i=company

You can also display other company information that we have chosen not to show like fax, and email.

Copyright ©20098 of 39

Page 9: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Tour Modulehttp://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 ©20099 of 39

Page 10: Rezgo XML API Implementation Guide

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 Querysite 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 Querytag name name i=tagstag uid uid i=tagstag count (number of tour options tagged)

count 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 ©200910 of 39

Page 11: Rezgo XML API Implementation Guide

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 Queryitem name name i=search_itemsitem uid / option id uid i=search_itemsitem common id com i=search_itemstag id category i=search_items

item details

time, duration, per, classification, cutoff, availability, starting, group, prices, currency_symbol, currency_separator, currency_decimals, currency_base, city, state, country, lat, lon, zoom, taxes, start_date, end_date, schedule, details

i=search_items

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 ©200911 of 39

Page 12: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Item Pagehttp://testcompany.rezgo.com/tour/6573/Awesome-Tourhttp://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 ©200912 of 39

Page 13: Rezgo XML API Implementation Guide

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-03http://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 ©200913 of 39

Page 14: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

[tourWithDateAndPromo.jpg]

Copyright ©200914 of 39

Page 15: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Element XML Tag Queryitem name name i=search_itemsitem uid uid i=search_items

item details / item description

schedule, details, departs, unavailable, itinerary, pick_up, drop_off, bring, introduction, overview, inclusions, exclusions, cancellation, description, image_gallery, video_gallery

i=search_items

geotag data lat, lon, zoom i=search_itemsitem image image i=search_itemsitem time time i=search_itemsitem duration duration i=search_itemsoption availability availability i=search_items

price option

adult_label, child_label, senior_label, price4_label, price5_label, price6_label, price7_label, price8_label, price9_label, price_adult, price_child, price_senior, price4, price5, price6, price7, price8, price9, currency symbol, currency_separator

i=search_items

option requirements

per, adult_required, child_required, senior_required, price4_required, price5_required, price6_required, price7_required, price8_required, price9_required

i=search_items

book button(label) book_now i=headersitem 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 ©200915 of 39

Page 16: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Calendarhttp://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 ©200916 of 39

Page 17: Rezgo XML API Implementation Guide

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 ©200917 of 39

Page 18: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Booking Detailshttps://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

element variableexample (value assigned to variable)

item uid item 160booking date date 2009-03-03trigger code promo_code

POST variables: Booking Request

element variableexample (value assigned to variable)

number of adults adult_num 1number of children child_num 1number of senior senior_numnumber of price4 price4_numnumber of price5 price5_numnumber of price6 price6_numnumber of price7 price7_numnumber of price8 price8_numnumber 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 ©200918 of 39

Page 19: Rezgo XML API Implementation Guide

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 ©200919 of 39

Page 20: Rezgo XML API Implementation Guide

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 ©200920 of 39

Page 21: Rezgo XML API Implementation Guide

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 formElement XML Tag Value

form id idWe can’t see this on the form, but it is 1234 in this case

display to each passenger, or primary passenger only

show group

HTML input type type checkboxForm label label Deluxe DinnerIs this field required require 1Price modification value price +20Value of option after submission

value(returned upon entry) – no value here

Form description comments“The deluxe dinner for the cruise 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 formElement XML Tag Value

form id idWe can’t see this on the form, but it is 1233 in this case

display to each passenger, or primary passenger only

show primary

HTML input type type textForm label label Special requestsIs this field required require 0Value of option after submission

value(returned upon entry) – no value here

Form description comments“Do you have any special needs you would like us to provide?”

Note: Triggerable fees are only allowed for checkbox forms.

Copyright ©200921 of 39

Page 22: Rezgo XML API Implementation Guide

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 Informationelement variable example (value assigned to

variable)first name billing[first_name] Sentiaslast name billing[last_name] Softwareaddress 1 billing[address1] 92 Lonsdale Ave.address 2 billing[address2] Suite 200city billing[city] North Vancouverstate / province billing[state] BCcountry billing[country] Canadapostal code billing[postal_code] V7M2E6phone number billing[phone] 604-983-0083email 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 variableexample (value assigned to variable)

Adult 1 – first namepassenger[price1_num][1][first_name]

Big

Adult 1 – last namepassenger[price1_num][1][last_name]

Bird

Adult 1 – phonepassenger[price1_num][1][phone]

Adult 1 - emailpassenger[price1_num][1][email]

Adult 1 – Deluxe Dinner form - form 1234

passenger[price1_num][1][forms][1234]

on (checkbox value for checked)

Child 1 – first namepassenger[price2_num][1][first_name]

Elmo

Child 1 – last namepassenger[price2_num][1][last_name]

Child 1 – phonepassenger[price2_num][1][phone]

Child 1 - emailpassenger[price2_num][1][email]

Child 1 – Deluxe Dinner form - form 1234

passenger[price2_num][1][forms][1234]

on (checkbox value for checked)

POST variables: Group Information

element variableexample (value assigned to variable)

Copyright ©200922 of 39

Page 23: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Special request form – form 1233

primary[forms][1233]Can you tell me how to get to Sesame St?

This is an example POST data return from submitting the booking details form.

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

Copyright ©200923 of 39

Page 24: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

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

Payment Detailshttps://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.

Copyright ©200924 of 39

Page 25: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

[payment_details_summary.jpg]

Copyright ©200925 of 39

Page 26: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

[payment_booking_details.jpg]

Copyright ©200926 of 39

Page 27: Rezgo XML API Implementation Guide

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 Querypayment methods payment_methods i=companyaccepted credit cards cards i=companyaccept cvv value get_cvv (1 if require; 0 if not) i=companyterms 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 ©200927 of 39

Page 28: Rezgo XML API Implementation Guide

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 variableexample (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 variableexample (value assigned to variable)

name of card holderpayment[cc][card_holder_name]

Sentias Software

card number payment[cc][card_number] 4111111111111111expiry month payment[cc][expiry_month] 12expiry year payment[cc][expiry_year] 2010cvv number (card verification value)

payment[cc][cvv] 123

Copyright ©200928 of 39

Page 29: Rezgo XML API Implementation Guide

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=Software&tour_address_1=92+Lonsdale+Ave.&tour_address_2=Suite+200&tour_city=North+Vancouver&tour_stateprov=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_number=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 passedexample (value assigned to variable)

i instruction commitdate tour booking date 2009-03-03book tour id 6573trigger_code promotional code

adult_numnumber of adults/price1 booked

1

child_numnumber of children/price2 booked

1

senior_numnumber of seniors/price3 booked

priceX_numnumber of priceX booked (where X is 4-9)

tour_first_name billing first name Sentiastour_last_name billing last name Softwaretour_address_1 billing address 1 92 Lonsdale Ave.tour_address_2 billing address 2 Suite 200tour_stateprov billing state/province BCtour_country billing country catour_postal_code billing postal code V7M2E6tour_phone_number billing phone number 604-983-0083tour_email_address billing email address [email protected]

Copyright ©200929 of 39

Page 30: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

tour_group[x][y][z]

tour group infox is the price option [adult, child, senior, price4, price5, price6, price7, price8, price9]; y is the x-th node of the price option (starting from 1);z is the type of field [first_name, last_name, phone, email, forms(covered in the next section)];

tour_group[x][y][forms][j]the value of the form j for a particular passenger

form [1234] = on

tour_forms[j]the value of the form j for the booking

form[1233] = How to get to Sesame St?

payment_method payment method Credit Cardstour_card_name name of card holder Sentias Softwaretour_card_type type of credit card used Visatour_card_number card number 4111111111111111tour_card_expiry_month expiry month 12tour_card_expiry_year expiry year 2010

tour_card_cvvcvv number (card verification value)

123

agree_termsvalue to indicate user has acknowledged they agree to the terms

1

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 ©200930 of 39

Page 31: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Transaction Detailshttp://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:

Copyright ©200931 of 39

Page 32: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

[complete1.jpg]

Copyright ©200932 of 39

Page 33: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

The second section contains the transaction details including billing information and payment method:

[complete2.jpg]

Copyright ©200933 of 39

Page 34: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

The third section contains the passenger information and any custom fields data:

[complete3.jpg]

Copyright ©200934 of 39

Page 35: Rezgo XML API Implementation Guide

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 ©200935 of 39

Page 36: Rezgo XML API Implementation Guide

Sentias Software Corp. Rezgo XML API Implementation

Format for searching by date range is as follows:

Search_items query: Searching a date range

element variableexample (value assigned to variable)

instruction i search_itemsclass l tourtarget t dateadditional arguments a groupquery 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 requiredend_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 ©200936 of 39

Page 37: Rezgo XML API Implementation Guide

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]=*c ity+tour*

Search_items query: Searching for a keyword in descriptionelement variable example (value assigned to variable)transcode transcode p4instruction i search_itemsclass l tourtarget t nameadditional arguments a groupquery 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 selectedelement variable example (value assigned to variable)transcode transcode p4instruction i search_itemsclass l tourtarget t nameadditional arguments a groupquery q *country f[country] *city tour*state/province f[state] *BC*city f[city] *VANCOUVER*classification f[classification] *Biking*

Copyright ©200937 of 39

Page 38: Rezgo XML API Implementation Guide

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 searchelement variable example (value assigned to variable)transcode transcode p4instruction i search_itemsclass l tourtarget t smartadditional arguments a groupquery q *

Copyright ©200938 of 39

Page 39: Rezgo XML API Implementation Guide

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 Linkhttp://testcompany.rezgo.com/voucher/T1ZrMFJUaFBObFV5Umc9PXxPVmswUlRoUE5sVXlSZz09

Copyright ©200939 of 39