@findhotel/sapi 1.25.4 → 1.25.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +301 -1
- package/dist/index.js +1 -1
- package/dist/types/packages/core/src/app-config.d.ts +1 -0
- package/dist/types/packages/core/src/rooms.d.ts +10 -1
- package/dist/types/packages/core/src/sapi.d.ts +3 -2
- package/dist/types/packages/core/src/types/rooms.d.ts +24 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -275,7 +275,6 @@ For full documentation, check [search method api](#search-method).
|
|
|
275
275
|
<a id="tutorial-get-rooms"></a>
|
|
276
276
|
|
|
277
277
|
Get rooms data and rooms\' offers:
|
|
278
|
-
|
|
279
278
|
```js
|
|
280
279
|
const rooms = await sapiClient.rooms({
|
|
281
280
|
hotelId: "47319",
|
|
@@ -285,6 +284,17 @@ const rooms = await sapiClient.rooms({
|
|
|
285
284
|
});
|
|
286
285
|
```
|
|
287
286
|
|
|
287
|
+
We also introduced `roomsV2` which will soon deprecate the old `rooms` method
|
|
288
|
+
|
|
289
|
+
```js
|
|
290
|
+
const rooms = await sapiClient.roomsV2({
|
|
291
|
+
hotelId: "47319",
|
|
292
|
+
checkIn: "2021-10-10",
|
|
293
|
+
checkOut: "2021-10-11",
|
|
294
|
+
rooms: "2",
|
|
295
|
+
});
|
|
296
|
+
```
|
|
297
|
+
|
|
288
298
|
For full documentation, check [rooms method api](#rooms-method).
|
|
289
299
|
|
|
290
300
|
### Get hotel
|
|
@@ -979,6 +989,7 @@ const result = await sapiClient.freeTextSuggest(
|
|
|
979
989
|
Rooms is a method of **sapiClient** for retrieving rooms information and
|
|
980
990
|
offers for a particular itinerary:
|
|
981
991
|
|
|
992
|
+
V1
|
|
982
993
|
```js
|
|
983
994
|
const rooms = await sapiClient.rooms({
|
|
984
995
|
hotelId: "1714808",
|
|
@@ -988,6 +999,16 @@ const rooms = await sapiClient.rooms({
|
|
|
988
999
|
});
|
|
989
1000
|
```
|
|
990
1001
|
|
|
1002
|
+
V2
|
|
1003
|
+
```js
|
|
1004
|
+
const rooms = await sapiClient.roomsV2({
|
|
1005
|
+
hotelId: "1714808",
|
|
1006
|
+
checkIn: "2021-10-10",
|
|
1007
|
+
checkOut: "2021-10-11",
|
|
1008
|
+
rooms: "2",
|
|
1009
|
+
});
|
|
1010
|
+
```
|
|
1011
|
+
|
|
991
1012
|
### Rooms parameters
|
|
992
1013
|
|
|
993
1014
|
<a id="rooms-parameters"></a>
|
|
@@ -1018,6 +1039,7 @@ const rooms = await sapiClient.rooms({
|
|
|
1018
1039
|
### Response
|
|
1019
1040
|
|
|
1020
1041
|
<a id="rooms-response"></a>
|
|
1042
|
+
V1 Response
|
|
1021
1043
|
|
|
1022
1044
|
```json
|
|
1023
1045
|
{
|
|
@@ -1065,6 +1087,284 @@ const rooms = await sapiClient.rooms({
|
|
|
1065
1087
|
}
|
|
1066
1088
|
```
|
|
1067
1089
|
|
|
1090
|
+
V2 Respnose
|
|
1091
|
+
|
|
1092
|
+
```json
|
|
1093
|
+
{
|
|
1094
|
+
"entities": [
|
|
1095
|
+
{
|
|
1096
|
+
"id": "b57ac4d3-72bf-4f0c-b82f-28e29543c06a",
|
|
1097
|
+
"entityType": "split_booking",
|
|
1098
|
+
"rooms": [
|
|
1099
|
+
{
|
|
1100
|
+
"id": "SHPLitp7oTk",
|
|
1101
|
+
"name": "Room",
|
|
1102
|
+
"raaName": "Room",
|
|
1103
|
+
"amenities": [],
|
|
1104
|
+
"images": [],
|
|
1105
|
+
"description": "",
|
|
1106
|
+
"smokingOptionsAvailable": false,
|
|
1107
|
+
"bedTypes": [],
|
|
1108
|
+
"area": {}
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
"id": "dn4Qijq4auI",
|
|
1112
|
+
"name": "cosy room(City view)",
|
|
1113
|
+
"raaName": "cosy room(City view)",
|
|
1114
|
+
"amenities": [],
|
|
1115
|
+
"images": [],
|
|
1116
|
+
"description": "",
|
|
1117
|
+
"smokingOptionsAvailable": false,
|
|
1118
|
+
"bedTypes": [],
|
|
1119
|
+
"area": {}
|
|
1120
|
+
}
|
|
1121
|
+
],
|
|
1122
|
+
"offers": [
|
|
1123
|
+
{
|
|
1124
|
+
"isClicked": true,
|
|
1125
|
+
"matchType": "by_price",
|
|
1126
|
+
"matchedOfferPriceDiff": 0,
|
|
1127
|
+
"id": "b57ac4d3-72bf-4f0c-b82f-28e29543c06a",
|
|
1128
|
+
"availableRooms": null,
|
|
1129
|
+
"canPayLater": false,
|
|
1130
|
+
"cancellationPenalties": [],
|
|
1131
|
+
"cug": null,
|
|
1132
|
+
"links": [
|
|
1133
|
+
{
|
|
1134
|
+
"href": "https://secure.findhotel.net/checkout/?bundleId=b57ac4d3-72bf-4f0c-b82f-28e29543c06a..",
|
|
1135
|
+
"method": "GET",
|
|
1136
|
+
"type": "checkout"
|
|
1137
|
+
}
|
|
1138
|
+
],
|
|
1139
|
+
"prices": [
|
|
1140
|
+
{
|
|
1141
|
+
"chargeable": {
|
|
1142
|
+
"base": "570.7278477192",
|
|
1143
|
+
"taxes": "46.6959148134"
|
|
1144
|
+
},
|
|
1145
|
+
"currencyCode": "EUR",
|
|
1146
|
+
"hotelFees": {
|
|
1147
|
+
"breakdown": [],
|
|
1148
|
+
"total": "74.1946202035"
|
|
1149
|
+
},
|
|
1150
|
+
"rate": {
|
|
1151
|
+
"base": 570.7278477192,
|
|
1152
|
+
"taxes": 46.6959148134,
|
|
1153
|
+
"hotelFees": 74.1946202035
|
|
1154
|
+
},
|
|
1155
|
+
"type": "chargeable_currency"
|
|
1156
|
+
}
|
|
1157
|
+
],
|
|
1158
|
+
"services": null,
|
|
1159
|
+
"providerCode": "",
|
|
1160
|
+
"tags": [
|
|
1161
|
+
"price_matched",
|
|
1162
|
+
"sb_single_flow"
|
|
1163
|
+
],
|
|
1164
|
+
"metadata": {
|
|
1165
|
+
"feedID": ""
|
|
1166
|
+
},
|
|
1167
|
+
"offerType": "split_booking",
|
|
1168
|
+
"itineraries": [
|
|
1169
|
+
{
|
|
1170
|
+
"checkIn": "2025-03-30",
|
|
1171
|
+
"checkOut": "2025-03-31",
|
|
1172
|
+
"roomID": "SHPLitp7oTk",
|
|
1173
|
+
"offer": {
|
|
1174
|
+
"id": "ojnRYasJ3-Ws",
|
|
1175
|
+
"availableRooms": null,
|
|
1176
|
+
"providerRateType": "public",
|
|
1177
|
+
"canPayLater": false,
|
|
1178
|
+
"cancellationPenalties": [],
|
|
1179
|
+
"cug": [],
|
|
1180
|
+
"links": [
|
|
1181
|
+
{
|
|
1182
|
+
"href": "https://secure.findhotel.net/checkout/?hotelId=1041597...",
|
|
1183
|
+
"method": "GET",
|
|
1184
|
+
"type": "checkout"
|
|
1185
|
+
}
|
|
1186
|
+
],
|
|
1187
|
+
"prices": [
|
|
1188
|
+
{
|
|
1189
|
+
"chargeable": {
|
|
1190
|
+
"base": "119.8596330275",
|
|
1191
|
+
"taxes": "9.8066972477"
|
|
1192
|
+
},
|
|
1193
|
+
"currencyCode": "EUR",
|
|
1194
|
+
"hotelFees": {
|
|
1195
|
+
"breakdown": [],
|
|
1196
|
+
"total": "15.5817522936"
|
|
1197
|
+
},
|
|
1198
|
+
"rate": {
|
|
1199
|
+
"base": 119.8596330275,
|
|
1200
|
+
"taxes": 9.8066972477,
|
|
1201
|
+
"hotelFees": 15.5817522936
|
|
1202
|
+
},
|
|
1203
|
+
"type": "chargeable_currency"
|
|
1204
|
+
}
|
|
1205
|
+
],
|
|
1206
|
+
"services": [],
|
|
1207
|
+
"providerCode": "SMR",
|
|
1208
|
+
"tags": [
|
|
1209
|
+
"preferred_rate",
|
|
1210
|
+
"top_offer",
|
|
1211
|
+
"exclusive_cheapest_offer"
|
|
1212
|
+
],
|
|
1213
|
+
"metadata": {
|
|
1214
|
+
"providerRateType": "public",
|
|
1215
|
+
"feedID": ""
|
|
1216
|
+
},
|
|
1217
|
+
"offerType": "regular",
|
|
1218
|
+
"itineraries": null,
|
|
1219
|
+
"totalRate": {
|
|
1220
|
+
"base": 0,
|
|
1221
|
+
"taxes": 0,
|
|
1222
|
+
"hotelFees": 0
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1227
|
+
"checkIn": "2025-03-31",
|
|
1228
|
+
"checkOut": "2025-04-03",
|
|
1229
|
+
"roomID": "dn4Qijq4auI",
|
|
1230
|
+
"offer": {
|
|
1231
|
+
"id": "o33J8HXa4tJY",
|
|
1232
|
+
"availableRooms": 99,
|
|
1233
|
+
"providerRateType": "plus",
|
|
1234
|
+
"canPayLater": false,
|
|
1235
|
+
"cancellationPenalties": [],
|
|
1236
|
+
"cug": [],
|
|
1237
|
+
"links": [
|
|
1238
|
+
{
|
|
1239
|
+
"href": "https://secure.findhotel.net/checkout/?hotelId=1041597...",
|
|
1240
|
+
"method": "GET",
|
|
1241
|
+
"type": "checkout"
|
|
1242
|
+
}
|
|
1243
|
+
],
|
|
1244
|
+
"prices": [
|
|
1245
|
+
{
|
|
1246
|
+
"chargeable": {
|
|
1247
|
+
"base": "450.8682146917",
|
|
1248
|
+
"taxes": "36.8892175657"
|
|
1249
|
+
},
|
|
1250
|
+
"currencyCode": "EUR",
|
|
1251
|
+
"hotelFees": {
|
|
1252
|
+
"breakdown": [],
|
|
1253
|
+
"total": "58.6128679099"
|
|
1254
|
+
},
|
|
1255
|
+
"rate": {
|
|
1256
|
+
"base": 450.8682146917,
|
|
1257
|
+
"taxes": 36.8892175657,
|
|
1258
|
+
"hotelFees": 58.6128679099
|
|
1259
|
+
},
|
|
1260
|
+
"type": "chargeable_currency"
|
|
1261
|
+
}
|
|
1262
|
+
],
|
|
1263
|
+
"services": [],
|
|
1264
|
+
"providerCode": "DDT",
|
|
1265
|
+
"tags": [
|
|
1266
|
+
"preferred_rate",
|
|
1267
|
+
"top_offer",
|
|
1268
|
+
"exclusive_cheapest_offer"
|
|
1269
|
+
],
|
|
1270
|
+
"metadata": {
|
|
1271
|
+
"providerRateType": "plus",
|
|
1272
|
+
"feedID": ""
|
|
1273
|
+
},
|
|
1274
|
+
"offerType": "regular",
|
|
1275
|
+
"itineraries": null,
|
|
1276
|
+
"totalRate": {
|
|
1277
|
+
"base": 0,
|
|
1278
|
+
"taxes": 0,
|
|
1279
|
+
"hotelFees": 0
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
],
|
|
1284
|
+
"totalRate": {
|
|
1285
|
+
"base": 570.7278477192,
|
|
1286
|
+
"taxes": 46.6959148134,
|
|
1287
|
+
"hotelFees": 74.1946202035
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
],
|
|
1291
|
+
"hasClickedOffer": true
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
"id": "dn4Qijq4auI",
|
|
1295
|
+
"entityType": "room",
|
|
1296
|
+
"rooms": [
|
|
1297
|
+
{
|
|
1298
|
+
"id": "dn4Qijq4auI",
|
|
1299
|
+
"name": "cosy room(City view)",
|
|
1300
|
+
"raaName": "cosy room(City view)",
|
|
1301
|
+
"amenities": [],
|
|
1302
|
+
"images": [],
|
|
1303
|
+
"description": "",
|
|
1304
|
+
"smokingOptionsAvailable": false,
|
|
1305
|
+
"bedTypes": [],
|
|
1306
|
+
"area": {}
|
|
1307
|
+
}
|
|
1308
|
+
],
|
|
1309
|
+
"offers": [
|
|
1310
|
+
{
|
|
1311
|
+
"id": "o-9NZdSFm3Qc",
|
|
1312
|
+
"availableRooms": 99,
|
|
1313
|
+
"providerRateType": "plus",
|
|
1314
|
+
"canPayLater": false,
|
|
1315
|
+
"cancellationPenalties": [],
|
|
1316
|
+
"cug": [],
|
|
1317
|
+
"links": [
|
|
1318
|
+
{
|
|
1319
|
+
"href": "https://secure.findhotel.net/checkout/?hotelId=1041597...",
|
|
1320
|
+
"method": "GET",
|
|
1321
|
+
"type": "checkout"
|
|
1322
|
+
}
|
|
1323
|
+
],
|
|
1324
|
+
"prices": [
|
|
1325
|
+
{
|
|
1326
|
+
"chargeable": {
|
|
1327
|
+
"base": "575.6297833706",
|
|
1328
|
+
"taxes": "47.0969822758"
|
|
1329
|
+
},
|
|
1330
|
+
"currencyCode": "EUR",
|
|
1331
|
+
"hotelFees": {
|
|
1332
|
+
"breakdown": [],
|
|
1333
|
+
"total": "74.8318718382"
|
|
1334
|
+
},
|
|
1335
|
+
"rate": {
|
|
1336
|
+
"base": 575.6297833706,
|
|
1337
|
+
"taxes": 47.0969822758,
|
|
1338
|
+
"hotelFees": 74.8318718382
|
|
1339
|
+
},
|
|
1340
|
+
"type": "chargeable_currency"
|
|
1341
|
+
}
|
|
1342
|
+
],
|
|
1343
|
+
"services": [],
|
|
1344
|
+
"providerCode": "DDT",
|
|
1345
|
+
"tags": [
|
|
1346
|
+
"top_offer",
|
|
1347
|
+
"exclusive_cheapest_offer"
|
|
1348
|
+
],
|
|
1349
|
+
"metadata": {
|
|
1350
|
+
"providerRateType": "plus",
|
|
1351
|
+
"feedID": ""
|
|
1352
|
+
},
|
|
1353
|
+
"offerType": "regular",
|
|
1354
|
+
"itineraries": null,
|
|
1355
|
+
"totalRate": {
|
|
1356
|
+
"base": 0,
|
|
1357
|
+
"taxes": 0,
|
|
1358
|
+
"hotelFees": 0
|
|
1359
|
+
}
|
|
1360
|
+
},
|
|
1361
|
+
],
|
|
1362
|
+
"hasClickedOffer": false
|
|
1363
|
+
}
|
|
1364
|
+
]
|
|
1365
|
+
}
|
|
1366
|
+
```
|
|
1367
|
+
|
|
1068
1368
|
## `hotel()` method
|
|
1069
1369
|
|
|
1070
1370
|
<a id="hotel-method"></a>
|