Error Handling
API Documentation / Error Handling
HTTP Error Status Codes
If we cannot process your request, we use the following HTTP Status Codes for indicating the type of error:
Status Code | Status Name | Description |
---|---|---|
400 | Bad Request | Usually happens if a request is invalid and cannot be processed by the web application at all. This happens when e.g. the payload is syntactically erroneous. |
401 | Unauthorized | You provided wrong credentials, or you reached your API limit. Please get in contact with your responsible Customer Success Team. |
403 | Forbidden | The application does not have access to the requested resource. Please get in contact with your responsible Customer Success Team. |
404 | Not Found | Usually happens if the requested resource could not be found. |
422 | Unprocessable Entity | The payload of the request is semantically erroneous and validation failed. Examples would be a missing required field or arrival date is after departure date for a new booking resource. |
500 | Internal Server Error | We caught an unexpected error on our side. Please report with providing the Hetras-Tracking-Id from the response headers and we will check the logfiles. |
503 | Service Temporarily Unavailable | We have had an error on the server side, please try again later. You usually get a detailed error description along with the response. This also may indicate that the server is under haavy load at the moment |
504 | Gateway Timeout | The API gateway you are hitting cannot communicate properly with the server. This may be due to high load on server which is queeing each request for longer than usual times. Retry again later or if the issue is persistent please send us an email. |
Error responses without messages
For the HTTP status codes 400, 401 and 500 we do not return more detailed messages. An example for a bad request could look like the following:
> HTTP/1.1 400 Bad Request
> Cache-Control: no-cache
> Pragma: no-cache
> Content-Type: application/json; charset=utf-8
> Expires: -1
> Server: Microsoft-IIS/7.5
> X-AspNet-Version: 4.0.30319
> X-Powered-By: ASP.NET
> Date: Fri, 06 Mar 2015 13:08:28 GMT
> Content-Length: 0
Error responses with messages
For the HTTP status codes 404, 422 and 503 we return a error messages that are supposed to help the client application to distinguish between different error scenarios. The format of the payload is defined by the Content-Type header sent with your request. You will get back an array of error messages that by themself consist of 3 fields:
- code — Predefined numeric error code
- text — Predefined error message
- extra_info — Optional field that contains additional information about the error.
Here is an example of an error response for a request with an invalid payload:
> HTTP/1.1 422 Unprocessable Entity
> Cache-Control: no-cache
> Pragma: no-cache
> Content-Type: application/json; charset=utf-8
> Expires: -1
> Server: Microsoft-IIS/7.5
> X-AspNet-Version: 4.0.30319
> X-Powered-By: ASP.NET
> Date: Fri, 06 Mar 2015 13:11:51 GMT
> Content-Length: 88
>
> {
> "messages" : [{
> "code" : 320,
> "text" : "Invalid value",
> "extra_info" : "arrivalDate is invalid"
> }]
> }
The list of currently returned error codes and messages is aligned with the OpenTravel 2012A Publication.
Code | Message |
---|---|
61 | Invalid currency code |
111 | Booking invalid |
118 | Booking status invalid |
125 | Room/unit type not offered |
141 | Room/unit code incorrect |
145 | Duration period or dates incorrect |
146 | Service requested incorrect |
172 | Requested action not possible |
175 | Password invalid |
184 | Language code invalid |
237 | Invalid customer number |
245 | Invalid confirmation number |
284 | No reservations found for search criteria |
304 | Invalid expiration format MMYY |
305 | Invalid booking source |
313 | Required data missing: credit card type |
320 | Invalid value |
358 | Error convention/group code |
378 | Invalid - max number of rooms exceeded |
389 | Invalid guarantee type |
392 | Invalid hotel code |
402 | Invalid room type |
407 | Item too long |
426 | No rates offered for this sell request |
427 | No rooms available for requested dates |
436 | Rate does not exist |
437 | Rate unavailable |
448 | System error |
450 | Unable to process |
842 | Rate not loaded |