Cancel
POST
/api/v1/generic-api-service/royal/hotel/book/cancel
The cancel endpoint allows the reservation to be cancelled.
- cURL
- Request
- Response
- Request Details
- Response Details
- Errors
curl --location 'https://test-api.etscore.com/api/v1/generic-api-service/royal/hotel/book/cancel' \
--header 'Accept-Language: en-us' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"reservationId": "ETSR2014683530",
"roomConfirmationCodes": [
"ETSR2014683530230886"
]
}'
{
"reservationId": "ETSR2014683530",
"roomConfirmationCodes": [
0: "ETSR2014683530230886"
]
}
{
"cancelInfos": [
0: {
"price": 222.13,
"refundPrice": 222.13,
"penaltyAmount": 0,
"currency": "EUR",
"roomCode": "230886",
"success": true
}
],
"cancellationPolicies": [
0: {
"amount": 0,
"currency": "EUR",
"toDate": "2025-04-09T16:00:00",
"fromDate": "2025-03-13T14:33:43.832628"
},
1: {
"amount": 222.13,
"currency": "EUR",
"toDate": "2025-04-09T16:00:00",
"fromDate": "2025-04-09T16:00:00"
}
],
"cancelId": "ETSR2014683530",
"status": "CANCELLED"
}
| Name | Type | Required | Description |
|---|---|---|---|
| reservationId | string | Yes | Id of the canceled reservation. |
| roomConfirmationCodes | string-array | Yes | Room codes for the canceled reservation |
| reason | string | No | Cancel reason |
| Name | Type | Required | Description |
|---|---|---|---|
| cancelInfos | object-array | Yes | Object containing the information about the cancellation of the reservation. |
| cancelInfos/price | decimal | Yes | Reservation price |
| cancelInfos/refundPrice | decimal | Yes | Price to be refunded after cancellation. |
| cancelInfos/currency | string | Yes | Currency in which the reservation is completed. |
| cancelInfos/roomCode | string | Yes | room information code |
| cancelInfos/success | bool | Yes | Cancellation status |
| cancellationPolicies | string | Yes | 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. |
| cancelRateInfo | Object-array | Yes | Information about the currency rate to be considered during reservation cancellation. |
| cancelRateInfo/fromCurrencyCode | string | Yes | In which currency it will be converted. |
| cancelRateInfo/toCurrencyCode | string | Yes | Information on which currency to convert to. |
| cancelRateInfo/rate | decimal | Yes | Currency rate |
| cancelId | string | Yes | cancellation id |
| status | String | Yes | Indicates the reservation status. Possible values are:RESERVATION: Indicates an active reservation.CANCELLED: Indicates a fully refunded cancellation.CANCELLED_PENALTY: Indicates a cancelled reservation with a penalty applied. |
Errors specific to this endpoint (19 codes). Gateway and authentication errors apply to every endpoint and are listed in the Error Codes reference.
ValidationThe request is missing a required field, contains an invalid value or breaks a business rule.
| Group | Code | Message | Description |
|---|---|---|---|
| Validation | 0904008 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Validation | 0904009 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Validation | 0904010 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Validation | 0904011 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Validation | 0904086 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Validation | 0904087 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Validation | 0904088 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Validation | 0904135 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Validation | 0904136 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Validation | 0904149 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Validation | 0904165 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Validation | 0904201 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Validation | 0904202 | Returned while cancelling a reservation when the request contains missing or invalid data or breaks a business rule. Fix the request using the message details and send it again. Retrying the same request will fail again. |
Not foundThe referenced record (hotel, reservation, feed, search id, etc.) could not be found.
| Group | Code | Message | Description |
|---|---|---|---|
| Not found | 0904137 | Returned while cancelling a reservation when the referenced record cannot be found. Verify the identifier you sent, or repeat the previous step to obtain a fresh one. |
SystemAn unexpected server-side or upstream provider problem occurred.
| Group | Code | Message | Description |
|---|---|---|---|
| System | 0904138 | Returned while cancelling a reservation when an unexpected server-side or provider-side problem occurs. Retry with exponential backoff. If it persists, contact Etscore support with the error code and request time. | |
| System | 0904139 | Returned while cancelling a reservation when an unexpected server-side or provider-side problem occurs. Retry with exponential backoff. If it persists, contact Etscore support with the error code and request time. | |
| System | 0904140 | Returned while cancelling a reservation when an unexpected server-side or provider-side problem occurs. Retry with exponential backoff. If it persists, contact Etscore support with the error code and request time. | |
| System | 0904213 | Returned while cancelling a reservation when an unexpected server-side or provider-side problem occurs. Retry with exponential backoff. If it persists, contact Etscore support with the error code and request time. | |
| System | 0904214 | Returned while cancelling a reservation when an unexpected server-side or provider-side problem occurs. Retry with exponential backoff. If it persists, contact Etscore support with the error code and request time. |
Error groups
| Group | Meaning | Recommended action |
|---|---|---|
| Validation | Fix the request using the message details and send it again. Retrying the same request will fail again. | |
| Not found | Verify the identifier you sent, or repeat the previous step to obtain a fresh one. | |
| System | Retry with exponential backoff. If it persists, contact Etscore support with the error code and request time. |