RON XML API Reference
Index
Function Reference
Introduction
The Respax Operator Network (RON) XML API is the window into a real-time tour operator portal network connecting in real-time to major Australian and New Zealand tour operators. The Respax Operator Network enables development of interfaces to directly interact with each operator retrieving tour details with imagery, check availability, check prices and commit bookings directly into the remote operators system.
For a more detailed overview of RON, please checkout the Ron Introduction
To get started with your interface, you will need to register as a user on http://ron.respax.com.au. As part of the registration process, you will be sent an email with your user details and the link you will be using to develop and interface between your system and RON.
API overview
This XML-RPC (Extensible Markup Language - Remote Procedure Calling) API (Application Programming Interface) provides a simplified method to access a central database which in turn connects to multiple tour operator ResPax databases. The functions listed here allow a client application to view tour content as well as assemble the necessary information to commit a reservation into a host operator's database.
XML-RPC Home http://www.xmlrpc.com/
Database records are returned as associative arrays where the field name maps on to the field value. Anywhere that an example result refers to a record (eg web details record) refer to the fields table for a list of all field names and a description of their values. When writing new reservations or updating existing reservations, assemble a record as an associative array using the reservations fields table as a guide.
With the exception of ping, searchHost and searchKeyWord, the client must have successfully logged in using the login function before calling other functions. In addition, the session id returned by login must be appended to the server address as an additional request variable for these functions. Examples are provided below.
Nulls and Empty Strings
Currently XML-RPC cannot represent null values. As a result, null values in the RON or operator databases are converted to empty strings. For the purposes of this API, any string field that contains an empty string should be considered an empty string. Any non string field that contains an empty string should be considered a null value.
Date Formats
Dates in the API can be passed as a string representation in the format dd-MMM-yyyy. For Example:
26-JAN-1788 (26th of January, 1788) 21-DEC-2012 (21st of December, 2012)
The API has support for the ISO 8601 standard. For example:
1788-01-26 (26th of January, 1788) 2012-12-21 (21st of December, 2012)
Note that week number and ordinal date formats are not supported.
Passing dates in any other format may produce unexpected results.
YSN Fields
Fields prefixed with ysn are legacy boolean variants. For such fields a value of 0 (zero) equates to False and a value of -1 (negative one) equates to True.
Training Mode Mappings
To speed up development and testing, a set of generic mappings for each host are automatically in place when accessing the API in training mode. If you are seeing variations in results between live and training, keep in mind that you are using the generic test mappings in training mode and not mappings specific to your account.
ping
string ping ()
This simple test function returns the string "pong" if your xmlrpc call has been successful.
Example
results = api.ping()
Results
string(4) "pong"
login
string login (string userid, string password, string distributor)
Validates the userid and password against the RON database. If the user is valid, associated globals in the server session are set and a string containing the session id variable name and value is returned. This string needs to be appended as an additional request variable to the server address for most subsequent function calls.
Optionally you can pass a distributor id with the login details. This will look up the equivalent agent in each operator's database and set that as the current agent instead of the agent associated with the login details.
NOTE! Distributor mappings are only functional in the live environment.
Example
results = api.login('albert', 'secret')
Results
string(42) "PHPSESSID=1bea4b6a9491805f986ad14389a1a25e"
readCurrentLogin
array readCurrentLogin ()
Returns an array of two elements. The first element containing the details of the currently logged in user and the second element the details of the current user's organisation.
Example
results = api.readCurrentLogin()
Results
array(2) {
["arrCurrentUser"] => current user record,
["arrCurrentOrganisation"] => current organisation record
}
Current User Fields
|
||
Field Name |
Description |
|
intID |
Unique integer identifier for the user. |
|
strUserID |
User id used to login. |
|
strFirstName |
User's first name. |
|
strLastName |
User's last name. |
|
strEmail |
User's email address. |
|
strPhone |
User's contact phone number. |
|
Current Organisation Fields
|
||
Field Name |
Description |
|
intID |
Unique integer identifier for the organistion. |
|
strOrgID |
String identifier for the organisation. |
|
strName |
Name of the organisation. |
|
readCreditStatus
string readCreditStatus (string hostid)
Returns the credit status of the current user at the host specified.
Example
results = api.readCreditStatus('TEE')
Results
string(3) "dep"
Credit Statuses
|
||
Credit Status |
Payment Options |
|
full |
See readPaymentOptions for information on determining a valid payment option. |
|
fulllevy |
See readPaymentOptions for information on determining a valid payment option. |
|
dep |
See readPaymentOptions for information on determining a valid payment option. |
|
fullpob |
See readPaymentOptions for information on determining a valid payment option. |
|
stop |
Stopped agents cannot process payments and must be blocked from making new bookings. |
|
readPaymentOptions
array readPaymentOptions (string hostid)
Returns an array of zero or more associative arrays each representing a payment option that is valid for the currently logged in user at the host specified.
Example
results = api.readPaymentOptions('ATA');
Results
array(n) {
[0] => payment option record,
...
[n-1] => payment option record
}
Payment Option Fields
|
||
Field Name |
Description |
|
strCode |
Unique identifier for the payment option. |
|
strDescription |
Description of the normal method of payment collection when using this payment option. |
|
ysnDefault |
Indicates the default payment option that is preferred by the operator. |
|
strCode_Deprecated |
Payment option codes have been migrated to a standard format. All operators should now accept the standard format. (strCode) |
|
Example Payment Options
|
|
Payment Option |
Description |
full-agent |
Full amount is collected by the agent at time of booking. |
bal-agent/levy-pob |
Full amount less the levy is collected by the agent at time of booking. Levy is collected by the tour operator on day of travel. |
comm-agent/bal-pob |
Deposit is collected by the agent at time of booking. Balance is collected by the tour operator on day of travel. |
full-ccard |
Full amount is collected on credit card at time of booking. |
bal-ccard/levy-pob |
Full amount less the levy is collected on credit card at time of booking. Levy is collected by the operator on day of travel. |
full-pob |
Full amount is collected by the tour operator on day of travel. |
comm-ccard/bal-pob |
Deposit is collected on credit card at time of booking. Balance is collected by the tour operator on day of travel. |
comm-agent/bal-ccard |
Deposit is collected by the agent at time of booking. Balance is collected on credit card at time of booking. |
When checking or writing a reservation you must provide a payment option that is returned by this function. Any attempt to use a payment option that is not returned by this function will result in the booking being rejected. If the payment option you want to use is not returned by this function, contact the operator to review your credit status.
readHosts
array readHosts ()
Returns an array of associative arrays each containing the host id, name and a boolean value indicating the current state of the host.
Example
results = api.readHosts()
Results
array(n) {
[0] => host record
...
[n-1] => host record
}
Host List Fields
|
||
Field Name |
Description |
|
strHostID |
Unique identifier for the host. |
|
strHostName |
Host organisation's name. |
|
boolServerUp |
Flag to indicate if the host server is currently reachable. |
|
boolOnline |
Flag to indicate if the host configuration process is complete. |
|
About Host Status
There are two flags that must be enabled for tour content to be available. The flag boolServerUp indicates if the physical machine responded to the most recent attempt to contact it. The flag boolOnline is set by a RON administrator once the host has completed all the steps necessary to publish their tour content successfully. Function calls to any host with boolOnline disabled should be avoided as the results may not be valid.
readHostDetails
array readHostDetails (string hostid)
Returns an associative array of extended information for the host including contact information.
Example
results = api.readHostDetails('BCGI')
Results
host details record
Host Details Fields
|
||
Field Name |
Description |
|
strHostID |
Unique identifier for the host. |
|
strHostName |
Host organisation's name. |
|
boolServerUp |
Flag to indicate if the host server is currently reachable. |
|
boolOnline |
Flag to indicate if the host configuration process is complete. |
|
strConfigMode |
Indicates if the host data was drawn from the live or train registrations. |
|
strLocation |
Approximate geographical location of the host. |
|
strReservations |
Name of reservations staff contact. |
|
strReservationsEmail |
Reservations email address. |
|
strReservationsPhone |
Reservations phone number. |
|
strTechnical |
Name of technical support contact. |
|
strTechnicalEmail |
Technical support email address. |
|
strTechnicalPhone |
Technical support phone number. |
|
strAccounts |
Name of accounts department contact. |
|
strAccountsEmail |
Accounts department email address. |
|
strAccountsPhone |
Accounts department phone number. |
|
strHostType |
Indicates whether the host takes live bookings or requests. |
|
readPaxTypes
array readPaxTypes (string hostid)
Returns an indexed array of associative arrays containing the pax type information for the host.
Example
results = api.readPaxTypes('FF')
Results
array(
[0] => pax type record,
...
[n-1] => pax type record
)
Pax Type Fields
|
||
Field Name |
Description |
|
intPaxType |
Unique identifier for the pax type. |
|
strPaxDesc |
The standard pax type label. |
|
strShortPaxDesc |
A short pax type label that can be used when there is limited space in the interface. |
|
intWebPaxAssoc |
The pax type price that is associated with this pax type. |
|
Pax Types and Reservation Fields
An operator can customise the pax type labels to suit her products. This can include moving the label of one pax type to another field. For example, the operator could change the infant pax type to a new type called "Family Child" and then change the user defined pax type to infant. The pax types would still need to be booked in the original reservation field names. In the previous example, family children would be booked in the intNoPax_Infant field and infants would be booked in the intNoPax_UDef1 field.
|
|||||
Pax Type |
Field |
Default Desc. (Short) |
Default Assoc. |
Example Desc. (Short) |
Example Assoc. |
1 |
intNoPax_Adults |
Adult (Ad) |
1 |
Adult (Ad) |
1 |
2 |
intNoPax_Infant |
Infant (In) |
1 |
Family Child (FCh) |
2 |
3 |
intNoPax_Child |
Child (Ch) |
3 |
Child (Ch) |
3 |
4 |
intNoPax_FOC |
FOC (FOC) |
4 |
Concession (Cn) |
4 |
5 |
intNoPax_UDef1 |
User Defined (Udef) |
5 |
Infant (In) |
1 |
Pax Type Associations
On any given trip, if a pax type's associated pax type (intWebPaxAssoc) has no price then that pax type cannot be booked. For example, the default association of pax type 1 is to itself, therefore to book an adult, there must be an adult price. That is the same for all pax types except pax type 2. Pax type 2 by default is associated to pax type 1 therefore to book an infant there must be an adult price and at least one adult travelling. The default pax type associations cover the need of many operators to allow infants to travel free with their parent or guardian.
readTours
array readTours (string hostid)
Returns an array of associative arrays each containing the tour code and tour name for all the publicly visible tours from the specified host.
Example
results = api.readTours('OZEX')
Results
array(n) {
[0] => tour list record
...
[n-1] => tour list record
}
Tour List Fields
|
||
Field Name |
Description |
|
strTourCode |
Identifier for the tour record. |
|
strTourName |
Name of the tour. |
|
boolAvailable |
Indicator of tour availability. This does not mean there are seats, just that the tour is enabled and bookable. |
|
readTourDetails
array readTourDetails (string hostid, string tourcode)
Returns an associative array of extended tour information from the host for the specified tour code.
Example
results = api.readTourDetails('OZEX', 'BRUCE')
Results
tour details record
Tour Details Fields
|
||
Field Name |
Description |
|
strTourCode |
Identifier for the tour. |
|
strTourName |
Name of the tour. |
|
strTourComment |
Special instructions and additional information from the operator. |
|
bitTourFlavours(currently not supported) |
Bitwise value that alters behavior of the booking process |
|
ysnForcePaxID(currently not supported) |
Indicates if a user record must be created for the pax when committing the reservation. |
|
ysn1PerRes(currently not supported) |
Indicates if only one pax can be assigned to a reservation. |
|
arrTravelTerms * |
An array of zero or more terms and conditions for travel from each of the parties involved in the reservation. (tour owner, tour operator, booking agent) |
|
* The travel terms field is not yet supported by all operators.
Travel Terms Fields
|
||
Field Name |
Description |
|
strOrgID |
Identifier for the organisation. |
|
strOrgName |
Name of the organisation enforcing the travel terms. |
|
strTravelTerms |
The terms and conditions for travel. |
|
readTourWebDetails
array readTourWebDetails (string hostid, string tourcode, boolean images)
Returns an associative array of promotional and descriptive information for the tour. Due to the size of base 64 encoded images, you can optionally request that image information not be returned by sending false as the third parameter.
Example
results = api.readTourWebDetails('KIWIEX', 'FULLMONTY', True)
Results
tour web details record
Tour Web Details Fields
|
||
Field Name |
Description |
|
strTourCode |
Identifier for the tour. |
|
strTitle |
A short concise title describing the tour. |
|
strCatchPhrase |
A general description or blurb promoting key features of the tour. |
|
strIncludes |
A list of specifics that are included with the tour. |
|
strAdditional |
Any additional information the passenger needs to know about the tour. |
|
strLevyDesc |
Details of any levies that apply to the tour. |
|
strComment |
A message that should be displayed when booking indicating the information needed in the comment field. |
|
strAvailability |
A message that should be displayed when booking indicating valid travel dates for the tour. |
|
strDuration |
The estimated tour duration. This can be variable based on the options selected when booking. |
|
dteLastUpdated |
The last time the web details were updated. This can be used to determine if the web details have changed without retrieving all the information. |
|
intSmallImageID |
Identifier for the image.(currently not supported) |
|
intLargeImageID |
Identifier for the image.(currently not supported) |
|
intIncludeImageID |
Identifier for the image.(currently not supported) |
|
b64SmallImage |
A base64 encoded image. Operators have been advised to make this image 160x160 in size. |
|
b64LargeImage |
A base64 encoded image. Operators have been advised to make this image 180x240 in size. |
|
b64IncludeImage |
A base64 encoded image. Operators have been advised to make this image 80x80 in size. |
|
readTourTimes
array readTourTimes (string hostid, string tourcode)
Returns an array of associative arrays from the host each containing the details of a departure time for the specified tour.
Example
results = api.readTourTimes('GA', 'GIECO')
Results
array(n) {
[0] => tour time record
...
[n-1] => tour time record
}
Tour Times Fields
|
||
Field Name |
Description |
|
intTourTimeID |
Identifier for the tour time record. |
|
strTourCode |
Identifier for the tour. |
|
dteTourTime |
Associative array containing integer timestamp, scalar and ISO8601 formats for the time. The ISO8601 format is recommended for use in interfaces as the timestamp and scalar representations are now deprecated. |
|
ysnIsReturnTrip(currently not supported) |
Indicates if the departure time has a return trip. |
|
ysnIsDefault |
Indicates if the departure time is the default that should be offered up first to the client. |
|
ysnActive |
Indicates if the departure time is currently active. Inactive departure times should not be presented to the client. |
|
readTourBases
array readTourBases (string hostid, string tourcode)
Returns an array of associative arrays from the host each containing the details of a fare basis and type for the specified tour.
NOTE! Any subsequent function that requires both a basis and subbasis id requires a pair of ids from a single record in the results. You cannot mix and match basis and subbasis ids from different records.
Example
results = api.readTourBases('RT', 'ATR')
Results
array(n) {
[0] => tour basis record
...
[n-1] => tour basis record
}
Tour Bases Fields
|
||
Field Name |
Description |
|
strTourCode |
Identifier for the tour. |
|
intBasisID |
Identifier for the basis. |
|
strBasisDesc |
Short description of the basis. |
|
strBasisDesc2 |
Long description of the basis. |
|
ysnWebEnabledBasis |
Indicates if the basis is enabled. Disabled bases and associated subbases should not be presented to the client. |
|
intSubBasisID |
Identifier for the subbasis. |
|
strSubBasisDesc |
Description of the subbasis. |
|
ysnWebEnabledSubBasis |
Indicates if the subbasis is enabled. Disabled subbases should not be presented to the client. If a basis has not enabled subbases it should not be presented to the client. |
|
intFixedNoPax |
If this is not zero, the number of pax booked on the basis must be a multiple of this value. Generally only used for accommodations. |
|
intDurationDays |
Duration in days of Basis. |
|
readTourPickups
array readTourPickups (string hostid, string tourcode, integer tourtimeid, integer basisid)
Returns an array of associative arrays from the host each containing the details of a pickup location and time for the specified tour, time and basis combination.
To uniquely and correctly identify a pickup, you must specify the pickup route code, pickup time id and pickup id. The recommended method of doing this is to use the strPickupKey field when selecting a pickup and when writing a reservation.
Example
results = api.readTourPickups('RT', 'BUNGY', 137, 744)
Results
array(n) {
[0] => tour pickup record
...
[n-1] => tour pickup record
}
Tour Pickups Fields
|
||
Field Name |
Description |
|
intPickupID |
Identifier for the pickup. This field should be used with the readTourPrices function. |
|
intTourTimeID |
Identifier for the pickup time. |
|
Array containing timestamp, scalar and ISO8601 representations of the pickup time. It is strongly recommended that strPickupValue be used for describing the pickup but if the time is required independently then the scalar or ISO8601 values should be used. |
||
strPickupName |
The name of the pickup location. |
|
strPickupDesc |
The name of the pickup location including the tour code of the bus route. |
|
ysnDefShow |
Pickup is on the default route. (currently not supported) |
|
strTourCode |
The tour code of the bus route. |
|
strPickupKey |
A concatenation of the fields that uniquely identify a pickup. This field should be used with the writeReservation function. |
|
strPickupValue |
A concatenation of the pickup location and time. |
|
readTourPrices
array readTourPrices (string hostid, string tourcode, integer basisid, integer subbasisid, string tourdate, integer tourtimeid, integer pickupid, integer dropoffid)
Returns an associative array from the host containing price, levy and commission information for adult, child, infant, foc and udef pax types. If the tour sell value for a pax type is calculated as zero or the pax type assoc flag is false, that pax type should be disabled on the client. Pickup and dropoff ids are optional but should be provided if a pickup is selected in the booking.
Example
results = api.readTourPrices('ATA', 'AR3', 423, 1542, '31-OCT-2009', 57)
Results
array(29) {
["curAdultTourSell"] => float(227)
["curAdultTourLevy"] => float(10)
["curChildTourSell"] => float(187)
["curChildTourLevy"] => float(10)
["curInfantTourSell"] => float(187)
["curInfantTourLevy"] => float(10)
["curFOCTourSell"] => float(0)
["curFOCTourLevy"] => float(0)
["curUDef1TourSell"] => float(0)
["curUDef1TourLevy"] => float(0)
["dblAdultCommission"] => float(18.75)
["dblChildCommission"] => float(12.75)
["dblInfantCommission"] => float(12.75)
["dblFOCCommission"]=> float(0)
["dblUDef1Commission"]=> float(0)
["curDeposit"] => float(0)
["curBookingFee"] => float(0)
["curCardFee"] => float(0)
["curPayOnBoard"] => float(0)
["curTourLevy"] => float(0)
["curTotal"] => float(0)
["strCurrencyType"] => string(3) "AUD"
["strCurrencySymbol"] => string(1) "$"
["strPaymentOption"] => string(6) "credit"
["boolAdultAssoc"] => bool(true)
["boolChildAssoc"] => bool(true)
["boolInfantAssoc"] => bool(true)
["boolFOCAssoc"] => bool(false)
["boolUDef1Assoc"] => bool(false)
}
Tour Prices Fields
|
||
Field Name |
Description |
|
curAdultTourSell |
Price per adult. |
|
curAdultTourLevy |
Levy per adult. |
|
curChildTourSell |
Price per child. |
|
curChildTourLevy |
Levy per child. |
|
curInfantTourSell |
Price per infant. |
|
curInfantTourLevy |
Levy per infant. |
|
curFOCTourSell |
Price per FOC. |
|
curFOCTourLevy |
Levy per FOC. |
|
curUDef1TourSell |
Price per UDef. |
|
curUDef1TourLevy |
Levy per UDef. |
|
dblAdultCommission |
Percentage commission on adults booked. |
|
dblChildCommission |
Percentage commission on children booked. |
|
dblInfantCommission |
Percentage commission on infants booked. |
|
dblFOCCommission |
Percentage commission on FOCs booked. |
|
dblUDef1Commission |
Percentage commission on UDefs booked. |
|
curDeposit |
|
|
curBookingFee |
|
|
curCardFee |
|
|
curPayOnBoard |
|
|
curTourLevy |
|
|
curTotal |
|
|
strCurrencyType |
ISO 4217 currency code for all amounts. |
|
strCurrencySymbol |
Currency symbol for all amounts. |
|
strPaymentOption |
The operator's preferred payment option for the current agent. |
|
boolAdultAssoc |
Does the Adult associated pax have a price? Adult pax type is not bookable if false. |
|
boolChildAssoc |
Does the Child associated pax have a price? Child pax type is not bookable if false. |
|
boolInfantAssoc |
Does the Infant associated pax have a price? Infant pax type is not bookable if false. |
|
boolFOCAssoc |
Does the FOC associated pax have a price? FOC pax type is not bookable if false. |
|
boolUDef1Assoc |
Does the UDef associated pax have a price? UDef pax type is not bookable if false. |
|
readTourPricesRange
array readTourPricesRange (array productList)
This function allows the multiple price queries to be processed in one call. The product list arrays are returned with the price information appended. If any call produces a fault, the function continues running and returns the individual fault as part of the results. Note that price ranges cannot include bus route pricing. Each item in the product list must contain a host, tour code, basis id, subbasis id and time id.
Example
query1 = array( 'strHostID' => 'AS', 'strTourCode' => 'WDWWMBWC', 'intBasisID' => 317, 'intSubBasisID' => 988, 'dteTourDate' => '21-Dec-2012', 'intTourTimeID' => 82 ) query2 = array( 'strHostID' => 'EC', 'strTourCode' => 'BYDTWD', 'intBasisID' => 22342, 'intSubBasisID' => 4122, 'dteTourDate' => '21-Dec-2012', 'intTourTimeID' => 711 ) results = api.readTourPricesRange(array(query1, query2))
Results
array(
array(
"strHostID" => "AS",
"strTourCode" => "WDWWMBWC",
"intBasisID" => 317,
"intSubBasisID" => 988,
"dteTourDate" => "21-Dec-2012",
"intTourTimeID" => 82,
"curAdultTourSell" => 575.00,
"curAdultTourLevy" => 25.00,
"curInfantTourSell" => 0.00,
"curInfantTourLevy" => 0.00,
"curChildTourSell" => 460.00,
"curChildTourLevy" => 25.00,
"curFOCTourSell" => 0.00,
"curFOCTourLevy" => 0.00,
"curUDef1TourSell" => 0.00,
"curUDef1TourLevy" => 0.00,
"strCurrencyType" => "AUD",
"strCurrencySymbol" => "$",
"strPaymentOption" => "comm-agent/bal-pob",
"dblAdultCommission" => 19.6667,
"dblInfantCommission" => 0.00,
"dblChildCommission" => 0.00,
"dblFOCCommission" => 0.00,
"dblUDef1Commission" => 0.00,
"boolAdultAssoc" => true,
"boolInfantAssoc" => false,
"boolChildAssoc" => true,
"boolFOCAssoc" => false,
"boolUDef1Assoc" => false
),
array(
"strHostID" => "EC",
"strTourCode" => "BYDTWD",
"intBasisID" => 22342,
"intSubBasisID" => 4122,
"dteTourDate" => "21-Dec-2012",
"intTourTimeID" => 711,
"curAdultTourSell" => 0.00,
"curAdultTourLevy" => 0.00,
"curInfantTourSell" => 0.00,
"curInfantTourLevy" => 0.00,
"curChildTourSell" => 0.00,
"curChildTourLevy" => 0.00,
"curFOCTourSell" => 0.00,
"curFOCTourLevy" => 0.00,
"curUDef1TourSell" => 0.00,
"curUDef1TourLevy" => 0.00,
"strCurrencyType" => "AUD",
"strCurrencySymbol" => "$",
"strPaymentOption" => "comm-agent/bal-pob",
"dblAdultCommission" => 0.00,
"dblInfantCommission" => 0.00,
"dblChildCommission" => 0.00,
"dblFOCCommission" => 0.00,
"dblUDef1Commission" => 0.00,
"boolAdultAssoc" => false,
"boolInfantAssoc" => false,
"boolChildAssoc" => false,
"boolFOCAssoc" => false,
"boolUDef1Assoc" => false,
"faultCode" => 201,
"faultString" => "ERROR (server-ron) : ERROR (respax-external) : Specified basis does not exist."
)
)
readTourAvailability
integer readTourAvailability (string hostid, string tourcode, integer basisid, integer subbasisid, string tourdate, integer tourtimeid)
Returns an integer representing the number of places remaining on the specified trip.
Example
results = api.readTourAvailability('KIWIEX', 'DOGLEG', 317, 988, '15-JUN-2010', 82)
Results
int(14)
readTourAvailabilityRange
array readTourAvailabilityRange (array productList)
This function allows the multiple availability queries to be processed in one call. The product list arrays are returned with the availability information appended. If any call produces a fault, the function continues running and returns the individual fault as part of the results. Note that availability ranges cannot include bus route availability. Each item in the product list must contain a host, tour code, basis id, subbasis id and time id.
Two additional fields are returned on top of the individual availability call: boolTrip and boolThreshold.
boolTrip
Indicates if the tour is actually running on the day in question. If the availability is zero and trip is true, the tour is running but full. If the availability is zero and trip is false, the tour is not running on that day.
boolThreshold
Indicates if the availability value has been capped by an operator threshold. If the availability is 10 and threshold is true, then there are greater than 10 seats but the operator only allows up to 10 to be visible. If the availability is 10 and threshold is false, then there really are only 10 seats remaining.
Example
query1 = array( 'strHostID' => 'AS', 'strTourCode' => 'WDWWMBWC', 'intBasisID' => 317, 'intSubBasisID' => 988, 'dteTourDate' => '01-Jan-2013', 'intTourTimeID' => 82 ) query2 = array( 'strHostID' => 'EC', 'strTourCode' => 'BYDTWD', 'intBasisID' => 22342, 'intSubBasisID' => 2122, 'dteTourDate' => '01-Jan-2013', 'intTourTimeID' => 82 ) results = api.readTourAvailabilityRange(array(query1, query2))
Results
array(
array(
"strHostID" => "AS",
"strTourCode" => "WDWWMBWC",
"intBasisID" => 317,
"intSubBasisID" => 988,
"dteTourDate" => "01-Jan-2013",
"intTourTimeID" => 82,
"intAvailability" => 10,
"boolTrip" => true,
"boolThreshold" => true
),
array(
"strHostID" => "EC",
"strTourCode" => "BYDTWD",
"intBasisID" => 22342,
"intSubBasisID" => 2122,
"dteTourDate" => "01-Jan-2013",
"intTourTimeID" => 31,
"intAvailability" => -1,
"boolTrip" => false,
"boolThreshold" => false,
"faultCode" => 201,
"faultString" => "ERROR (server-ron) : ERROR (respax-external) : Specified basis does not exist."
)
)
checkReservation
array checkReservation (string hostid, array reservation, array payment)
Runs a series of precommit checks on a reservation without attempting to commit. See writeReservation for the structure of the reservation and payment array parameters. Returns an array of errors in the reservation. An empty array means no errors were found in the precommit check.
Example
reservation = array(
'strTourCode' => 'COBBER',
'intBasisID' => 338,
'dteTourDate' => "31-OCT-2007",
'intTourTimeID' => 144,
'strPaxFirstName' => 'Wernher',
'strPaxLastName' => 'von Braun',
'strPaxEmail' => 'wernher@example.com',
'intNoPax_Adults' => 1,
)
payment = array(
'strPaymentOption' => 'full-agent'
)
results = api.checkReservation('OZEX', reservation, payment)
Results
array(2) {
[0]=> string(53) "No room type or subbasis id provided for reservation."
[1]=> string(329) "The requested payment option was rejected by the operator. You requested (full-agent) which means: Full amount is collected by the agent at time of booking. Your credit status with the operator does not allow this payment option to be processed. Please contact the operator for more information or to review your credit status."
}
writeReservation
integer writeReservation (string hostid, int confirmation, array reservation, array payment)
- Sends the details of the reservations array to the host and returns a confirmation number if the reservation is successfully committed. Provide a confirmation number of -1 to create a new reservation. Updating an existing reservation is not supported at this time.
The previous system of writing pickups by manually providing strPickupRouteCode, intPickupRouteTimeID and intPickupID has been replaced with a single field strPickupKey. To specify that the reservation has no pickup you can do one of 4 things:
- Do not provide the strPickupKey field.
- Set strPickupKey field to null.
- Set strPickupKey field to an empty string.
- Set strPickupKey field to the string value 0:0:0.
All these options assume you are no longer passing the individual pickup related fields.
Payment defines how much money you are collecting in the booking. Payment options available to you when booking is determined by your Credit status with each operator. See readPaymentOptions for information on determining a valid payment option.
Example
reservation = array(
'strTourCode' => 'COBBER',
'intBasisID' => 338,
'intSubBasisID' => 1477,
'dteTourDate' => "31-OCT-2007",
'intTourTimeID' => 144,
'strPaxFirstName' => 'Wernher',
'strPaxLastName' => 'von Braun',
'strPaxEmail' => 'wernher@example.com',
'intNoPax_Adults' => 2,
'strGeneralComment' => 'Alergic to ginger toupees.'
)
payment = array(
'strPaymentOption' => 'full-agent'
)
results = api.writeReservation('OZEX', -1, reservation, payment)
Results
int(69777)
Reservations Fields
|
||
Field Name |
Description |
|
strCfmNo_Ext |
Reference to the reservation in a third party system. |
|
strVoucherNo |
Agent voucher number |
|
strAgentRef |
The agent reference. This is normally not a free typed field in the interface but is instead stamped with the first and last name of the currently logged in user that is making the booking. |
|
strTourCode |
Tour code for the reservation. |
|
intBasisID |
Fare basis id for the reservation. |
|
intSubBasisID |
Fare subbasis (or type) id for the reservation. |
|
dteTourDate |
String representation of the tour date for the reservation. (eg 04-APR-2013) |
|
intTourTimeID |
Departure time id for the reservation |
|
strPaxFirstName |
The first name of the pax. |
|
strPaxLastName |
The last name of the pax. |
|
strPaxEmail |
The contact email address of the pax. |
|
strPaxMobile |
The mobile number or contact number of the pax. |
|
intNoPax_Adults |
Number of adult pax to be booked. (Pax type 1 when using custom pax labels from the operator.) |
|
intNoPax_Infant |
Number of infant pax to be booked. (Pax type 2 when using custom pax labels from the operator.) |
|
intNoPax_Child |
Number of child pax to be booked. (Pax type 3 when using custom pax labels from the operator.) |
|
intNoPax_FOC |
Number of free of charge pax to be booked. (Pax type 4 when using custom pax labels from the operator.) |
|
intNoPax_UDef1 |
Number of user defined pax to be booked. (Pax type 5 when using custom pax labels from the operator.) |
|
strGeneralComment |
The general comment. |
|
ysnIsConfirmed |
Optional - By default it is set to -1 for confirmed bookings. Set it to zero for unconfirmed or open-dated bookings. |
|
strPickupRouteCode |
The tour code of the bus route the pickup is on. |
|
intPickupRouteTimeID |
The tour time of the bus route the pickup is on. |
|
intPickupID |
Pickup id for the reservation. |
|
strPickupRoomNo |
Room number for pickup if applicable. |
|
strPickupKey |
A concatenation of route code, route time id and pickup id. |
|
Payment Options
See readPaymentOptions for information on determining a valid payment option.
writeCancellation
boolean writeCancellation (string hostid, integer confirmation, string reason)
Cancels a reservation at the host with the specified confirmation number and updates the reservation with the cancellation reason. It returns the cofirmation number if successful.
Example
results = api.writeCancellation('OZEX', 69777, 'Pax suffered a spleen injury.')
Results
int(69777)
