Booking
POST
/api/v1/generic-api-service/royal/book
The booking endpoint is used to complete the reservation.
- cURL
- Request
- Response
- Request Details
- Response Details
curl --location 'https://test-api.etscore.com/api/v1/generic-api-service/royal/book' \
--header 'Accept-Language: en-us' \
--header 'X-Currency: TRY' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"contact": {
"name": "Test",
"surname": "Surname",
"phoneCountryCode": "+90",
"phoneNumber": "5555555555",
"email": "[email protected]"
},
"roomSearchId": "d2fa4b5c-6c93-4f47-93a6-9222ea2df77e",
"checkIn": "2025-04-09",
"checkOut": "2025-04-11",
"hotelCode": "sxk9jv7y87jw35",
"payment": {
"paymentType": "CASH_EUR",
"price": "222.13",
"currency": "EUR"
},
"guests": [
{
"name": "TestName",
"surname": "TestSurname",
"birthDate": "1990-02-09",
"email": "[email protected]",
"nationality": "DE",
"phoneNumber": "5555555555",
"phoneCountryCode": "+90",
"gender": "MALE",
"type": "ADULT"
},
{
"name": "TestName",
"surname": "TestSurname",
"birthDate": "1990-02-09",
"email": "[email protected]",
"nationality": "DE",
"phoneNumber": "5072215798",
"phoneCountryCode": "+90",
"gender": "FEMALE",
"type": "ADULT"
},
{
"name": "TestName",
"surname": "TestSurname",
"birthDate": "2022-02-09",
"email": "[email protected]",
"nationality": "DE",
"phoneNumber": "5555555555",
"phoneCountryCode": "+90",
"gender": "FEMALE",
"type": "CHILD"
}
],
"priceCode": "500017|sxk9jv7y87jw35|20|2025-04-09|2025-04-11|3|Sales|3923471yxvqa08xw6092h0dwjvmjrtwb6|2sc8facr6qw2v0o9g51yok6xjr6umzq6",
"clientReferenceId": "Etscore158259112",
"additionalInfo": "Üst katlarda oda ricadır",
"userNotes": {
"nearElevator": true,
"noSmokeRoom": true,
"nearGeneralArea": true,
"upstairsRoom": true,
"downstairsRoom": true,
"babyBedRoom": false,
"doubleBedRoom": false,
"singleBedRoom": false,
"disabledFriendRoom": false,
"honeyMoonCouple": true
}
}'
{
"contact": {
"name": "Test",
"surname": "Surname",
"phoneCountryCode": "+90",
"phoneNumber": "5555555555",
"email": "[email protected]"
},
"roomSearchId": "d2fa4b5c-6c93-4f47-93a6-9222ea2df77e",
"checkIn": "2025-04-09",
"checkOut": "2025-04-11",
"hotelCode": "sxk9jv7y87jw35",
"payment": {
"paymentType": "CASH_EUR",
"price": "222.13",
"currency": "EUR"
},
"guests": [
{
"name": "TestName",
"surname": "TestSurname",
"birthDate": "1990-02-09",
"email": "[email protected]",
"nationality": "DE",
"phoneNumber": "5555555555",
"phoneCountryCode": "+90",
"gender": "MALE",
"type": "ADULT"
},
{
"name": "TestName",
"surname": "TestSurname",
"birthDate": "1990-02-09",
"email": "[email protected]",
"nationality": "DE",
"phoneNumber": "5072215798",
"phoneCountryCode": "+90",
"gender": "FEMALE",
"type": "ADULT"
},
{
"name": "TestName",
"surname": "TestSurname",
"birthDate": "2022-02-09",
"email": "[email protected]",
"nationality": "DE",
"phoneNumber": "5555555555",
"phoneCountryCode": "+90",
"gender": "FEMALE",
"type": "CHILD"
}
],
"priceCode": "500017|sxk9jv7y87jw35|20|2025-04-09|2025-04-11|3|Sales|3923471yxvqa08xw6092h0dwjvmjrtwb6|2sc8facr6qw2v0o9g51yok6xjr6umzq6",
"clientReferenceId": "Etscore158259112",
"additionalInfo": "Üst katlarda oda ricadır",
"userNotes": {
"nearElevator": true,
"noSmokeRoom": true,
"nearGeneralArea": true,
"upstairsRoom": true,
"downstairsRoom": true,
"babyBedRoom": false,
"doubleBedRoom": false,
"singleBedRoom": false,
"disabledFriendRoom": false,
"honeyMoonCouple": true
}
}
{
"success": true,
"bookingNumber": "114320535",
"voucher": "ETSR2014683530",
"createdAt": "2025-03-13T14:29:17.574865",
"checkin": "2025-04-09",
"checkout": "2025-04-11",
"hotelCode": "sxk9jv7y87jw35",
"destinationCodes": [],
"salesTime": "2025-03-13T14:29:18",
"price": "222.13",
"agencyCommission": "0.00",
"currency": "EUR",
"isRefundable": true,
"cancellationPolicies": [
{
"amount": 0,
"currency": "EUR",
"toDate": "2025-04-09T16:00:00",
"fromDate": "2025-03-13T14:33:43.832628"
},
{
"amount": 222.13,
"currency": "EUR",
"toDate": "2025-04-09T16:00:00",
"fromDate": "2025-04-09T16:00:00"
}
],
"room": [
{
"pax": {
"adult": 2,
"child": 1,
"childAges": [
3
]
},
"roomCode": "4216",
"roomName": "Twin, City View, ",
"mealType": "BB",
"nightlyPrices": [
{
"date": "2025-04-09",
"amount": 111.07,
"currency": "EUR"
},
{
"date": "2025-04-10",
"amount": 111.07,
"currency": "EUR"
}
],
"confirmationCode": "ETSR2014683530230886",
"rateId": "230886"
}
],
"taxes": [],
"fees": [],
"additionalInfo": "Üst katlarda oda ricadır",
"guests": [
{
"name": "TestName",
"surname": "TestSurname",
"birthDate": "1990-02-09",
"email": "[email protected]",
"nationality": "DE",
"phoneNumber": "5555555555",
"phoneCountryCode": "+90",
"gender": "MALE",
"type": "ADULT",
"guidId": "c198b57d-dc6f-4a66-a380-cd9a72a176a1"
},
{
"name": "TestName",
"surname": "TestSurname",
"birthDate": "1990-02-09",
"email": "[email protected]",
"nationality": "DE",
"phoneNumber": "5072215798",
"phoneCountryCode": "+90",
"gender": "FEMALE",
"type": "ADULT",
"guidId": "bdd12da3-882d-4be7-b8ff-ac6ea74d7ed4"
},
{
"name": "TestName",
"surname": "TestSurname",
"birthDate": "2022-02-09",
"email": "[email protected]",
"nationality": "DE",
"phoneNumber": "5555555555",
"phoneCountryCode": "+90",
"gender": "FEMALE",
"type": "CHILD",
"guidId": "2813c3e9-1110-4315-8bb3-6756138c434d"
}
],
"contact": {
"name": "Test",
"surname": "Surname",
"phoneNumber": "5555555555",
"phoneCountryCode": "+90",
"email": "[email protected]"
},
"clientReferenceId": "Etscore158259112",
"hotelConfirmationNumber": "ETSR2014683530",
"activities": []
}
Name | Type | Required | Description |
---|---|---|---|
contact | object-array | Yes | The information of the reservation's contact person must be sent in this object. |
contact/name | string | Yes | Name of the reservation's contact person must be in this field. |
contact/surname | string | Yes | Surname of the reservation's contact person must be in this field. |
contact/phoneCountryCode | string | Yes | Phone code number of the reservation's contact person, which is in the list of International phone codes must be in this field. |
contact/phoneNumber | string | Yes | Phone number of the reservation's contact person must be in this field. |
contact/email | string | Yes | Email of the reservation's contact person must be in this field. |
roomSearchId | string | Yes | The parameter that will allow us to get which room the user has chosen from the cache when user wants to complete the reservation. |
checkIn | string | Yes | 'checkIn' parameter refers to the day of check-in to the hotel. It should be sent in the format 'YYYY-MM-DD'. |
checkOut | string | Yes | 'checkout' parameter refers to the day of departure from the hotel. It should be sent in YYYY-MM-DD format. The date to be sent in the checkout parameter must be after the date to be sent in the checkin parameter. |
hotelCode | string | Yes | Code of the hotel that guest(s) will accommodate for the reservation. |
payment | object-array | Yes | Payment information must be in payment object. |
payment/paymentType | object-array | Yes | Payment type in Etstur structure |
payment/price | string | Yes | Payment price |
payment/currency | string | Yes | Payment currency. It must be sent in ISO 4217 format. |
guests | object-array | Yes | This object must provide information about the guests staying in the reservation. |
guests/name | string | Yes | Guest's name |
guests/surname | string | Yes | Guest's surname |
guests/birthDate | string | Yes | Guest's birthDate. It should be sent in the format 'YYYY-MM-DD'. |
guests/email | string | Yes | Guest's email address |
guests/nationality | string | Yes | The country of the guest who will be included in the reservation. It must be sent as a 2-digit country code. |
guests/phoneNumber | string | Yes | Guest's phone number |
guests/phoneCountryCode | string | Yes | Phone code number of the guest, which is in the list of International phone codes must be in this field. |
guests/gender | string | Yes | Guest's gender |
guests/type | string | Yes | Information whether the guest is an adult or a child |
priceCode | string | Yes | Unique value generated for that price in each room search. The validity period of the price code is 30 minutes. |
additionalInfo | string | No | If there is an additional information to be sent to the hotel during the completion of reservation, it must be sent in this field. |
clientReferenceId | string | No | The internal booking reference must be unique and contain between 1 and 20 characters. |
Name | Type | Required | Description |
---|---|---|---|
success | bool | Yes | Information about whether the reservation is completed successfully. It will return True if the reservation is completed, and False when an error is received. |
bookingNumber | string | Yes | Booking number that will be created in our system when the reservation is completed successfully |
voucher | string | Yes | Voucher number that will be created in our system when the reservation is completed successfully |
createdAt | string | Yes | This is the time when the reservation is complete.. It should be sent in the format 'YYYY-MM-DD hh:mm:ss tt' |
checkIn | string | Yes | 'checkIn' parameter refers to the day of check-in to the hotel. It should be sent in the format 'YYYY-MM-DD'. |
checkOut | string | Yes | 'checkout' parameter refers to the day of departure from the hotel. It should be sent in YYYY-MM-DD format. The date to be sent in the checkout parameter must be after the date to be sent in the checkin parameter. |
hotelCode | string | Yes | It is the code of the hotel that the reservation is made. |
destinations | object-array | Yes | The destinations where the hotel is located are placed in the 'destinationCode' object. |
destinations/id | int | Yes | Destination id in Etstur structure. |
destinations/type | string | Yes | Destination type in Etstur structure. |
destinations/typeId | int | Yes | Destination typeId in Etstur structure. |
destinations/name | string | Yes | Destination name in Etstur structure. |
salesTime | string | Yes | The time that the sale is completed. It should be sent in the format 'YYYY-MM-DD hh:mm:ss tt' |
price | decimal | Yes | Total price of the reservation. |
agencyCommission | decimal | Yes | The commission of the reservation. |
currency | string | Yes | Currency in which the reservation price will be displayed. It must be sent in ISO 4217 format. |
isRefundable | boolean | Yes | Information about whether the reservation is cancelled. Refundable if it is True, nonrefundable if it is False. |
cancellationPolicies | object-array | No | Object to return information for cancellation policies. |
cancellationPolicies/amount | decimal | No | Penalty amount to be paid |
cancellationPolicies/currency | string | No | Penalty amount currency to be paid |
cancellationPolicies/toDate | string | No | Cancellation policy is valid for UTC+03:00 time zone. |
cancellationPolicies/fromDate | string | No | Cancellation policy is valid for UTC+03:00 time zone. |
room | object-array | Yes | It is the information of the room that was reserved. Currently, only 1 room can be reserved per 1 reservation. When the multi-room feature is provided, it will be seen in the document. |
room/pax | object-array | Yes | The number of people about the reserved room should be included in this object. |
room/pax/adult | int | Yes | The number of adults that will be accommodated. |
room/pax/child | int | No | The number of children that will be accommodated. |
room/pax/childAges | int-array | No | If there are children in the reservation, ages of the children must be in this parameter |
room/roomCode | string | Yes | Room code in Etstur structure. |
room/roomName | string | Yes | Room name in Etstur structure. |
room/mealType | string | Yes | Meal type in Etstur structure. |
room/description | string | No | Room description in Etstur structure. |
room/confirmationCode | string | Yes | Parameter to use when canceling a Refundable reservation. |
room/nightlyPrices | object-array | Yes | An object that allows the room's nightly prices to be displayed separately. and Price must be big decimal type. |
room/nightlyPrices/date | string | Yes | Date of the day, date format must be YYYY-MM-DD |
room/nightlyPrices/amount | decimal | Yes | Price amount of the day |
room/nightlyPrices/currency | string | Yes | Information in which currency the reservation amount is in is returned with the 'currency' parameter. |
room/roomType | string | Yes | Room type in Etstur structure. |
room/taxes | object-array | No | If there is a tax related to accommodation, it will be included in this field. |
room/taxes/type | string | No | Tax type |
room/taxes/price | decimal | No | Tax amount |
room/taxes/currency | string | No | Tax currency |
room/taxes/description | string | No | Tax description |
room/taxes/included | boolean | No | Information whether the tax price is included in the total amount. Included if it is True and not included if it is False. |
room/fees | object-array | No | If there is an extra fee related to accommodation, it will be included in this field. |
room/fees/type | string | No | Fee type |
room/fees/price | decimal | No | Fee amount |
room/fees/currency | string | No | Fee currency |
room/fees/description | string | No | Fee description |
room/fees/included | boolean | No | Information whether the extra fee is included in the total amount. Included if it is True and not included if it is False. |
guests | object-array | Yes | This object must provide information about the guests staying in the reservation. |
guests/name | string | Yes | Guest's name |
guests/surname | string | Yes | Guest's surname |
guests/birthDate | string | Yes | Guest's birthDate. It should be sent in the format 'YYYY-MM-DD'. |
guests/email | string | Yes | Guest's email address |
guests/nationality | string | Yes | The country of the guest who will be included in the reservation. It must be sent as a 2-digit country code. |
guests/phoneNumber | string | Yes | Guest's phone number |
guests/phoneCountryCode | string | Yes | Phone code number of the guest, which is in the list of International phone codes must be in this field. |
guests/gender | string | Yes | Guest's gender |
guests/type | string | Yes | Information whether the guest is an adult or a child |
guests/guidId | string | Yes | Unique id that will be generated by us for each guest |
contact | object-array | Yes | The information of the reservation's contact person must be sent in this object. |
contact/name | string | Yes | Name of the reservation's contact person must be in this field. |
contact/surname | string | Yes | Surname of the reservation's contact person must be in this field. |
contact/phoneCountryCode | string | Yes | Phone code number of the reservation's contact person, which is in the list of International phone codes must be in this field. |
contact/phoneNumber | string | Yes | Phone number of the reservation's contact person must be in this field. |
contact/email | string | Yes | Email of the reservation's contact person must be in this field. |
clientReferenceId | string | No | The internal booking reference must be unique and contain between 1 and 20 characters. |