XML API – Search Bookings
Description
The search_booking query returns transaction information matching the passed transaction code. This query has one required argument q=(transaction code) in order to find the transaction to be returned. The transaction code pattern match is set to q=1B4M7R2K1K in the following example.
Arguments
key = REZGO_API_KEY (Required)
transcode = TRANSCODE (Required)
i = headers (Required)
Required arguments:
- q : transaction code – code of transaction to search for
Example request
http://xml.rezgo.com/xml?key=REZGO_API_KEY&transcode=1&i=search_bookings&q=1B4M7R2K1K
Example response
This is an example of a booking retrieval for a transaction code that is not in the system
<response>
<total>0</total>
</response>
This is an example of a successful booking retrieval
<response>
<total>1</total>
<item_id>1663</item_id>
<tour_name>Test Tour</tour_name>
<option_name>Morning Departure</option_name>
<date>1210057200</date>
<date_range>1210057200</date_range>
<date_purchased>1209757083</date_purchased>
<prices>
<price_adult>25</price_adult>
</prices>
<adult_num>2</adult_num>
<child_num>0</child_num>
<senior_num>0</senior_num>
<price4_num></price4_num>
<price5_num></price5_num>
<price6_num></price6_num>
<price7_num></price7_num>
<price8_num></price8_num>
<price9_num></price9_num>
<adult_label><![CDATA[Adult]]></adult_label>
<child_label><![CDATA[Child]]></child_label>
<senior_label><![CDATA[Senior]]></senior_label>
<price4_label><![CDATA[Price 4]]></price4_label>
<price5_label><![CDATA[Price 5]]></price5_label>
<price6_label><![CDATA[Price 6]]></price6_label>
<price7_label><![CDATA[Price 7]]></price7_label>
<price8_label><![CDATA[Price 8]]></price8_label>
<price9_label><![CDATA[Price 9]]></price9_label>
<fees>12%</fees>
<triggered_fees>
<total_triggered_fees>1</total_triggered_fees>
<triggered_fee_1>
<label><![CDATA[Deluxe Dinner]]></label>
<amount>+20</amount>
<total_amount>40</total_amount>
</triggered_fee_1>
</triggered_fees>
<first_name><![CDATA[John]]></first_name>
<last_name><![CDATA[Smith]]></last_name>
<address_1><![CDATA[1234 Sesame Street]]></address_1>
<address_2><![CDATA[]]></address_2>
<city><![CDATA[Vancouver]]></city>
<stateprov><![CDATA[BC]]></stateprov>
<country>ca</country>
<postal_code>A1A2B2</postal_code>
<phone_number>(123)456-7890</phone_number>
<email_address>elmo@tickles.com</email_address>
<adult_1>
<first_name>Elmo</first_name>
<last_name>E</last_name>
<phone_number></phone_number>
<email_address></email_address>
<total_forms>1</total_forms>
<form_1>
<type>checkbox</type>
<question><![CDATA[Deluxe Dinner]]></question>
<answer><![CDATA[on]]></answer>
</form_1>
</adult_1>
<adult_2>
<first_name>Big</first_name>
<last_name>Bird</last_name>
<phone_number></phone_number>
<email_address></email_address>
<total_forms>1</total_forms>
<form_1>
<type>checkbox</type>
<question><![CDATA[Deluxe Dinner]]></question>
<answer><![CDATA[on]]></answer>
</form_1>
</adult_2>
<price_labels>
price_adult, price_child, price_senior, price4, price5, price6, price7, price8, price9
</price_labels>
<price_range>
<date value=”2010-06-17″>
<price_adult>75.45</price_adult>
<price_child/>
<price_senior/>
<price4>0.00</price4>
<price5/>
<price6/>
<price7/>
<price8/>
<price9/>
</date>
</price_range>
<tax_calc>6</tax_calc>
<overall_total>96</overall_total>
<trigger_code></trigger_code>
<payment_method><![CDATA[PayPal]]></payment_method>
<status>Payment Pending</status>
<checkin_status></checkin_status>
<ticketing>0</ticketing>
<trans_num>1B4M7R2K1K</trans_num>
<class>tour</class>
<primary_forms>
<total_forms>2</total_forms>
<form_1>
<type>text</type>
<question><![CDATA[Special requests]]></question>
<answer><![CDATA[Can you tell me how to get to Sesame Street? ]]></answer>
</form_1>
</primary_forms>
</response>
Field Definitions
- total
- returns 1 if transaction is found, else returns 0
- item_id
- the item uid
- date
- UNIX timestamp of item booking date
- date_range
- UNIX timestamp of item booking date
- date_purchased
- UNIX timestamp of date when booking was made
- prices
- XML node of prices agreed upon for the booking – refer to prices node definition
- adult_num
- number of spots booked for adult
- child_num
- number of spots booked for child
- senior_num
- number of spots booked for seniors
- price4_num – price9_num
- number of spots booked for {price4 – price9}
- adult_label
- label for adult price option
- child_label
- label for child price option
- senior_label
- label for senior price option
- price4_label – price9_label
- label for (price4 – price9) price option
- fees
- tax percentage charged on booking
- triggered_fees
- XML node of triggerable fees/prices agreed upon for the booking – refer to triggered_fees node definition
- first_name
- Billing info – First name
- last_name
- Billing info – Last name
- address_1
- Billing info – Address
- address_2
- Billing info – Address 2 (Optional)
- city
- Billing info – City
- stateprov
- Billing info – State/Province
- country
- Billing info – Country
- postal_code
- Billing info – Postal Code
- phone_number
- Billing info – Phone Number
- email_address
- Billing info – E-mail address
- price_option_x
- the passenger information for the x-th price_option passenger (ie. adult_1, adult_2, child_1, etc.) – refer to the passenger node definition
- price_range
- list of price options
- date
- XML node of prices for the day in the value attribute(in Y-m-d format) – refer to date node definition
- tax_calc
- total amount of tax cost after calculation
- overall_total
- total cost of booking
- deposit
- amount of deposit; only shown if deposits are required
- trigger_code
- trigger/coupon code used with this booking; only shown if a trigger code is submitted
- payment_method
- payment method used {PayPal}
- card_type
- type of credit card used; only used if paid with credit card
- card_name
- name on credit card used; only used if paid with credit card
- card_number
- number on credit card used; only used if paid with credit card
- status
- status of payment {Payment Pending}
- trans_num
- transaction code / transaction number of this booking (alphanumeric characters)
- class
- type of item {tour}
- primary_forms
- group forms, these forms are only filled once for each booking – refer to Passenger/Group form node definition
Price Node
- price_adult
- cost for adult price option
- price_child
- cost for child price option
- price_senior
- cost for senior price option
- price4 – price9
- cost for (price4 – price9) price option
Triggered Fees Node
- price_adult
- cost for adult price option
- price_child
- cost for child price option
- price_senior
- cost for senior price option
- price4 – price9
- cost for (price4 – price9) price option
Passenger Node
- price_adult
- cost for adult price option
- price_child
- cost for child price option
- price_senior
- cost for senior price option
- price4 – price9
- cost for (price4 – price9) price option
Passenger Group Form Node
- form_x
- x-th form attached to this passenger/group
- total_forms
- total number of forms for this group
- type
- input type {checkbox, select, textbox, …}
- question
- question text
- answer
- selected/entered response value {on}
Date Node
- price_adult
- cost for adult price option
- price_child
- cost for child price option
- price_senior
- cost for senior price option
- price4 – price9
- cost for (price4 – price9) price option