Errors

Error responses

Most errors look like this:

{
  "errors": ["Reservation with status TO_BE_DELIVERED cannot be cancelled"],
  "error_codes": [ { "code": "NON_CANCELLABLE", "message": "Reservation with status TO_BE_DELIVERED cannot be cancelled" } ]
}
FieldMeaning
errors Deprecated.Human-readable messages. Always present. Log them, but don't match on their text. Kept for backwards compatibility; it will be removed in a future API version since future API versions will use structured errors.
error_codesMachine-readable codes. Only present for some errors. It can be null or missing, especially for request validation errors. In those cases, use the HTTP status.

Two exceptions

  • 401 Unauthorized (missing or invalid API key):

    { "message": "Api key does not exist or is invalid",
      "error_codes": [ { "code": "UNAUTHORIZED", "message": "Api key does not exist or is invalid" } ] }

    A malformed header (not Bearer <key>) gives the message Authorization header is invalid.

  • 429 Too Many Requests (rate limit):

    { "error": "request limit reached" }

HTTP status codes

StatusMeaningRetry?
200 / 201OK / created—
202Accepted, no body (offer refresh)—
204Accepted, no body (cancellation submitted)—
400The request is invalid: bad parameters, failed validation, or the action isn't allowed in the current stateNo. Fix the request.
401Missing or invalid API keyNo
404Not found, or an offer expired / no longer availableNo. Search again for offers.
422The body couldn't be parsed (Invalid Body Supplied), e.g. a field has the wrong JSON type, or the action can't be processedNo. Fix the request.
429Rate limit (500 requests/second per API key)Yes, after a short back-off
500Error on Katanox's sideYes, with back-off. For bookings, check GET /bookings/{id} first if you got an ID.
505You called /v1, which is no longer supportedNo

A 2xx on POST /bookings or DELETE (cancel) doesn't mean the hotel accepted it. Like booking creation, you need to check the reservation's status and errors by calling GET /bookings/{id}: see Booking and Cancellation.

error_codes[].code

CodeWhereMeaning
UNAUTHORIZEDanyMissing, malformed or invalid API key
BAD_REQUESTanyGeneric invalid request
INVALID_DATAanyA field has an invalid value
NOT_FOUNDanyResource doesn't exist for your account
INTERNAL_SERVER_ERRORanyError on Katanox's side
NON_CANCELLABLEcancelReservation can't be cancelled now (details)
ALREADY_CANCELLEDcancelAlready cancelled

Common messages

MessageCauseFix
Invalid Body Supplied (422)JSON doesn't match the schema, e.g. "expiry_month": 3 instead of "03"Send all payment fields as strings; check types
the structure of the occupancy string is not in the correct formatBad occupancy, e.g. 2;1See Availability → Occupancy
check_in should be a valid date: YYYY-MM-DD / check_out needs to be a date after check_in / check_in cannot be in the pastDate problems—
property IDs size can not be more than 50 / limit cannot be more than 50Over the limit—
offer … does not exist / … has expired. Please refresh the offer … / Offer … can be used N times …Offer problemsSee Offers → Offer errors
the number of guests is more than allowed. Max guest number: N …More guests than searched for in that unitSend at most adults + children of that unit
payment object is not valid. A valid Credit Card is requiredMissing payment for a CREDIT_CARD offerAdd payment (Payments)
`payment.expiry_month` must be one of: [01 … 12] / `payment.expiry_year` must have the following format: YYYY / card expiry date must be after …Card expiry format or expired card—
all reservations must have the same payment method defined in their rate plansMixed CREDIT_CARD and KTX_PAYMENTS offers in one bookingSplit into two bookings
invalid iata codeiata_code longer than 12 characters—