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.
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].
{
"error": {
"code": "forbidden",
"details": {
"required_scope": "rates"
},
"message": "This key does not have the 'rates' scope.",
"request_id": "req_8f2c1a9b3d4e5f60"
}
}Error codes.
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | The request is malformed or fails validation. Validation errors list each field in details.fields[]. |
| 401 | unauthorized | No key, or the key is unknown or revoked. |
| 402 | insufficient_credit | Not enough credit for the call. Checked before any work starts, so nothing was billed. |
| 403 | forbidden | The 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). |
| 404 | not_found | The hotel, offer, booking, job or webhook doesn't exist for this key. |
| 409 | conflict | The Idempotency-Key was reused with a different body, or the resource is in a state that forbids the change. |
| 429 | rate_limited | Over 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). |
| 502 | upstream_error | A service we depend on failed. Safe to retry with backoff. |
| 503 | unavailable | We'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.
| Status | Details | What to do |
|---|---|---|
| 400 | reason: "search_expired" | The search_id or cursor you sent has expired. Run the search again. |
| 400 | reason: "member_rate" | The offer is a member-only rate, which can’t be booked through the API. Book a public offer instead. |
| 402 | reason: "balance" | Your credit can’t cover the call. Top up and send it again. |
| 402 | reason: "spend_cap" | The call would go over the monthly spend cap set on the account. Raise the cap in the dashboard. |
| 403 | required_scope: "rates" | The key doesn’t have the scope the endpoint needs. Use a key that has it. |
| 403 | reason: "tier_required" | Your tier doesn’t include the call. details.required_tier names the tier that does; upgrade to it. |
| 403 | reason: "enterprise_only" | The feature is Enterprise-only, for example channel: "third_party" on rates. |
| 403 | reason: "not_yet_available" | The feature isn’t open in production yet, and no upgrade changes that. In production today it covers bookings. |
| 429 | reason: "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. |
| 409 | reason: "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.
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.
| Tier | Requests per minute | Different hotels per day |
|---|---|---|
| Free | 10 | 2,000 |
| Build | 120 | 50,000 |
| Scale | 600 | 250,000 |
| Enterprise | Custom | No 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].
What the headers tell you.
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Requests allowed per minute for your team. Every key on the team shares the window. |
X-RateLimit-Remaining | Requests left in the current minute. |
X-RateLimit-Reset | Unix time the per-minute window resets. It says nothing about the daily hotel allowance. |
Retry-After | On 429: seconds to wait before retrying. On a `daily_hotel_cap` 429, the seconds until the allowance resets at 00:00 UTC. |
X-Credit-Remaining | Credit left on the account, a USD decimal string. |
X-Hotel-Quota-Limit | Different 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-Remaining | Different hotels left today. Hotels already fetched today don't use it again. |
X-Hotel-Quota-Reset | Unix time the daily allowance resets (00:00 UTC). |
When to try again.
- On
rate_limited(429), wait theRetry-Afterseconds; ondetails.reason: "daily_hotel_cap"that is until 00:00 UTC, so stop and report rather than retry. 502and503: 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.
| Field | Type | Description |
|---|---|---|
codeREQUIRED | string | Stable 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. |
messageREQUIRED | string | Human-readable explanation in English; do not parse it, branch on code and details. |
request_id | string | null | Id of the failed request, the same value as the X-Request-Id header. |
details | object | null | Machine-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. |