{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nisebookings-com/json-schema/nisebookings-com-item-input-schema.json",
  "title": "ItemInput",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/guide-openapi.json#/components/schemas/ItemInput",
  "type": "object",
  "required": [
    "service"
  ],
  "properties": {
    "service": {
      "type": "string",
      "format": "uuid"
    },
    "staff": {
      "type": [
        "string",
        "null"
      ],
      "description": "Staff id, or `any`/omitted to let the engine choose."
    },
    "start": {
      "type": "string",
      "description": "ISO 8601 UTC, exactly as returned by a slot search. A day service returns it with the business offset (local midnight); send it back as-is."
    },
    "end": {
      "type": "string",
      "description": "Day services only (`durationDays` > 0): the `end` of the same slot — local midnight `durationDays` calendar days after `start`. Send it back verbatim; the server re-checks the whole span. Ignored for other services."
    },
    "persons": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000,
      "default": 1
    },
    "extras": {
      "type": "object",
      "description": "Quantity per extra id; clamped server-side, mandatory extras added. A day service has no extras (any value → 422).",
      "additionalProperties": {
        "type": "integer",
        "minimum": 0
      }
    },
    "fields": {
      "type": "object",
      "description": "Answers to the service's intake questions, keyed by field id (see GET /services). A perPerson field sends an array with one entry per person; `textarea` is capped at 2000 and `text` at 500 characters, `date` is YYYY-MM-DD, and a `file` field sends the upload id from POST /uploads (unknown, another account's or already-used ids are 422). Unknown ids are ignored; a missing or wrong answer is 422 with the field id in `fields`.",
      "additionalProperties": true
    },
    "series": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{1,64}$",
      "description": "Key linking this item to a rule in the order's `series` map."
    },
    "waitlist": {
      "type": "boolean",
      "description": "Join the waiting list; cannot combine with `series` or `package`."
    },
    "package": {
      "type": "string",
      "pattern": "^[0-9a-f]{48}$",
      "description": "Token of a bought package; the visit is not paid. Requires `persons: 1`."
    },
    "kind": {
      "type": "string",
      "enum": [
        "booking",
        "package"
      ],
      "default": "booking",
      "description": "`package` buys a package itself (no `start`)."
    }
  }
}