{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/quub-rent/json-schema/quub-rent-prebook-request-schema.json",
  "title": "PrebookRequest",
  "description": "offer_id alone is enough: Quub resolves the hotel, dates, adults, currency and nationality from its own record of the offers it issued (about 30 minutes). Any of those fields sent anyway must match the offer (409 otherwise). An unknown or expired offer_id is a 404 with search_again true, unless the full request (hotel_id, checkin, checkout) is sent.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/quub-rent-openapi.json#/components/schemas/PrebookRequest",
  "type": "object",
  "required": [
    "offer_id"
  ],
  "properties": {
    "offer_id": {
      "type": "string",
      "minLength": 8,
      "maxLength": 4000
    },
    "hotel_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{1,40}$",
      "description": "Optional; must match the offer."
    },
    "checkin": {
      "type": "string",
      "format": "date"
    },
    "checkout": {
      "type": "string",
      "format": "date"
    },
    "adults": {
      "type": "integer",
      "minimum": 1,
      "maximum": 8,
      "default": 2
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Za-z]{3}$",
      "default": "EUR"
    },
    "nationality": {
      "type": "string",
      "pattern": "^[A-Za-z]{2}$"
    },
    "expected_total": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "With a key: the total the agent saw, so a different hold total is flagged. Ignored without a key; never charged."
    },
    "guest": {
      "type": "object",
      "description": "Optional. All four fields or none; without them the guest enters their details on the pay page.",
      "properties": {
        "first_name": {
          "type": "string",
          "maxLength": 60
        },
        "last_name": {
          "type": "string",
          "maxLength": 60
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "phone": {
          "type": "string"
        }
      }
    },
    "remarks": {
      "type": "string",
      "maxLength": 500
    }
  }
}