API v2 · Reference

Hotel API errors and rate limits

Status codes and what to do about them.

Every error has the same envelope. Branch on error.code; message is for people.

Envelope

One shape for every error.

Validation errors are 400 with details.fields[]. A call your tier doesn't include answers 403 with details.reason: "tier_required" and details.required_tier; Enterprise-only features answer 403 with details.reason: "enterprise_only". Quote request_id when you email [email protected].

Response
403
{
  "error": {
    "code": "forbidden",
    "details": {
      "required_scope": "rates"
    },
    "message": "This key does not have the 'rates' scope.",
    "request_id": "req_8f2c1a9b3d4e5f60"
  }
}
Codes

Error codes.

StatusCodeMeaning
400bad_requestThe request is malformed or fails validation. Validation errors list each field in details.fields[].
401unauthorizedNo key, or the key is unknown or revoked.
402insufficient_creditNot enough credit for the call. Checked before any work starts, so nothing was billed.
403forbiddenThe key lacks the scope the endpoint needs (details.required_scope), the tier doesn't include the call (details.reason: "tier_required" with details.required_tier), the feature is Enterprise-only (details.reason: "enterprise_only"), or it isn’t open in production yet (details.reason: "not_yet_available"; no upgrade changes that).
404not_foundThe hotel, offer, booking, job or webhook doesn't exist for this key.
409conflictThe Idempotency-Key was reused with a different body, or the resource is in a state that forbids the change.
429rate_limitedOver the team's per-minute limit (wait Retry-After seconds), or over its daily allowance of different hotels (details.reason: "daily_hotel_cap"; Retry-After runs to 00:00 UTC).
502upstream_errorA service we depend on failed. Safe to retry with backoff.
503unavailableWe're temporarily unable to serve the call. Retry with backoff.

Reasons

When the code alone doesn’t say what to fix, details does. These are the values to branch on.

StatusDetailsWhat to do
400reason: "search_expired"The search_id or cursor you sent has expired. Run the search again.
400reason: "member_rate"The offer is a member-only rate, which can’t be booked through the API. Book a public offer instead.
402reason: "balance"Your credit can’t cover the call. Top up and send it again.
402reason: "spend_cap"The call would go over the monthly spend cap set on the account. Raise the cap in the dashboard.
403required_scope: "rates"The key doesn’t have the scope the endpoint needs. Use a key that has it.
403reason: "tier_required"Your tier doesn’t include the call. details.required_tier names the tier that does; upgrade to it.
403reason: "enterprise_only"The feature is Enterprise-only, for example channel: "third_party" on rates.
403reason: "not_yet_available"The feature isn’t open in production yet, and no upgrade changes that. In production today it covers bookings.
429reason: "daily_hotel_cap"The call would go over today’s allowance of different hotels. details.remaining says how many new hotels still fit; send fewer or wait Retry-After seconds for the 00:00 UTC reset.
409reason: "idempotency_mismatch"The Idempotency-Key was already used with a different body. Use a new key for a new request.

A booking that was accepted and then fails isn’t an error response. It says why in failure.reason on the Booking: unsupported_engine (book it with handoff), payment_unavailable (checkout is off for your account; handoff still works), price_changed_at_payment (the engine charged a different total and the guest’s payment is reversed) and the rest on the Bookings page.

Limits

Requests per minute, by tier.

Limits are per team: every key on a team, test and live, shares one per-minute window and one daily hotel allowance. Three things can stop a call besides the rate: the credit balance (Free, Build and Scale), the monthly spend cap if you set one (Enterprise, invoiced instead, has a $100,000 monthly cap unless the contract sets another), and the daily allowance of different hotels below.

Live rates, batch rates, room reconciliation, quotes and bookings need Build or above. On Free they answer 403 forbidden with details.reason: "tier_required" and details.required_tier: "build". On Free, a test key (vl_test_) can still try them: quotes run in the sandbox for free, cached rate batches take up to 25 hotels for 1 stay and room reconciliation up to 2 sources, paid from the monthly credit. Larger requests answer 403 with details.free_trial saying the limit.

Each team also has a daily allowance of different hotels it can receive data for: hotel detail, rates and batches count the hotels requested, search counts the hotels it returns. A hotel counts once a day however often you fetch it, so re-reading a shortlist never uses it up. Test keys count too. The allowance resets at 00:00 UTC.

TierRequests per minuteDifferent hotels per day
Free102,000
Build12050,000
Scale600250,000
EnterpriseCustomNo limit

Near the allowance, search returns the hotels that still fit and adds a daily_hotel_cap warning, and a batch over it fails its job with the reason in error.details. Hotel detail and rates are all-or-nothing: over the allowance they answer 429 rate_limited with details.reason: "daily_hotel_cap", details.remaining (how many new hotels still fit) and Retry-After set to the reset. Need more? Email [email protected].

Headers

What the headers tell you.

HeaderMeaning
X-RateLimit-LimitRequests allowed per minute for your team. Every key on the team shares the window.
X-RateLimit-RemainingRequests left in the current minute.
X-RateLimit-ResetUnix time the per-minute window resets. It says nothing about the daily hotel allowance.
Retry-AfterOn 429: seconds to wait before retrying. On a `daily_hotel_cap` 429, the seconds until the allowance resets at 00:00 UTC.
X-Credit-RemainingCredit left on the account, a USD decimal string.
X-Hotel-Quota-LimitDifferent hotels the team can receive data for today. Only on calls that return hotel data, and absent on plans without a daily allowance.
X-Hotel-Quota-RemainingDifferent hotels left today. Hotels already fetched today don't use it again.
X-Hotel-Quota-ResetUnix time the daily allowance resets (00:00 UTC).
Retries

When to try again.

  • On rate_limited (429), wait the Retry-After seconds; on details.reason: "daily_hotel_cap" that is until 00:00 UTC, so stop and report rather than retry.
  • 502 and 503: back off exponentially. Errors are never billed.
  • 402: top up first. We check credit before any work starts, so nothing was spent.
  • 400, 401, 403, 404, 409: retrying the same request won't help.
  • Retry POSTs with the same Idempotency-Keyso a timeout can't start two jobs.

ErrorBody

The error itself: a stable code, a readable message and optional details.

FieldTypeDescription
code
REQUIRED
stringStable error code; the HTTP status follows from it (bad_request 400, unauthorized 401, insufficient_credit 402, forbidden 403, not_found 404, conflict 409, rate_limited 429, upstream_error 502, unavailable 503). A method the route does not accept is bad_request with status 405. One of bad_request, unauthorized, forbidden, not_found, conflict, rate_limited, insufficient_credit, upstream_error, unavailable.
message
REQUIRED
stringHuman-readable explanation in English; do not parse it, branch on code and details.
request_idstring | nullId of the failed request, the same value as the X-Request-Id header.
detailsobject | nullMachine-readable context when there is some: fields[] on validation errors, required_scope on a missing scope, and reason elsewhere, for example tier_required (with required_tier) or enterprise_only on a 403, balance or spend_cap on a 402, idempotency_mismatch on a 409, search_expired on a 400.