{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xavio-in/json-schema/xavio-in-booking-schema.json",
  "title": "Booking",
  "description": "A booking on one of your services. `contact` appears only with the customers:pii scope.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xavio-in-bookings-api-openapi.yml#/components/schemas/Booking",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "object": {
      "type": "string",
      "enum": [
        "booking"
      ]
    },
    "booking_listing_id": {
      "type": "string",
      "format": "uuid"
    },
    "drawer_host_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "preferred_at": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "type": "string",
      "enum": [
        "new",
        "confirmed",
        "rescheduled",
        "completed",
        "no_show",
        "cancelled"
      ]
    },
    "payment_status": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "confirmed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "cancelled_by": {
      "type": [
        "string",
        "null"
      ]
    },
    "host_notes": {
      "type": [
        "string",
        "null"
      ],
      "description": "The seller's private note."
    },
    "contact": {
      "type": "object",
      "description": "customers:pii ONLY (absent otherwise): what the customer typed when booking. Never their email, account id or magic-link token.",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        },
        "notes": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  },
  "required": [
    "id",
    "object",
    "booking_listing_id",
    "drawer_host_id",
    "preferred_at",
    "status",
    "payment_status",
    "created_at",
    "confirmed_at",
    "cancelled_by",
    "host_notes"
  ]
}