bad_request400
The request cannot be read, for example malformed JSON or an invalid parameter format.
Fix the request. Do not retry unchanged.
Concepts
Errors use RFC 9457 problem details with the content type application/problem+json. Branch on code: it is stable. title and detail are meant for people and may be worded differently over time.
{
"type": "https://staystryk.com/developers/errors#validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "The request contains invalid fields.",
"instance": "/api/partner/v1/bookings",
"code": "validation_failed",
"requestId": "e1d2c3b4-a596-4877-8695-a4b3c2d1e0f9",
"errors": [
{ "field": "checkOut", "message": "must be after checkIn" },
{ "field": "guest.email", "message": "must be a valid email address" }
]
}| Field | Content |
|---|---|
type | URL of the explanation on this page, https://staystryk.com/developers/errors#<code> |
title | Short summary in English |
status | HTTP status |
detail | Explanation of this specific occurrence in English, without internal details |
instance | Path of the request |
code | Machine-readable code from the list below |
requestId | Same as the X-Request-Id header; quote it when asking for support |
errors | For validation_failed: the fields affected and why |
const response = await fetch(url, options);
if (!response.ok) {
const isProblem = response.headers.get('Content-Type')?.includes('application/problem+json');
const problem = isProblem ? await response.json() : { code: 'internal_error', status: response.status };
// Branch on problem.code, it is stable. title and detail are for humans and may change.
console.error(problem.code, problem.detail, 'request', problem.requestId ?? response.headers.get('X-Request-Id'));
}bad_request400The request cannot be read, for example malformed JSON or an invalid parameter format.
Fix the request. Do not retry unchanged.
idempotency_key_required400This operation requires an Idempotency-Key header.
Send a key, see Idempotency.
invalid_cursor400The cursor is unknown, damaged or belongs to a different list or filter.
Restart the list without cursor, with the same filters.
unauthorized401No key, a malformed key or a revoked key.
Check the Authorization: Bearer header. If the key was revoked, ask the hotel for a new one.
key_expired401The key has passed its expiry date.
Ask the hotel to rotate the key or create a new one.
ip_not_allowed403The request comes from an address outside the key's IP allowlist.
Call from an allowed address or ask the hotel to extend the list.
insufficient_scope403The key lacks the scope this endpoint needs.
Ask the hotel to create a key with the scope named in detail.
module_disabled403The hotel is inactive or has not enabled the channels module.
Contact the hotel. Retrying does not help.
not_found404The resource does not exist for this hotel, or the route is unknown.
Check the ID and path. IDs of other hotels are never visible.
method_not_allowed405The route exists but not with this HTTP method.
Use the method from the reference.
conflict409The request conflicts with the current state. For bookings: the price differs from expectedTotal; currentTotal contains the current price.
Show the guest the new price and send a new request after confirmation.
idempotency_in_progress409A request with the same Idempotency-Key is still being processed.
Wait briefly and retry with the same key.
not_available409The requested room type is not available for the stay, or a restriction prevents it.
Reload availability and offer alternatives.
booking_not_modifiable409The booking is checked in, checked out or cancelled and cannot be changed over the API.
Do not retry. The hotel handles the change in STRYK.
precondition_failed412The If-Match ETag is outdated: the resource changed since you read it.
Read again, re-apply your change, write with the new ETag.
payload_too_large413The request body exceeds 64 KiB.
Send less data per request.
unsupported_media_type415The body is not application/json.
Send JSON with Content-Type: application/json.
validation_failed422Fields are missing or invalid; errors[] lists them.
Correct the fields named in errors[].
idempotency_key_reused422The Idempotency-Key was already used with a different request body.
Use a new key for a changed request.
precondition_required428This write needs an If-Match header.
Read the resource and send its ETag as If-Match.
rate_limited429The key sent more requests in 60 seconds than its limit allows (120 by default).
Wait for Retry-After seconds, see Rate limits.
internal_error500An unexpected error in STRYK.
Retry with backoff; writes with the same Idempotency-Key. If it persists, contact support with the requestId.
service_unavailable503STRYK is temporarily unavailable, for example during maintenance.
Retry with backoff and respect Retry-After if present.