{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nisebookings-com/json-schema/nisebookings-com-booking-result-schema.json",
  "title": "BookingResult",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/guide-openapi.json#/components/schemas/BookingResult",
  "type": "object",
  "required": [
    "orderToken",
    "items",
    "payment"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "First item's booking id (legacy single-item clients)."
    },
    "kind": {
      "type": "string",
      "enum": [
        "booking",
        "package"
      ],
      "description": "First item's kind (legacy position)."
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "approved",
        "rejected",
        "cancelled",
        "done",
        "waitlisted",
        "package"
      ],
      "description": "First item's status; `package` for a package purchase."
    },
    "start": {
      "type": [
        "string",
        "null"
      ]
    },
    "serviceTitle": {
      "type": "string"
    },
    "staffName": {
      "type": "string"
    },
    "fields": {
      "$ref": "#/$defs/BookingFields",
      "description": "The stored answers of the first item (legacy position), keyed by field id."
    },
    "orderToken": {
      "type": "string",
      "description": "48-hex order token."
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "status",
          "serviceTitle",
          "staffName"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "package"
            ],
            "description": "Present for package purchases."
          },
          "status": {
            "type": "string",
            "description": "`package` for package purchases, else a booking status."
          },
          "start": {
            "type": [
              "string",
              "null"
            ]
          },
          "serviceTitle": {
            "type": "string"
          },
          "staffName": {
            "type": "string"
          },
          "fields": {
            "$ref": "#/$defs/BookingFields",
            "description": "The stored answers, keyed by field id."
          }
        }
      }
    },
    "payment": {
      "$ref": "#/$defs/PaymentRef"
    }
  },
  "$defs": {
    "BookingFields": {
      "type": "object",
      "description": "Answers to the service's intake questions as stored on the booking; a `file` answer is `{id, name}`.",
      "additionalProperties": true
    },
    "PaymentRef": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "completed",
            "none"
          ]
        },
        "checkoutUrl": {
          "type": "string",
          "description": "Present for Mollie orders; redirect the browser here."
        }
      }
    }
  }
}