====== Offers method ====== Get a list of offers. ===== Valid content types ===== * ''pauschal'' * ''hotel'' * ''trips'' * (''charter'' **is not supported!**) * (''oneway'' **is not supported!**) * ''extras'' ===== Description ===== public array offers( array $searchData, array $headerData, array $topOffersFilter = array(), boolean $cleanUrl = true ) ===== Parameters ===== * ''searchData (array)'' : search parameters. Required serach parameters: ''vnd'', ''bsd'', ''epc'', ''tdc'' * ''headerData (array)'' : [[soap_header|SOAP Header Information]] * ''topOffersFilter (array)'' : top offers filter. Results that match this filter will be listed under array('top_offers' => ...) Example ''$topOffersFilter'': array( 'toc' => 'FTI, 5VF', // tour operator must be FTI or 5VF 'stc' => 4 // hotel category must be 4 or grater ) * ''cleanUrl (bool)'' : TRUE returns clean friendly URLs. ===== Return Values ===== Returns a list of available offers. Here is an example of output: Array ( [header] => Array ( [typ] => hotel [offers] => 138 [rgc] => 659 [rgn] => Dalmatia [rgg] => 100023 [rggn] => Croatia [pages] => 10 [perpage] => 15 [offset] => [sid] => b8hf8e9qene0lf8v46lujkokl2 ) [top_offers] => Array ( ) [offers] => Array ( [0] => Array ( [htn] => Feral [gid] => 71088 [pic] => http://www.ors.si/giata-pics/71088//thumb.jpg [hon] => Brna [zhn] => Dalmacija (HrvaĹĄka) [zhc] => 4CR,DBV [oid] => 23887 [stc] => 4.0 [ovr] => 100 [emf] => 80 [cnt] => 3 [pax] => št. oseb [rooms] => 1 [bedrooms] => 1 [ppc] => 27.00 [tdc] => 1 [rgc] => 659 [rgn] => Dalmatia [rgg] => 100023 [rggn] => Croatia [picf] => http://www.ors.si/giata-pics/71088//full.jpg [geo] => 1 [lat] => 42.9045823966052000 [lon] => 16.8566189525687980 [url] => croatia/brna/feral/100023/659/71088/?epc=2&vnd=1&bsd=300&toc=&tdc=1-7&rgc=659&sel[gid]=71088 [vpcs] => Array ( [HP] => half board [AI] => all inclusive [UF] => bed & breakfast ) [zacs] => Array ( [DZ] => double room [EC] => economy room ) [tocs] => Array ( [TERR] => Terra Reisen [PALM] => Palma ) [facts] => Array ( [bea] => Array ( [code] => bea [value] => bea [status] => 1 ) [pol] => Array ( [code] => pol [value] => pol [status] => 1 [ski] => Array ( [code] => ski [value] => ski [status] => 0 ) ) ) ... [filters] => Array ( [toc] => Array ( [selected] => 0 [val] => Array ( [PALM] => Palma [TERR] => Terra Reisen ) ) [zac] => Array ( [selected] => 0 [val] => Array ( [AP] => apartment [DZ] => double room [FZ] => family room ) ) [vpc] => Array ( [selected] => 0 [val] => Array ( [UF] => bed & breakfast [HP] => half board ) ) [stc] => Array ( [selected] => 0 [val] => Array ( [0.0] => 0.0 [3.0] => 3.0 [4.0] => 4.0 ) ) [ovr] => Array ( [selected] => 0 ) [oid] => Array ( [selected] => 0 [val] => Array ( [573] => Bled ) ) ) [rfilters] => Array ( [ppc] => "56-112" ) [sorts] => Array ( [htn] => 0 [hon] => 0 [stc] => 0 [ovr] => 0 [gid] => 0 [emf] => 0 [ppc] => asc ) ... ===== Return values (Extras) ===== When searching for ''extras'' you'll get different return values. Array ( [header] => Array ( [typ] => extras [offers] => 1 [pages] => 1 [page] => 1 [sid] => esnme76mer643ssgokmob3d8j3 ) [offers] => Array ( [0] => Array ( [id] => 199 [ide] => 199 [opt] => 0 [time] => [opt_name] => [etype] => 1 [etype2] => 0 [transfer] => 0 [fzhc] => [foid] => [tzhc] => [toid] => [fzhn] => [fhon] => [tzhn] => [thon] => [calc_in_ttp] => [htn] => Sonus Festival Ticket [description] => 18.08.-22.08.2014 [vnd] => 2014-08-18 [bsd] => 2014-08-22 [extras_dates] => [ton] => CMT d.o.o. [ido] => 23 [thumb_pic] => http://www.ors.si/sellitx/phps/sellit/showPic.php?type=extraspic&picname=&rnd=493807 [ppc] => 139 [hsc] => 199|0||0|2014-08-18|2014-08-22| [url] => ?vnd=18.08.2014&bsd=22.08.2014&tag=sonus%2Cfestivalticket&epc=2&toc=CMT&sel[gid]= [options] => Array ( [0] => Array ( [id] => 0 [name] => default [oid] => [zhc] => [hon] => [zhn] => [ppc] => 695 [ttp] => 1390 [stock] => -1 [hsc] => 199|0||0|2014-08-18|2014-08-22| [rates] => Array ( [2014-08-18] => Array ( [datum] => 2014-08-18 [ppc] => 139 [hsc] => 199|0||0|2014-08-18|2014-08-18|2014-08-18 ) [2014-08-19] => Array ( [datum] => 2014-08-19 [ppc] => 139 [hsc] => 199|0||0|2014-08-19|2014-08-19|2014-08-19 ) [2014-08-20] => Array ( [datum] => 2014-08-20 [ppc] => 139 [hsc] => 199|0||0|2014-08-20|2014-08-20|2014-08-20 ) [2014-08-21] => Array ( [datum] => 2014-08-21 [ppc] => 139 [hsc] => 199|0||0|2014-08-21|2014-08-21|2014-08-21 ) [2014-08-22] => Array ( [datum] => 2014-08-22 [ppc] => 139 [hsc] => 199|0||0|2014-08-22|2014-08-22|2014-08-22 ) ) ) ) ) ) ===== Return parameters ===== * ''header'' (array) : information about a selected region and paging information * ''typ'' : content type * ''offers'' : number of offers found * ''pages'' : number of pages * ''perpage'' : records per page * ''offset'' : current page (first page have offset 0, second page have offset 1, ...) * ''sid'' : session id used * ''rgc'' : selected region code (ID) * ''rgn'' : selected region name * ''rgg'' : selected region group code (ID) * ''rggn'' : selected region group name * ''top_offers (array)'' : a list of top offfers (this list depends on a filter ''$topOffersFilter'', if this filter is not set then this array is empty. * ''offers (array)'' : a list of offers * ''htn'' : accommodation name * ''gid'' : accommodation GIATA ID * ''pic'' : picture thumbnail * ''stc'' : hotel category * ''ovr'' : overall rating * ''emf'' : users recommendation (in percents) * ''cnt'' : number of reviewers * ''pax'' : number of persons * ''rooms'' : number of rooms * ''bedrooms'' : number of bedrooms * ''hon'' : city name * ''oid'' : city ID * ''zhn'' : destination name * ''zhc'' : destination code (IATA code) * ''rgc'' : region code (ID) * ''rgn'' : region name * ''rgg'' : region group ID * ''rggn'' : region group name * ''picf'' : full picture * ''geo'' : does this accommodatin have a geo location codes (1) or not (0) * ''lat'' : latitude * ''lon'' : longitude * ''ppc'' : lowest price per person for this region * ''url'' : a suggested URL with search parameters for [[trips|trips method]] * ''vpcs (array)'' : a list of all services that this accommodation offers * ''zacs (array)'' : a list of all room types that this accommodation offers * ''tocs (array)'' : a list of all touroperators that sels this accommodation * ''facts (array)'' : a list of all facts that this accommodation offers. Here is an entire list of [[hotel_facts|facts]] available in ORS. * ''filters (array)'' : all possible filters * ''toc (array)'' : filters by touroperators * ''selected'' : (0) if this filter is not selected, (1) if this filter is selected * ''val (array)'' : a list of values you can use for this filter * ''zac'' : filters by room types * ''vpc'' : filters by service types * ''stc'' : filters by hotel category * ''ovr'' : filters by overall rating * ''oid'' : filters by city ID * ''rfilters (array)'' : range filters * ''ppc'' : filters by price per person * ''sorts (array)'' : possible sorting * ''htn'' : sort by hotel name * ''hon'' : sort by city * ''stc'' : sort by hotel category * ''ovr'' : sort by rating * ''ppc'' : sort by price (default sorting) ===== Return parameters (Extras) ===== Here is a list of return parameters when searching for content type ''extras'' * ''header (array)'' : header info * ''offers (array)'' : a list of offers * ''id'' : extras ID * ''ide'' : extras ID (same as ''id'') * ''opt'' : option ID. Some extras have different options / variants. This is also a key in ''offers[0][options] (array)'', In simple extras like tickets, massage, ... there is only one option and it has value 0. * ''opt_name'' : option name. For simple extras this is empty. * ''time'' : extras time (arrival time / checkin time). Some extras have different checkin time. Format: 'H:i:s'. For simple extras this is empty. * ''etype'' : extras inventory type. * **0** : if etype is 0 then this extras stock is dependent on each booked date. For example, a bus transfers has stock that is dependent on the date you book transfer. * **1** : if etype is 1 then this extras has a global stock, regardless of the booked date. For example, a tickets has a global stock. * ''etype2'' : extras tyoe * **0** : __Simple service__. Simple service type is used for extras like tickets, bike riding, massage, ... extras that have no other variants or different arrival times * **1** : __Simple service with arrival times__. This extras type extends simple service with different arrival times (for example: shuttle transfers with different pickup times) * **2** : __Service with different options__. This extras type extends simple service with different options (for example: bus transfers with different entry points) * **3** : __Service with different options and arrival times__. This extras type extends simple service with different options and arrival times (for example: bus transfers with different entry points and different entry points). * ''transfer'' : (1) means this is a transfer from point Airport to city (or from City to Airport). (0) means this is not a transfer. * ''fzhc'' : (only when ''transfer'' = 1), from Airport code * ''tzhc'' : (only when ''transfer'' = 1), to Airport code * ''foid'' : (only when ''transfer'' = 1), from City ID * ''toid'' : (only when ''transfer'' = 1), to City ID * ''fzhn'' : (only when ''transfer'' = 1), from Airport name * ''tzhn'' : (only when ''transfer'' = 1), to Airport name * ''fhon'' : (only when ''transfer'' = 1), from City name * ''thon'' : (only when ''transfer'' = 1), to City name * ''calc_in_ttp'' : (1) price is included in the package, (0) price is not included in package. When price is included in package, then this extras price is usually 0. * ''htn'' : extras name / title * ''description'' : extras description * ''vnd'' : start date * ''bsd'' : end date * ''extras_dates'' : selected dates * ''thumb_pic'' : picture thumbnail * ''ppc'' : price per person * ''hsc'' : unique hash code for this extras (use this code for booking) * ''url'' : experimental ! * ''options (array)'' : different options / variants. * ''id'' : option ID * ''name'' : option name (when ID is 0 then option name is 'default') * ''ppc'' : price per person for this option * ''ttp'' : total price for all persons * ''stock'' : available stock for this option (if ''etype == 1'' and ''stock == -1'' then stock is unlimited) * ''hsc'' : unique hash code for this option * ''rates (array)'' : price rates for each selected date * ''#date'' : key for each rate is a date in format: 'Y-m-d' * ''datum'' : date * ''ppc'' : price per person * ''hsc'' : unique hash code for this option/date ===== Examples ===== * Example with basic search parameters with selected region group ID $searchParams = array( 'vnd' => '30.10.2014', // start date 'bsd' => '15.11.2014', // end date 'tdc' => '1-4', // duration [min-max] days 'epc' => '2', // number of adults 'rgcs' => '100023', // region code for entire Coratia ); $offers = $soapClient->orsxml_hotel_api_call( 'offers', $searchParams, $header ); * Example : with basic search parameters with selected city $searchParams = array( 'vnd' => '30.10.2014', // start date 'bsd' => '15.11.2014', // end date 'tdc' => '1-4', // duration [min-max] days 'epc' => '2', // number of adults 'hon' => 'bled' // city ); $offers = $soapClient->orsxml_hotel_api_call( 'offers', $searchParams, $header ); * Example using filters // filter offers using single filter $searchParams = array( 'vnd' => '30.10.2014', // start date 'bsd' => '15.11.2014', // end date 'tdc' => '1-4', // duration [min-max] days 'epc' => '2', // number of adults 'rgcs' => '100023', // region code for entire Coratia 'filter' => array( 'zac' => 'DZ' // filter by room type (display only double rooms) ) 'rfilter' => array( 'ppc' => '50-100' // filter by price ) ); $offers = $soapClient->orsxml_hotel_api_call( 'offers', $searchParams, $header ); // filter offers using more then one filters $searchParams = array( 'vnd' => '30.10.2014', // start date 'bsd' => '15.11.2014', // end date 'tdc' => '1-4', // duration [min-max] days 'epc' => '2', // number of adults 'rgcs' => '100023', // region code for entire Coratia 'filter' => array( 'zac' => 'DZ', // filter by room type (display only double rooms) 'vpc' => 'AI,HP' // filter by service type (display only all inclusive and halfboard offers) ) ); $offers = $soapClient->orsxml_hotel_api_call( 'offers', $searchParams, $header ); * Example using sorting // sort by hotel name (ascending order) $searchParams = array( 'vnd' => '30.10.2014', // start date 'bsd' => '15.11.2014', // end date 'tdc' => '1-4', // duration [min-max] days 'epc' => '2', // number of adults 'rgcs' => '100023', // region code for entire Coratia 'sort' => 'htn|asc' // sort by hotel name in ascending order ); $offers = $soapClient->orsxml_hotel_api_call( 'offers', $searchParams, $header ); // sort by price (descending order) $searchParams = array( 'vnd' => '30.10.2014', // start date 'bsd' => '15.11.2014', // end date 'tdc' => '1-4', // duration [min-max] days 'epc' => '2', // number of adults 'rgcs' => '100023', // region code for entire Coratia 'sort' => 'ppc|desc' // sort by price in descending order ); $offers = $soapClient->orsxml_hotel_api_call( 'offers', $searchParams, $header ); * Example using paging // return 4th page $searchParams = array( 'vnd' => '30.10.2014', // start date 'bsd' => '15.11.2014', // end date 'tdc' => '1-4', // duration [min-max] days 'epc' => '2', // number of adults 'rgcs' => '100023', // region code for entire Coratia 'offset' => '3' // display 4th page (offset 0 returns 1st page) ); $offers = $soapClient->orsxml_hotel_api_call( 'offers', $searchParams, $header ); ===== JSON Examples ===== @see [[ors-soap-api:public:json_api]] how to post request. { "requestType" : "search", "action": "offers", "search": { "typ": "hotel", "vnd": "2018-01-10", "bsd": "2018-03-10", "tdc": "1-5", "rgcs": "100023", "epc": "2" }, "top" : { "toc" : "FTI", "stc" : "3" }, "header": { "lang": "[lang]", "usr" : "[usr]", "pass": "[pass]", "agid": "[agid]" } } ===== Examples (Extras) ===== Searching for extras is a bit different. * Example searching for simple extras // you must speficy one date (usually this is a checkin date if extras is used in combination with accommodation) $searchParams = array( 'vnd' => '30.10.2014', // start date 'bsd' => '30.10.2014', // end date 'tag' => 'ticket', // using tag 'ticket' (tags are defined by owner of extras) 'epc' => '2', // number of adults 'toc' => 'ABC' // touroperator code ); $offers = $soapClient->orsxml_extras_api_call( 'offers', $searchParams, $header ); * Example searching for simple extras with arrival times // search for simple extras with times $searchParams = array( 'vnd' => '30.10.2014', // start date 'bsd' => '30.10.2014', // end date 'time' => '10:00:00', // arrival time (H:i:s) 'tag' => 'bus', // using tag 'ticket' (tags are defined by owner of extras) 'epc' => '2', // number of adults 'toc' => 'ABC' // touroperator code ); $offers = $soapClient->orsxml_extras_api_call( 'offers', $searchParams, $header ); * Example searching for inbound and outbound transfers // search for inbound transfer $searchParams = array( 'vnd' => '30.10.2014', // start date 'bsd' => '30.10.2014', // end date 'epc' => '2', // number of adults 'transfer' => '1', // search for transfer 'foid' => '12225', // from City ID 'tzhc' => 'SPU', // to airport (IATA code) 'toc' => 'ABC' // touroperator code ); $inbound_offers = $soapClient->orsxml_extras_api_call( 'offers', $searchParams, $header ); // search for outbound transfer $searchParams = array( 'vnd' => '30.10.2014', // start date 'bsd' => '30.10.2014', // end date 'epc' => '2', // number of adults 'transfer' => '1', // search for transfer 'fzhc' => 'ZAG', // from airport (IATA code) 'toid' => '12225', // to City ID 'toc' => 'ABC' // touroperator code ); $outbound_offers = $soapClient->orsxml_extras_api_call( 'offers', $searchParams, $header ); * Example searching for extras that are in combination with accommodation (packages) $searchParams = array( 'vnd' => '30.10.2014', // start date 'bsd' => '30.10.2014', // end date 'epc' => '2', // number of adults 'idp' => '1005', // offer ID. This ID is located in 'Check method' response. Without this ID you won't get packaged extras 'toc' => 'ABC' // touroperator code ); $offers = $soapClient->orsxml_extras_api_call( 'offers', $searchParams, $header );