-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
1125 lines (983 loc) · 36.9 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.2
info:
version: 1.1.0
title: Termino Hotel API
x-logo:
url: './logo.svg'
description: >
This document outlines the API of [Termino](https://www.termino.eu), utilized by Slevomat to enable the sale of online bookings on [Slevomat.cz](https://www.slevomat.cz) and [Zlavomat.sk](https://www.zlavomat.sk).
This API is used for connecting channel management (CM) and property management systems (PMS).
#### Core Functions of the API Include:
- synchronization of hotel structure (room types and rooms) from CM/PMS to Termino or the other way around
- synchronization of available capacities (free rooms) from CM/PMS to Termino
- issuing reservations from Termino to CM/PMS
- bi-directional editing and canceling of reservations created from Termino
**Note:** This API does not cover the synchronization of prices (rate plans), payments, or cancellation policies. These elements are beyond the scope of this API's functionalities.
## 👋 Basics
### API Structure
This API is bi-directional, meaning both sides can request or push information to the other's API. Given that this API covers various system setups, there are multiple ways to establish communication. The synchronization of hotel structure and capacities is typically achieved by CM/PMS pushing information to Termino. A periodic pull of capacity information can also be configured, but push is preferred as it facilitates faster change propagation and reduces traffic between systems.
Typical usage for channel managers includes:
- Implementing the `reservation` and `ping` endpoints on your side
- Calling the `capacities-update` endpoint to push capacity changes
- Using the `get-hotel` endpoint to retrieve the hotel structure and set up the connection
For property management systems, the typical usage involves:
- Implementing the `hotel`, `reservation`, and `get-reservation` endpoints. The `ping` endpoint is not needed because the `hotel` endpoint should provide the same information (whether the hotel is active or not).
- Depending on the pull or push style, implementing the `capacities` on your side or calling the `capacities-update` push endpoint on Termino to deliver updates.
## 🔑 Security and Authentication
All requests are required to communicate over HTTPS. Termino API endpoints support TLS protocol versions 1.2 and higher.
### Authentication
All requests contain the property `accessToken` with a value assigned during the API verification process. These values identify the communicating parties - CM/PMS on one side and Termino on the other.
## 📡 Request and Response Format
Both sides accept only `HTTP POST`. Requests and responses are sent with the `Content-Type` header set to `application/json` and a JSON body depending on the operation to be performed. Content encoding is always `UTF-8`.
If a message is received and processed, the HTTP response code should be `200 OK` for successful results and any `4xx` for unsuccessful results (the concrete error type is described in the response body).
`5xx` response codes indicate unexpected and internal errors, and the request can be retried without change. No specific response should be expected for server errors (JSON is not guaranteed). The response header `Retry-After` (if present) should be respected for retrying the request.
The type of message is determined by the URL.
For push endpoints, the request should be repeated until it is successfully delivered to Termino. Similarly, Termino will repeat requests until they are accepted by your system. Successful delivery means either responding with success or an expected error described in the API specification.
### Identifiers
- All identifiers (parameters named id) have to be unique for a given hotel, unless explicitly stated otherwise.
- All identifiers generated on the Termino side are UUIDs.
- All identifiers from your side can be either integers or strings.
### Reservation ID
Each reservation has to have a unique ID for reference between systems. This identifier is later used in case of modification and cancellation of the reservation is needed. Termino can either generate and send our identifier with reservation creation, or it can accept and later use the reservation ID returned in response.
Using the ID from Termino is preferred because it allows us to reference the reservation even in case this create request fails with a timeout or other unexpected error. When using your ID, another system or manual intervention is needed in this case.
### Basic request
```json
{
"accessToken": "foobar",
// other properties
}
```
### Basic success response
```json
{
"success": true,
}
```
### Basic error response
```json
{
"error": {
"code": "invalid-access-token",
"message": "Access token not found."
}
}
```
### Common error codes
These errors can occur on any API endpoint.
| Code | Description |
|------------------------|------------------------------------------------------------------------------------- |
| `invalid-format` | Unparsable JSON |
| `missing-value` | A required property is missing. |
| `invalid-value` | A property has invalid format (e.g., wrong date, time, datetime, interval, URL...). |
| `invalid-access-token` | Invalid or expired access token |
## 🆕 Changelog
Changes to API and its documentation
### 2023
#### 2. 11. 2023
- Added children ages and bed entitlement to reservation data (`reservation.children`)
- Added meal plan to reservation data (`reservation.meal`)
- Added e-mail address to reservation data (`reservation.contact.email`)
- Deprecate `occupations` and `occupations-update` endpoints to be used for blockages. Use capacities instead.
- Deprecate `rooms` parameter from RoomType structure. Only `roomCount` parameter is now needed to define room type structure
- Deprecate `roomId` parameter from Occupation and Reservation structure. Only `roomTypeId` parameter is now needed to define occupation
### 2021
#### 24. 11. 2021
- Deprecate checkIn, checkOut and url parameters from hotel structure
### 2020
#### 9. 1. 2020
- Initial release
tags:
- name: Termino endpoints
description: >
Endpoints on Termino side are called from PMS/CM system and mostly used to push data changes.
**If unsuccessful response is returned, the request has to be repeated until it is successfully delivered to Termino.**
- name: PMS/CM endpoints
description: Partner endpoints should be implemented in your PMS/CM system and are called by Termino, either periodically or when specific action is performed (eg. new reservation, hotel connection).
servers:
- url: 'https://www.termino.eu/api/hotel/v1'
- url: 'https://example.com/your-api-address'
paths:
/hotel:
servers:
- url: 'https://example.com/your-api-address'
post:
operationId: "hotel"
tags:
- PMS/CM endpoints
summary: "Hotel info and Room Types"
description: >
Information about hotel for registration process and structure of room type and rooms.
Usage:
- loading hotel info and structure when registering a new hotel
- synchronizing hotel structure - infrequent polling and request when wrong synchronization is detected (unknown room etc.)
requestBody:
content:
application/json:
schema:
type: object
properties:
accessToken:
type: string
description: "Access token for authorization"
example: "aa5ae844-051c-4d30-9c67-54b70c99b580"
hotelId:
oneOf:
- type: string
- type: integer
description: "Your hotel id"
example: "123456"
required:
- accessToken
- hotelId
responses:
200:
description: "OK"
content:
application/json:
schema:
$ref: "#/components/schemas/HotelInfo"
400:
description: "Expected error"
content:
application/json:
schema:
$ref: "#/components/schemas/HotelNotFoundError"
/capacities:
servers:
- url: 'https://example.com/your-api-address'
post:
operationId: "capacities"
tags:
- PMS/CM endpoints
summary: "Capacities"
description: >
Synchronizing available space.
Usage:
- called when new hotel is registered
- called after a new reservation is created or reservation fails
- periodical synchronization of available space unless push endpoint is used
requestBody:
required: true
content:
application/json:
schema:
type: "object"
required:
- "accessToken"
- "hotelId"
- "interval"
properties:
accessToken:
type: "string"
description: "Access token to your API."
hotelId:
oneOf:
- type: "string"
- type: "integer"
description: "Hotel id."
interval:
$ref: "#/components/schemas/DateInterval"
roomTypeIds:
type: "array"
items:
oneOf:
- type: "string"
- type: "integer"
description: "Requested room type ids. When not provided, return capacities for all room types of given hotel."
responses:
200:
description: "Successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessCapacitiesResponse"
400:
description: "Expected error"
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/HotelNotFoundError"
- $ref: "#/components/schemas/RoomTypeNotFoundError"
/reservation:
servers:
- url: 'https://example.com/your-api-address'
post:
operationId: "reservation"
tags:
- "PMS/CM endpoints"
summary: "Create/update reservation"
description: >
Creating new reservations, updating reservations, canceling reservations.
Behavior of this endpoint heavily depends on the agreed scheme of communication:
### 1 - Reservation Statuses:
The default scheme is "dual requests" - the first request contains `status: option` and does not contain customer data. The second request contains `status: confirmed` and includes customer data. This scheme allows more gradual control of the state of the reservation. **Both statuses are expected to block the room for the reservation.**
The second option is "single request" - in this scheme, even the first request with `status: option` contains all customer data and the voucher code. The confirmation request is sent also with the same data but does not have to be relayed to the hotel. Single-request mode is more suited for systems which do not support modifying existing reservations without canceling them and creating a new one (OTA-like behavior). You should specify which behavior better suits your system capabilities when consulting the integration with Termino.
### 2 - Reservation ID:
For referencing reservations between Termino and your system, either your ID or our ID can be used. In case your ID is used, the first (`option`) request does not contain the property `id`. You have to generate and send it in response.
In case our ID is used, the first (`option`) request contains the property `id` with our ID. You have to store it and use it in all subsequent requests.
Using your ID can be problematic in case communication during the first request fails due to any unexpected error (timeout, outage, etc.). This may cause a reservation being created in your system, but not in Termino. That's why we prefer using our ID, which we can use to check and remove such un-synced reservation.
**Termino expects the room to be blocked for reservation when the `option` request is successfully processed.**
### Usage:
- Called with status `option` and then `confirmed` when creating a new reservation (see above)
- Called with `canceled` status to cancel the reservation
- Called when changing booking date on customer's request
Grouped reservations are currently not implemented; one request always contains only one reservation. Reservation group ID is the same as reservation ID.
Reservation response should contain the same data as the request.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ReservationRequest"
example:
accessToken: "11-11-11-11"
hotelId: 123456
reservationGroup:
id: 123456
description: "New Year's Eve 2019"
totalPrice:
amount: 1000
currency: "CZK"
reservations:
- id: 123456
status: "option"
roomTypeId: 123
term:
start: "2019-01-01"
end: "2019-01-02"
price:
amount: 1000
currency: "CZK"
adultsCount: 2
children:
- age: 5
bedEntitlement: true
guestNote: "I would like to have a room with a view."
voucher: "1234567890"
contact:
name: "John Doe"
phone: "+420123456789"
responses:
200:
description: "Successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/ReservationResponse"
400:
description: "Expected error"
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/HotelNotFoundError"
- $ref: "#/components/schemas/RoomTypeNotFoundError"
- $ref: "#/components/schemas/InsufficientCapacityError"
- $ref: "#/components/schemas/ReservationNotFoundError"
/get-reservation:
servers:
- url: 'https://example.com/your-api-address'
post:
tags:
- "PMS/CM endpoints"
summary: "Reservation query"
operationId: "getReservation"
description: >
Request for current state of the reservation
Usage:
- queried by Termino when a reservation disappears from synchronized interval (moved to another room, term, room deleted etc.) without being updated first (failsafe).
requestBody:
required: true
content:
application/json:
schema:
type: "object"
required:
- "accessToken"
- "hotelId"
- "reservationId"
properties:
accessToken:
type: "string"
description: "Access token to your API."
hotelId:
oneOf:
- type: "string"
- type: "integer"
description: "Hotel id."
reservationId:
oneOf:
- type: "string"
- type: "integer"
description: "Reservation id."
responses:
200:
description: "Successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/Reservation"
400:
description: "Expected error"
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/HotelNotFoundError"
- $ref: "#/components/schemas/ReservationNotFoundError"
/occupations:
servers:
- url: 'https://example.com/your-api-address'
post:
operationId: "occupations"
tags:
- PMS/CM endpoints
summary: "Reservations search"
description: >
**This endpoint was previously used as alternative to `/capacities`. This usage is deprecated. Use capacities instead.**
Synchronization of changes in reservations created by Termino/Slevomat. This allows changes in reservation made in PMS to be propagated to Termino and Slevomat. Changes can also be pushed via [/occupations-update](#tag/Termino-endpoints/operation/occupations-update) endpoint.
Usage:
- synchronizing occupation changes once a day
requestBody:
required: true
content:
application/json:
schema:
type: "object"
required:
- "accessToken"
- "hotelId"
- "interval"
properties:
accessToken:
type: "string"
description: "Access token to your API."
hotelId:
oneOf:
- type: "string"
- type: "integer"
description: "Your hotel id."
interval:
$ref: "#/components/schemas/DateInterval"
roomTypeIds:
type: "array"
items:
oneOf:
- type: "string"
- type: "integer"
description: "Filter occupations on given room types."
responses:
200:
description: "Successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/OccupationsResponse"
400:
description: "Expected error"
content:
application/json:
schema:
$ref: "#/components/schemas/HotelNotFoundError"
/ping:
servers:
- url: 'https://example.com/your-api-address'
post:
tags:
- "PMS/CM endpoints"
summary: "Ping"
operationId: "ping"
description: >
Ping endpoint is used to check if hotel exists and synchronization is active on your side.
If you implement [/hotel](#tag/PMSCM-endpoints/operation/hotel) endpoint, you can ignore this endpoint.
Usage:
- called periodically to check if hotels are still active
requestBody:
required: true
content:
application/json:
schema:
type: "object"
required:
- "accessToken"
- "hotelId"
properties:
accessToken:
type: "string"
description: "Access token to your API."
hotelId:
oneOf:
- type: "string"
- type: "integer"
description: "Hotel id."
responses:
200:
description: "Successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponse"
400:
description: "Expected error"
content:
application/json:
schema:
$ref: "#/components/schemas/HotelNotFoundError"
/occupations-update:
servers:
- url: 'https://www.termino.eu/api/hotel/v1'
post:
operationId: "occupations-update"
tags:
- Termino endpoints
summary: "Occupations (push)"
description: >
Synchronization of changed reservations on the hotel side.
**It is deprecated to send updates for other reservations then those created by Termino/Slevomat.**
Usage:
- Partner changes Slevomat reservation in their system and this endpoint is called to update the reservation in Termino/Slevomat
- **Deprecated** Pushing blockage and reservation updates when using pull endpoint [/occupations](#tag/PMSCM-endpoints/operation/occupations)
Updates of occupations in multiple hotels has to be sent in multiple requests.
requestBody:
required: true
content:
application/json:
schema:
type: "object"
required:
- "accessToken"
- "hotelId"
- "occupations"
properties:
accessToken:
type: "string"
description: "Access token to your API."
hotelId:
oneOf:
- type: "string"
- type: "integer"
description: "Hotel id."
occupations:
type: "array"
items:
$ref: "#/components/schemas/Occupation"
description: "List of updated occupations."
responses:
200:
description: "Successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponse"
400:
description: "Expected error"
content:
application/json:
schema:
$ref: "#/components/schemas/HotelNotFoundError"
/capacities-update:
servers:
- url: 'https://www.termino.eu/api/hotel/v1'
post:
operationId: "capacities-update"
tags:
- Termino endpoints
summary: "Capacities (push)"
description: >
Synchronization of changed capacities
Usage:
- CM / PMS pushes capacity changes to Termino
requestBody:
required: true
content:
application/json:
schema:
type: "object"
required:
- "accessToken"
- "hotelId"
- "capacities"
properties:
accessToken:
type: "string"
description: "Access token to your API."
hotelId:
oneOf:
- type: "string"
- type: "integer"
description: "Your hotel id."
capacities:
type: "array"
items:
$ref: "#/components/schemas/Capacity"
description: "List of updated capacities."
responses:
200:
description: "Successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponse"
400:
description: "Expected error"
content:
application/json:
schema:
"#/components/schemas/HotelNotFoundError"
/hotel-update:
servers:
- url: 'https://www.termino.eu/api/hotel/v1'
post:
operationId: "hotel-update"
tags:
- Termino endpoints
summary: "Hotel update (push)"
description: >
Synchronization of changed hotel info and structure.
Usage:
- CM / PMS pushes hotel info and structure changes to Termino
requestBody:
required: true
content:
application/json:
schema:
type: "object"
required:
- "accessToken"
- "hotelId"
- "hotel"
properties:
accessToken:
type: "string"
description: "Access token to your API."
hotel:
$ref: "#/components/schemas/Hotel"
description: "Updated hotel info."
roomTypes:
type: "array"
items:
$ref: "#/components/schemas/RoomType"
description: "Updated room types."
responses:
200:
description: "Successful response"
content:
application/json:
schema:
$ref: "#/components/schemas/SuccessResponse"
400:
description: "Expected error"
content:
application/json:
schema:
$ref: "#/components/schemas/HotelNotFoundError"
/get-hotel:
servers:
- url: 'https://www.termino.eu/api/hotel/v1'
post:
operationId: 'hotel-info'
tags:
- Termino endpoints
summary: 'Hotel info (reversed)'
description: >
Provides same information as [/hotel](#tag/PMSCM-endpoints/operation/hotel) endpoint, but in reversed direction. This endpoint is called by CM to load room types created on Termino side and set up mapping.
requestBody:
required: true
content:
application/json:
schema:
type: "object"
required:
- "accessToken"
- "hotelId"
properties:
accessToken:
type: "string"
description: "Access token to your API."
hotelId:
oneOf:
- type: "string"
- type: "integer"
description: "Hotel id."
responses:
200:
description: "Successful response"
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/HotelInfo"
400:
description: "Expected error"
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/HotelNotFoundError"
components:
schemas:
ErrorResponse:
type: object
required:
- "code"
- "message"
properties:
code:
type: "string"
message:
type: "string"
HotelNotFoundError:
allOf:
- $ref: "#/components/schemas/ErrorResponse"
- type: "object"
properties:
code:
enum: ["hotel-not-found"]
description: "Non-existing id or not authorized to this hotel"
RoomTypeNotFoundError:
allOf:
- $ref: "#/components/schemas/ErrorResponse"
- type: "object"
properties:
code:
enum: [ "room-type-not-found" ]
description: "Non-existing room type id"
ReservationNotFoundError:
allOf:
- $ref: "#/components/schemas/ErrorResponse"
- type: "object"
properties:
code:
enum: [ "reservation-not-found" ]
description: "Reservation group or reservation does not exist"
InsufficientCapacityError:
allOf:
- $ref: "#/components/schemas/ErrorResponse"
- type: "object"
properties:
code:
enum: [ "insufficient-capacities" ]
description: "Cannot create reservation due to reserved or blocked rooms (when creating or moving reservation)"
Hotel:
type: "object"
properties:
id:
type: "string"
description: "Your id of the hotel"
example: "123456"
name:
type: "string"
description: "Name of the hotel"
example: "Hotel Example"
address:
$ref: "#/components/schemas/Address"
HotelInfo:
type: object
properties:
hotel:
$ref: "#/components/schemas/Hotel"
roomTypes:
type: "array"
items:
$ref: "#/components/schemas/RoomType"
Address:
type: "object"
properties:
street:
type: "string"
description: "Street name and number"
example: "Pernerova 691"
city:
type: "string"
description: "City / quarter"
example: "Praha 8"
country:
type: "string"
pattern: "^[A-Z]{2}$"
description: "2-letter country code by ISO-3166-1"
example: "CZ"
RoomType:
type: "object"
properties:
id:
type: "string"
description: "Your room type id"
example: "123456"
name:
type: "string"
description: "Room type name"
example: "Double room"
beds:
type: "integer"
description: "Count of beds"
example: 2
extraBeds:
type: "integer"
description: "Count of extra beds"
example: 1
roomsCount:
type: "integer"
description: "Count of rooms of given type"
example: 10
rooms:
type: "array"
deprecated: true
items:
type: "object"
properties:
id:
type: "string"
description: "Your room id"
example: "125"
name:
type: "string"
description: "Name of the room"
example: "Room 125"
DateInterval:
type: "object"
required:
- "start"
- "end"
properties:
start:
type: "string"
format: "date"
description: "Start date in the format 'yyyy-mm-dd'."
end:
type: "string"
format: "date"
description: "End date in the format 'yyyy-mm-dd'."
OccupationsResponse:
type: "object"
required:
- "occupations"
properties:
occupations:
type: "array"
items:
$ref: "#/components/schemas/Occupation"
description: "List of matched occupations. Empty array if none found"
Occupation:
type: "object"
required:
- "id"
- "type"
- "created"
- "term"
- "roomTypeId"
properties:
id:
oneOf:
- type: "string"
- type: "integer"
description: "Your occupation id."
type:
type: "string"
enum: ["reservation"]
description: "Type of occupation. `reservation` is only supported value, `blockage` is deprecated and ignored."
status:
type: "string"
description: "Reservation status; optional and ignored for blockages."
roomId:
oneOf:
- type: "string"
- type: "integer"
description: "Your room id."
deprecated: true
roomTypeId:
oneOf:
- type: "string"
- type: "integer"
description: "Room type id."
created:
type: "string"
format: "date-time"
description: "Creation date and time in ISO 8601 format."
term:
$ref: "#/components/schemas/DateInterval"
Price:
type: "object"
required:
- "amount"
- "currency"
properties:
amount:
type: "string"
format: "decimal"
description: "Money amount in basic units."
currency:
type: "string"
format: "ISO 4271 currency code"
description: "Currency code."
ReservationResponse:
type: "object"
properties:
hotelId:
oneOf:
- type: "string"
- type: "integer"
accessToken:
type: "string"
reservationGroup:
$ref: "#/components/schemas/ReservationGroup"
Reservation:
type: "object"
required:
- "id"
- "status"
- "roomTypeId"
- "term"
- "price"
- "adultsCount"
properties:
id:
oneOf:
- type: "string"
- type: "integer"
description: "Id of reservation."
status:
enum: ["option", "confirmed", "canceled", "modified"]
type: "string"
description: "Reservation status."
roomTypeId:
oneOf:
- type: "string"
- type: "integer"
description: "Id of room type."
roomId:
oneOf:
- type: "string"
- type: "integer"
description: "Id of room."
deprecated: true
term:
$ref: "#/components/schemas/DateInterval"
price:
$ref: "#/components/schemas/Price"
meal:
type: "string"
enum: ["none", "breakfast", "half_board", "full_board", "all_inclusive"]
description: "Meal type included in package."
adultsCount:
type: "integer"
description: "Count of adults."