Depending on every chain, calculation rules may change. In order to distinguish which file belongs to which chain, it is necessary to check the codes associated. Here the list of chains available through AIF:
|
INTEGRATION CODE |
|
15 |
|
19 |
|
20 |
|
21 |
|
24 |
|
25 |
|
26 |
In AIF, chain information (code) will be informed in the AIF file name. For example:
ID_B2B_15#OD15FF_79852_-16283_M
Where:
ID_B2B_15#OD15FF is the contract name (as you will see it in the xml) with the chain code (ID_B2B_15 where ID_B2B_ informs it is an external contract and 15 is the integration code above)
79852 is the hotel code this contract belongs to.
-16283 is the internal code for this contract.
M informs it is a Merchant contract (see 9.1 section).
This structure informs about the contract header: range of dates this contract is valid for, ages for children... Basically, it remains as before, but there is a new field now (only for external providers): Is total price per stay.
This field indicates if it is necessary to sum several price lines from [SIAP.Amount] in order to get the final price for reaching the length of stay desired or not.
If value is Y, it is not possible to do the calculation over other lines to get the final price with the length of stay required as it is returning the lengths of stay available for this room (if a length of stay is not in the price lines in [SIAP], it is not bookable).
If value is N, it is possible to do the calculation over other lines to get the final price with the length of stay required (if a length of stay is not in the price lines in [SIAP], it is possible to do the sum to get the length of stay required).
{CCON}
Y:LVS:256:16283:ID_B2B_21#B2B:U10:H:12796:18752:20200801:20200831:N:USD::
NOR:M:N:N:::B::U:::N:N:MjAxNDA3MjU=:P:Y
{/CCON}
[...]
{SIAP}
20201001:20201031:DBL:CX:RO:1:1::N:(0.000,0.000,76.080)
20201001:20201031:DBL:CX:RO:2:1::N:(0.000,0.000,85.080)
20201001:20201031:DBL:CX:RO:3:1::N:(0.000,0.000,103.250)
{/SIAP}
As [CCON.Is total price per stay] is Y, it is not possible to sum prices from [SIAP] in order to get the length of stay desired, so if for example, the booking desired was for 7 nights of length of stay, this contract will not be available, as only stays for 1, 2 and 3 nights would be possible for this room.
{CCON}
Y:LVS:256:16283:ID_B2B_21#B2B:U10:H:12796:18752:20200801:20200831:N:USD::
NOR:M:N:N:::B::U:::N:N:MjAxNDA3MjU=:P:N
{/CCON}
[...]
{SIAP}
20201001:20201031:DBL:CX:RO:1:1::N:(0.000,0.000,76.080)
20201001:20201031:DBL:CX:RO:2:1::N:(0.000,0.000,85.080)
20201001:20201031:DBL:CX:RO:3:1::N:(0.000,0.000,103.250)
{/SIAP}
As [CCON.Is total price per stay] is N, it is possible to sum prices from [SIAP] in order to get the length of stay desired, so if for example, the booking desired was for 7 nights of length of stay, you must sum prices from lines with length of stay 3+3+1 (twice third line and one time first line. From stay more restrictive to less restrictive).
Specification
Field |
Length |
Type |
Null |
Description |
Initial date |
8 |
Date |
N |
Travel start date |
End date |
8 |
Date |
N |
Travel end date |
Room type |
3 |
Text |
N |
|
Characteristic |
15 |
Text |
N |
|
Board type |
2 |
Text |
N |
|
Length of stay (LOS) |
|
Number |
N |
|
Adults |
2 |
Number |
Y |
Number of adults |
Children |
|
Number |
Y |
If a room admits children, it informs the range of age for each child where first value indicates number of children which the rule applies to
and second and third values indicates the minimum and maximum age for those children.
|
Occupancy |
1 |
Boolean |
N |
Indicates how to manage/build the occupancy per room:
|
Net price |
|
Number |
Y |
Contains net sale price for the product |
Price |
|
Number |
Y |
Contains the final price for this product when sold to public
|
Amount |
|
Number |
Y |
Contains the amount for the product |
Recurrence | Number | N | Contains the number of days this price is repeated (if this number is 2, that would mean that this price will be the same for 2 consecutive days). |
These examples inform about the availability and prices for DBL-ST room with RO board:
{SIAP}
20110601:20110605:DBL:ST:RO:1:2::Y:(100.000,90.000,100.000,4)
20110601:20110605:DBL:ST:RO:2:2::Y:(100.000,90.000,100.000,3)
20110601:20110605:DBL:ST:RO:5:2:(1,2-8)(2,9-12):N:(100.000,90.000,100.000,1)
{/SIAP}
This structure informs about the prices for external providers. Basically it remains as before, but now there are 2 new fields: Children and Is price per pax.
20201001:20201031:QUA:2Q-LC:RO:1:2:(2,0,17):
20201001:20201031:QUA:2Q-LC:RO:1:2:(3,0,17):
When [SIAP.Occupancy] is N, structure [CNHA] will be empty when prices are per room. In those cases, it is necessary to check the structure [SIAP] in order to know for which occupancy those prices are valid (occupancy will be informed in [SIAP] structure directly).
When [SIAP.Occupancy] is Y, structure [CNHA] must be checked and fields from [SIAP] will be empty.
If [SIAP.Occupancy] is N, AIF has the following:
{CNHA}
{/CNHA}
[...]
{SIAP}
20200901:20200930:DBL:DX-KG-NB:RO:1:1::N:(0.000,0.000,162.760)
{/SIAP}
In this case, occupancy is informed in [SIAP.Adults] and [SIAP.Children], and [CNHA] is empty. Price in [SIAP.Amount] is valid only for the occupancy in [SIAP.Adults] and [SIAP.Children] and the [SIAP.Length of stay] informed.
If [SIAP.Occupancy] is Y, AIF has the following:
{CNHA}
DBL:DX-KG-NB:2:1:3:2:1:0:1:
{/CNHA}
{SIAP}
20200901:20200930:DBL:DX-KG-NB:RO:1:::Y:(0.000,0.000,162.760)
{/SIAP}
In this case, occupancy is informed in [CNHA], and [SIAP.Adults] and [SIAP.Children] is empty. Price in [SIAP.Amount] is valid for any possible occupancy combination from [CNHA] for this room (in the example above, for DBL.DX-KG-NB).
{SIAP}
20220601:20220605:DBL:ST:RO:1:2::Y:(100.000,90.000,100.000,4)(150.000,120.000,150.000,1)
20220601:20220605:DBL:ST:RO:2:2::Y:(100.000,90.000,100.000,3)(150.000,90.000,150.000,2)
20220601:20220605:DBL:ST:RO:5:2:(1,2-8)(2,9-12):N:(100.000,90.000,100.000,1)(150.000,90.000,150.000,4)
{/SIAP}
For the first example, from 01/06/2022 until 04/06/2022 the net price, price and amount would be 100, 90 and 100 respectively while for 05/06/2022 the price would be 150, 90 and 150 respectively. This recurrence should contain all the dates in the period (initial and final date), so it necessary to bear it in mind in order to apply properly the correct price.
Field |
Length |
Type |
Null |
Description |
Internal Name |
Initial date |
8 |
Date |
N |
Travel start date |
fec_desde |
Final date |
8 |
Date |
N |
Travel end date |
fec_hasta |
Room type |
3 |
Text |
N |
The combination of the Room Type, Room Characteristic is the room code in the XML. However certain offers and supplement can be applied to specific Room Type and/or Room Characteristic.File will contain multiple room types. No limit on the number of room types |
cod_hab |
Characteristic |
15 |
Text |
N |
|
cod_car |
Board |
2 |
Text |
Y |
Board code. If empty means that this information common for all boards of this room. |
cod_board |
Release Min |
4 |
Number |
N |
Min release days. 0 is day of departure (i.e. no release date) |
nro_release |
Release Max |
4 |
Number |
N |
Max release days. 0 is day of departure (i.e. no release date) |
nro_release |
Allotment |
2 |
Number |
N |
Remaining allotment from 0 to 10. 10 will indicate the number of rooms available is equal or greater than 10 |
nro_disponible |
Recurrence | Number | N | Contains the number of days this allotment is repeated (if this number is 2, that would mean that this allotment will be the same for 2 consecutive days). |
{SIIN}
20110501:20110508:DBT:ST:BB:(0,0,8,1)(0,0,10,5)(0,0,9,1)(0,0,10,1)
20110501:20110508:DBT:ST:BB:(0,0,6,1)(0,0,10,6)(0,0,9,1)
{/SIIN}
This new structure informs about the release and allotment per room in external supplier contract. Basically it remains the same as [CNIN] structure but includes some new fields:
Example:
Booking from 01/12/14 to 05/12/14
20201201:20201231:DBL:2Q::(2,30,5)(2,30,5)(5,60,5)
In example above, Release Min is 2 days (if check-in date is 01/12/14, the booking must be confirmed on 29/11/14. After this date, room will not be longer available (for bookings with check-in date on 01/12/14)).
Release Max is 30 days for bookings with check-in date on 01/12/14, so maximum you can do the booking confirmation for this booking 30 days before the 01/12/14 (in this case, the maximum date for doing the booking would be the 01/11/14).
In dark blue the period included until Release Max. In pink days that are included on Release Min. In blue the check-in date. In purple dates that exceed release.
Field |
Length |
Type |
Null |
Description |
Internal Name |
Initial date |
8 |
Date |
N |
Travel starts date |
fec_desde |
Final date |
8 |
Date |
N |
Travel end date |
fec_hasta |
Room type |
3 |
Text |
Y |
|
cod_hab |
Characteristic |
15 |
Text |
Y |
|
cod_car |
Board |
3 |
Text |
Y |
|
|
Is per check-in date |
1 |
Boolean |
N |
Indicates if validation is for check in date or for the whole stay:
|
|
Is per range |
1 |
Boolean |
N |
Indicates if validation is per range or per list of days:
|
|
Days |
|
Number |
Y |
If Is per range = Y, data provided will indicate the minimum and maximum stays separated by comma. Example: (1,5) where bookings for 1, 2, 3, 4, and 5 days are possible.
|
|
If data in Days is empty, there is not restriction for any day (any stay is valid)
{CNEM}
20200626:20200630:QUA:2B::Y:N:(2,3)(1)()()()
20200626:20200630:QUA:2B::N:Y:(1,3)(1,4)(4,5)()
{/CNEM}
Minimum and maximum stay per day will be informed on this section for external providers.
It is possible to have for the same dates, same room type, and same board, 2 different lines in [SIEM], one per range and another per list of days. If this happens, it is necessary both lines are fulfilled in order to the requested booking is possible.
In those cases, [SIEM.Is per check-in date] will have the same value for both lines (it is not possible you will have different values for this field in these 2 lines).
Example:
20200901:20200930:DBL:AE-QU::N:Y:(1,28)(1,8)(1,8)(1,28)(1,28)
20200901:20200930:DBL:AE-QU::N:N:()(1,2,8)(1,2,8)()()
In the cases above, the first line indicates the validation is per range for room DBL.AE-QU from 01/09/14 to 30/09/14 and the second line indicates the validation is per list of days for room DBL.AE-QU from 01/09/14 to 30/09/14.
It is necessary both lines are fulfilled to go on with the booking. If some of them are not fulfilled the booking will not be possible through xml.
Depending on the validation of fields [SIEM.Is per check-in date] and [SIEM.Is per range], it is necessary to apply it in one way or another:
20210201:20210228:QUA:2Q-DX::Y:Y:(1,28)(1,28)(7,28)(7,28)(1,28)
For QUA.2Q-DX, the 1st can stay from 1 to 31 nights, 2nd from 1 to 31 nights, 3rd from 7 to 31 nights.
As [SIEM.Is per check-in date] is Y, a stay from 1 to 4 February (3 nights) would be valid as it complies the rule for the 1st and it is not necessary to check the 2nd and 3rd.
20210201:20210228:QUA:2Q-DX::Y:N:(1,2)(1,2,3)(7,8)(7,8)(1,2)
For QUA.2Q-DX, the 1st can stay 1 and 2 nights, 2nd can stay 1, 2 and 3 nights, 3rd can stay 7 and 8 nights.
As [SIEM.Is per check-in date] is Y, a stay from 1 to 4 February (3 nights) would not be valid as it does not comply the rule for the 1st and it is not necessary to check the 2nd and 3rd.
20210201:20210228:QUA:2Q-DX::N:Y:(1,3)(1,2)(7,15)(7,15)(1,28)
For QUA.2Q-DX, the 1st can stay from 1 to 3 nights, 2nd from 1 to 2 nights, 3rd from 7 to 15 nights.
As [SIEM.Is per check-in date] is N, a stay from 1 to 4 February (3 nights) would not be valid as it complies the rule for the 1st but not for the 2nd neither 3rd, as for the 2nd is necessary to stay maximum 2 nights and for the 3rd is necessary to stay minimum 7 nights.
20210201:20210228:QUA:2Q-DX::N:N:(1,3)(1,2)(7,8)(7,15)(1,31)
For QUA.2Q-DX, the 1st can stay 1 or 3 nights, 2nd can stay 1 or 2 nights, 3rd can stay 7 or 8 nights.
As [SIEM.Is per check-in date] is N, a stay from 1 to 3 February (2 nights) would not be valid as it complies the rule for the 2nd but does not comply the rule for the 1st, as it is only possible to do a booking for stays of 1 or 3 nights.
This information is displayed at CNES structure.
The [CNES.type] indicator informs about the application: if it is a restriction to check in or check out date.
In both cases seek applicable records, they shall fulfil the following conditions:
After that, we will validate the days when the contract requires checking in or checking out. Every record informs about the day of the week. This value must be true.
In the case of more than one applicable record, when you have just one of them to allow checking in or checking out then it will be valid for booking.
In the absence of any record, then booking is allowed.
How to do the calculation
The process to get the price for the external inventory is very simple, as final price is always calculated and published. The first step consists in checking the [CCON.External inventory] and only processes those files which [CCON.External inventory] value is true.
Then the price information is informed at SIAP structure. There you can see the final price for the requested availability:
In all the cases, if [SIAP.Amount] is empty, means that there are not prices for those dates in the length of stay informed.
Field |
Length |
Type |
Null |
Description |
Initial date |
8 |
Date |
N |
Application start date |
End date |
8 |
Date |
N |
Application end date |
Days |
|
Number |
Y |
Days before the client check in where the cancellation fee applies |
Hours |
|
Number |
Y |
Hours before the client check in where the cancellation fee applies. Local hotel time is considered here. |
Charge type |
1 |
Enumeration |
N |
1: First night E: Stay |
Amount |
|
Number |
Y |
|
Percentage |
|
Number |
Y |
{SICF}
20110601:20110605:1::E::100
{/SICF}
If you want to show the cancellation policies, you have to check this information at SICF structure. The cancellation fee can apply to the first night or to the entire stay depending on the [SICF.Charge type] value. If the percentage is informed and [SICF.charge type] is 1 [first night] then you have to divide the total amount of the stay by the length of stay in order to calculate ht price for the first night.
NOTE: As contracts from our third party providers are not in our direct database, it is possible there are price differences. As always the final price for external providers is confirmed through xml (ServiceAddRS/CheckRateRS).
If you want to book a room for 7 nights, and you have length of stay of 3, 2 and 1 nights, you should select first 2 length of stay for 3 nights (3+3) and later on select the stay of 1 night (3+3+1) as the most restrictive are the ones that include more nights in the length of stay (you should use the less restrictive ones only when there is no other option so most restrictive ones cannot be applied because the length of stay of the booking is exceeded).
NOTE: The combination of these days must be from more restrictive to less restrictive.
Example:
Booking from 10/09 to 17/09 for 2 adults
20200905:20200930:TWN:SU:RO:3:2::N:(0.000,0.000,403.520)(0.000,0.000,369.470)(0.000,0.000,356.190)(0.000,0.000,381.930)(0.000,0.000,415.970)(0.000,0.000,437.560)(0.000,0.000,437.560)(0.000,0.000,429.250)(0.000,0.000,420.950)
20200905:20200930:TWN:SU:RO:1:2::N:(0.000,0.000,148.620)(0.000,0.000,140.320)(0.000,0.000,114.580)(0.000,0.000,114.580)(0.000,0.000,127.030)(0.000,0.000,140.320)(0.000,0.000,148.620)(0.000,0.000,148.620)(0.000,0.000,140.320)(0.000,0.000,140.320)(0.000,0.000,140.320)(0.000,0.000,127.030)
In AIF, according the above, we have the following:
|
|
|
|
|
|
10 /09 /2020 |
11 /09 /2020 |
12 /09 /2020 |
13 /09 /2020 |
14 /09 /2020 |
15 /09 /2020 |
16 /09 /2020 |
TWN |
SU |
RO |
3 |
2 |
N |
0.000,0.000,437.560 |
|
|
(0.000,0.000,420.950 |
|
|
|
TWN |
SU |
RO |
1 |
2 |
N |
|
|
|
|
|
|
(0.000,0.000,127.030 |
Where from 10/09/2020 to 12/09/2020, the price is 437.56 (price for 3 nights), from 13/09/2020 to 15/09/2020 the price is 420.95 (price for 3 nights) and the price for 16/09/2020 is 127.030 (price for 1 night), so total price would be 985.540.
If price in [SIAP.Amount] section is for just one day, you must add the price for every day as usual.
Example:
Booking from 05/12/2020 to 10/12/2020 for 2 adults
In AIF we have the following:
20201201:20201231:DBL:DI-KG-NS:BB:1:1::N:
20201201:20201231:DBL:DI-KG-NS:BB:1:2:(1,0,17):N:
20201201:20201231:DBL:DI-KG-NS:BB:1:2::N:
20201201:20201231:DBL:DI-KG-NS:BB:1:3::N
Where the only valid line is the third one, as first is for 1 adult, second for 2 adults and 1 child and fourth is for 3 adults.
20201201:20201231:DBL:DI-KG-NS:BB:1:2::N:(0.000,0.000,60.370)(0.000,0.000,60.370)(0.000,0.000,61.180)(0.000,0.000,62.010)(0.000,0.000,62.010)(0.000,0.000,63.290)(0.000,0.000,63.290)(0.000,0.000,63.290)(0.000,0.000,63.290)
Prices from 05/12 to 10/12 are the following:
|
|
|
|
|
|
05/12/2020 |
06/12/2020 |
07/12/2020 |
08/12/2020 |
09/12/2020 |
DBL |
DI-KG-NS |
BB |
1 |
2 |
N |
(0.000,0.000,62.010 |
(0.000,0.000,63.290 |
(0.000,0.000,63.290 |
(0.000,0.000,63.290 |
(0.000,0.000,63.290 |
Total price for this room would be 315.17