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#
{
"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#
| Code | Meaning | What to do |
|---|---|---|
| invalid_json | the body is not valid JSON or has an unknown field. | Fix the body. Unknown fields are refused too. |
| invalid_idempotency_key | Idempotency-Key missing or not 8 to 128 characters. | Send an Idempotency-Key of 8 to 128 characters. |
| invalid_request | the body could not be read. | Retry; the body could not be read. |
401 Unauthorized#
| Code | Meaning | What to do |
|---|---|---|
| missing, 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_missing | a /bookings request without all four signature headers. | Send all four X-Tulo-* signature headers. |
| signature_invalid | the signature does not verify, or the timestamp or nonce is malformed. | Check the signing string against the test vectors. |
| signature_expired | X-Tulo-Timestamp is more than 5 minutes from Tulo's clock. | Sync your server clock; sign just before sending. |
| signature_replayed | the nonce was already used. | Use a new nonce for every request, retries included. |
| signing_key_unknown | X-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#
| Code | Meaning | What to do |
|---|---|---|
| insufficient_scope | the key lacks the route's scope. | Use a secret key for /bookings routes. |
| origin_not_allowed | a 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_browser | a secret key sent with an Origin header. | Move the call to your server. |
| bookings_not_granted | Tulo has not granted this property online bookings. | Online booking is not enabled for this property yet. Show contact details instead. |
404 Not found#
| Code | Meaning | What to do |
|---|---|---|
| not_found | the 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#
| Code | Meaning | What to do |
|---|---|---|
| no_availability | nothing sellable for those dates and that room type. | Send the guest back to the dates or the room choice. |
| not_accepting | the property has switched online reservations off. | The property has paused online reservations. Show contact details instead. |
| booking_changed | the booking changed meanwhile; reload it. | Read the booking again, then decide. |
| not_cancellable | only a confirmed booking before check-in can be cancelled. | Read the booking: it has started, ended or is already cancelled. |
| idempotency_key_reused | the key was used for a different request. | Use a new key for a new attempt. |
| idempotency_in_progress | the same request is still running; retry after Retry-After. | Wait Retry-After seconds and retry. |
413 Too large#
| Code | Meaning | What to do |
|---|---|---|
| request_too_large | body over 64 KiB. | Keep the body at or under 64 KiB. A booking body is far smaller. |
422 Validation failed#
| Code | Meaning | What to do |
|---|---|---|
| validation_failed | a parameter or field is missing or out of range. | Show the guest what to change; message says which field. |
429 Rate limited#
| Code | Meaning | What to do |
|---|---|---|
| rate_limited | over the rate limit; wait Retry-After seconds. | Wait Retry-After seconds. |
500 Internal error#
| Code | Meaning | What to do |
|---|---|---|
| internal_error | Tulo failed; retry later. | Retry later with a backoff. On POST /bookings keep the same Idempotency-Key: nothing was booked. |
503 Unavailable#
| Code | Meaning | What to do |
|---|---|---|
| bookings_offline | Tulo bookings are switched off platform-wide. | Tulo bookings are off for now. Show contact details instead. |
| a Tulo dependency is down; retry later. | Retry later with a backoff. | |
| a Tulo dependency is down; retry later. | Retry later with a backoff. | |
| a 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.
