Errors

Every error has one shape. Branch on code, not on message or status alone; message is English for developers and may change.

The envelope#

JSON
{
  "error": {
    "code": "validation_failed",
    "message": "adults must be a whole number from 1 to 50"
  }
}

A multi-room create refused for want of rooms adds detail fields to error: reason, first_blocked_night, available_count, room_type_id and rooms. See Several rooms in one booking.

Every code#

Generated from the ErrorCode schema of the contract. Which routes can answer which codes is in the API reference.

400 Bad request#

400 errors
CodeMeaningWhat to do
invalid_jsonthe body is not valid JSON or has an unknown field.Fix the body. Unknown fields are refused too.
invalid_idempotency_keyIdempotency-Key missing or not 8 to 128 characters.Send an Idempotency-Key of 8 to 128 characters.
invalid_requestthe body could not be read.Retry; the body could not be read.

401 Unauthorized#

401 errors
CodeMeaningWhat to do
unauthorizedmissing, unknown, revoked or expired key; a secret key in a URL.Check the key: revoked, expired, mistyped, or a secret key in a URL.
signature_missinga /bookings request without all four signature headers.Send all four X-Tulo-* signature headers.
signature_invalidthe signature does not verify, or the timestamp or nonce is malformed.Check the signing string against the test vectors.
signature_expiredX-Tulo-Timestamp is more than 5 minutes from Tulo's clock.Sync your server clock; sign just before sending.
signature_replayedthe nonce was already used.Use a new nonce for every request, retries included.
signing_key_unknownX-Tulo-Key-Id is not an active signing key of this property.Use the id of an active signing key of this property.

403 Forbidden#

403 errors
CodeMeaningWhat to do
insufficient_scopethe key lacks the route's scope.Use a secret key for /bookings routes.
origin_not_alloweda publishable key from an origin it is not bound to.Add the origin to the publishable key, or call from an allowed origin.
secret_key_in_browsera secret key sent with an Origin header.Move the call to your server.
bookings_not_grantedTulo has not granted this property online bookings.Online booking is not enabled for this property yet. Show contact details instead.

404 Not found#

404 errors
CodeMeaningWhat to do
not_foundthe place is not public, or the booking is not this website's.The place is not public, or the booking is not one of this website's.

409 Conflict#

409 errors
CodeMeaningWhat to do
no_availabilitynothing sellable for those dates and that room type.Send the guest back to the dates or the room choice.
not_acceptingthe property has switched online reservations off.The property has paused online reservations. Show contact details instead.
booking_changedthe booking changed meanwhile; reload it.Read the booking again, then decide.
not_cancellableonly a confirmed booking before check-in can be cancelled.Read the booking: it has started, ended or is already cancelled.
idempotency_key_reusedthe key was used for a different request.Use a new key for a new attempt.
idempotency_in_progressthe same request is still running; retry after Retry-After.Wait Retry-After seconds and retry.

413 Too large#

413 errors
CodeMeaningWhat to do
request_too_largebody over 64 KiB.Keep the body at or under 64 KiB. A booking body is far smaller.

422 Validation failed#

422 errors
CodeMeaningWhat to do
validation_faileda parameter or field is missing or out of range.Show the guest what to change; message says which field.

429 Rate limited#

429 errors
CodeMeaningWhat to do
rate_limitedover the rate limit; wait Retry-After seconds.Wait Retry-After seconds.

500 Internal error#

500 errors
CodeMeaningWhat to do
internal_errorTulo failed; retry later.Retry later with a backoff. On POST /bookings keep the same Idempotency-Key: nothing was booked.

503 Unavailable#

503 errors
CodeMeaningWhat to do
bookings_offlineTulo bookings are switched off platform-wide.Tulo bookings are off for now. Show contact details instead.
rate_limit_unavailablea Tulo dependency is down; retry later.Retry later with a backoff.
idempotency_unavailablea Tulo dependency is down; retry later.Retry later with a backoff.
unavailablea Tulo dependency is down; retry later.Retry later with a backoff.

What to show guests#

Never show message to a guest as it is. Map the codes a guest can cause to your own words: no_availability (the room went), validation_failed (a form field), not_accepting, bookings_not_granted and bookings_offline (online booking is not open: show the property's phone number from GET /place). Everything else is yours to handle and log.

Questions? Email support@mail.tulo.homes or WhatsApp +260 77 235 2417.