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:

Response

> 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:

Response

> 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
61Invalid currency code
111Booking invalid
118Booking status invalid
125Room/unit type not offered
141Room/unit code incorrect
145Duration period or dates incorrect
146Service requested incorrect
172Requested action not possible
175Password invalid
184Language code invalid
237Invalid customer number
245Invalid confirmation number
284No reservations found for search criteria
304Invalid expiration format MMYY
305Invalid booking source
313Required data missing: credit card type
320Invalid value
358Error convention/group code
378Invalid - max number of rooms exceeded
389Invalid guarantee type
392Invalid hotel code
402Invalid room type
407Item too long
426No rates offered for this sell request
427No rooms available for requested dates
436Rate does not exist
437Rate unavailable
448System error
450Unable to process
842Rate not loaded