Skip to content

Concepts

Errors

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.

Format

Response, 422
{
  "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" }
  ]
}
FieldContent
typeURL of the explanation on this page, https://staystryk.com/developers/errors#<code>
titleShort summary in English
statusHTTP status
detailExplanation of this specific occurrence in English, without internal details
instancePath of the request
codeMachine-readable code from the list below
requestIdSame as the X-Request-Id header; quote it when asking for support
errorsFor validation_failed: the fields affected and why
JavaScript
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'));
}

Error codes

bad_request400

The request cannot be read, for example malformed JSON or an invalid parameter format.

Fix the request. Do not retry unchanged.

invalid_cursor400

The cursor is unknown, damaged or belongs to a different list or filter.

Restart the list without cursor, with the same filters.

unauthorized401

No 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_expired401

The key has passed its expiry date.

Ask the hotel to rotate the key or create a new one.

ip_not_allowed403

The 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_scope403

The key lacks the scope this endpoint needs.

Ask the hotel to create a key with the scope named in detail.

module_disabled403

The hotel is inactive or has not enabled the channels module.

Contact the hotel. Retrying does not help.

not_found404

The resource does not exist for this hotel, or the route is unknown.

Check the ID and path. IDs of other hotels are never visible.

conflict409

The 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_progress409

A request with the same Idempotency-Key is still being processed.

Wait briefly and retry with the same key.

not_available409

The requested room type is not available for the stay, or a restriction prevents it.

Reload availability and offer alternatives.

booking_not_modifiable409

The 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_failed412

The If-Match ETag is outdated: the resource changed since you read it.

Read again, re-apply your change, write with the new ETag.

validation_failed422

Fields are missing or invalid; errors[] lists them.

Correct the fields named in errors[].

idempotency_key_reused422

The Idempotency-Key was already used with a different request body.

Use a new key for a changed request.

precondition_required428

This write needs an If-Match header.

Read the resource and send its ETag as If-Match.

rate_limited429

The key sent more requests in 60 seconds than its limit allows (120 by default).

Wait for Retry-After seconds, see Rate limits.

internal_error500

An unexpected error in STRYK.

Retry with backoff; writes with the same Idempotency-Key. If it persists, contact support with the requestId.

service_unavailable503

STRYK is temporarily unavailable, for example during maintenance.

Retry with backoff and respect Retry-After if present.