previous

Future Occupancy by Rate Category API

The Future Occupancy by Rate Category API allows the external vendor to collect future occupancy statistics by rate category. To enable this functionality, the third-party vendor makes the Future Occupancy by Rate Category API call providing basic information. In response, OPERA creates a session specific temporary table, temp_occupancy_data. The third-party vendor then fetches records from this table.

Important!

To prevent a compromise of system performance, it is not recommended to call the Future Occupancy API for a number of days into the future (in_number_of_days) that is greater than 365. Additionally, it is recommended to call smaller windows of occupancy multiple times (e.g., a max of 180 days twice versus 365 days once).

Because of memory limitations, the APIs will not populate PL/SQL tables. Instead, a global temp table (temp_occupancy_data) is populated which needs to be queried to collect the data after the API call. See Table Structure for details.

Since the session specific global temp table will be populated, please inform any other external vendors to not use any transaction specific command (rollback/commit) between the calling of API, querying of table, and fetching the data.

In order to ensure accuracy of the data and irrespective of the source of the reservation (e.g., manually input, sent from CRS, Web/Internet, etc.) it is imperative that all reservations/blocks have a rate code (for all nights of the stay), as unlike market code, rate code is not a compulsory column on the reservation or block tables. In the event that one or more reservations exist in the system without a rate code, OPERA will pass the extracted data via the API which may then contain records with null rate category values. It is therefore important to recognize the possibility of compromised data under such conditions.

Quality of data resulting from this API could be compromised if:

1. Rate codes are not mandatory for individual reservations.

2. Rate codes are not mandatory for group/block reservations.

3. User error when modifying a multi night stay reservation accidentally removes the rate code for a night or more.

4. Reservation pushed down from external system without rate code.

All dates will return a row for each configured rate category and a null/blank row. In the event that a reservation does not have a rate code, thereby also not having an associated rate category, the statistics for this reservation will fall into the null/blank rate category row returned.

Procedure

This API will populate a temporary table (session specific) which must then be queried to fetch the required data.

occupancy.get_future_data

(in_resort,
in_from_date,
in_number_of_days,
in_type,
out_msg,
in_res_type default null,
in_rate_category default null,
in_room_type default null);

Parameters

Parameter

Data Format

in_resort

VARCHAR2

in_from_date

Date

in_number_of_days

Number

in_type

VARCHAR2
default = 'TOTAL'
valid values = 'TOTAL','RATECATEGORY','RESTYPE','RESTYPE_RTCAT'.

out_msg

OUT VARCHAR2

in_res_type

VARCHAR2
Comma-separated list of valid OPERA reservation types.
Applicable only to in_type = 'RESTYPE' or 'RESTYPE_RTCAT'
If 'TOTAL' or 'RATECATEGORY' value sent to be NULL

in_rate_category

VARCHAR2
Comma-separated list of valid OPERA rate categories.
Applicable only to in_type = 'RATECATEGORY' or 'RESTYPE_RTCAT'.
If 'TOTAL' or 'RESTYPE' value sent to be NULL.

in_room_type

VARCHAR2
Comma separated list of valid OPERA room types.
Null value will be treated as all room types.

Note: If in_type = 'TOTAL' or 'RATECATEGORY' the API will return only the rooms sold figures for reservations with DEDUCT reservation statuses, and will not include figures for reservations having a NON DEDUCT status.

IMPORTANT: In the event that a reservation does not have a rate code, and therefore has no rate category associated with it, the API will return occupancy with a blank (null) rate category.

When the table has been created and populated, the out_msg is returned; if the table cannot be created and populated, a relevant error message is returned.

Example 1 - Future Occupancy by Rate Category:

Fetch future data for property ODH by rate category from the business date for 365 days.

declare

vmsg VARCHAR2(200);

begin

occupancy.get_future_data ('ODH',
pms_p.business_date,
365,
'RATECATEGORY',
vmsg);

If vmsg = 'SUCCESS' then

--- query the temp_occupancy_data table.

end if;

end;

Example 2 - Future Occupancy by Rate Category Filtered for Room Type DLX:

Fetch future data for property ODH by rate category from the business date for 365 days for room type DLX.

declare

vmsg VARCHAR2(200);

begin

occupancy.get_future_data ('ODH',
pms_p.business_date,
365,
'RATECATEGORY',
vmsg,
null,
null,
'DLX');

If vmsg = 'SUCCESS' then

--- query the temp_occupancy_data table.

end if;

end;

Example 3 - Future Occupancy by Rate Category by Reservation Type:

Fetch future data for property ODH by rate category by reservation type from the business date for 180 days.

Note: It is suggested that no more than 180 days' data be fetched.

declare

vmsg VARCHAR2(200);

begin

occupancy.get_future_data ('ODH',
pms_p.business_date,
180,
'RESTYPE_RTCAT',
vmsg,
'NON GTD, DEPREQ',
-- Comma separated list of OPERA
reservation types. If '' is sent then
all reservation types are assumed --
'RACK,GROUP,CORP'
-- Comma separated list of valid OPERA
rate categories. If '' is sent then
all rate categories are assumed.--
);

If vmsg = 'SUCCESS' then

--- query the temp_occupancy_data table.

end if;

end;

Table Structure

temp_occupancy_data

Field

Data Type

Notes

RESORT

VARCHAR2(20) NOT NULL

Property code

OCCUPANCY_DATE

Date NOT NULL

Date

PHYSICAL_ROOMS

Number

Physical rooms

OO_ROOMS

Number

Out of order rooms

OS_ROOMS

Number

Out of service rooms

ROOMS_SOLD

Number

Rooms sold

ROOM_REVENUE

Number

Room revenue

ROOM_ARRIVALS

Number

Arrival rooms

ROOM_DEPARTURES

Number

Departure rooms

TOTAL_REVENUE

Number

Total revenue

FOOD_REVENUE

Number

Food and beverage revenue

CANCELLED_ROOMS

Number

Cancelled rooms

NO_SHOW_ROOMS

Number

No show rooms

RES_TYPE

VARCHAR2

Reservation type

RATE_CATEGORY

VARCHAR2(20)

Rate category

Revenue values will be prepared and stored based on the number of decimals internally set. This may mean, for example, that in a 2-decimal environment, 12 decimal places might be exposed.

Revenue values extracted will be net revenues. The interpretation of "net" depends on whether the environment is PMS, ORS, or integrated PMS/ORS; and on the configuration of the environment.

Where the in_type variable 'RESTYPE_RTCAT' has been called, multiple rows for the same date will exist for the various rate categories and reservation types; therefore, if the property was configured with 24 rate categories and 10 reservation types, there could potentially be 240 rows for the specified date. If called for 180 days this could amount to 43,200 rows.