{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/viatovia/json-schema/viatovia-create-booking-request-schema.json",
  "title": "CreateBookingRequest",
  "x-generated": "2026-12-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/booking-openapi.json#/components/schemas/CreateBookingRequest",
  "type": "object",
  "properties": {
    "search_id": {
      "type": "string"
    },
    "vehicle_id": {
      "description": "The `vehicle_id` of the search result.",
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ]
    },
    "passenger": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "surname": {
          "type": "string"
        },
        "phone": {
          "type": "string",
          "pattern": "^\\+[1-9]\\d{1,14}$",
          "minLength": 6
        },
        "email": {
          "type": "string",
          "format": "email"
        }
      },
      "required": [
        "name",
        "surname",
        "phone",
        "email"
      ]
    },
    "travel_details": {
      "type": "object",
      "properties": {
        "flight_number": {
          "type": [
            "string",
            "null"
          ]
        },
        "extra_requests": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "suitcase": {
      "type": "integer",
      "minimum": 0
    },
    "small_bags": {
      "type": "integer",
      "minimum": 0
    },
    "extra_services": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "quantity": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        },
        "required": [
          "id"
        ]
      }
    }
  },
  "required": [
    "search_id",
    "vehicle_id",
    "passenger",
    "suitcase",
    "small_bags"
  ]
}