{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xavio-in/json-schema/xavio-in-booking-transition-schema.json",
  "title": "BookingTransition",
  "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/BookingTransition",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "booking_transition"
      ]
    },
    "booking_id": {
      "type": "string",
      "format": "uuid"
    },
    "from": {
      "type": "string"
    },
    "to": {
      "type": "string"
    },
    "replayed": {
      "type": "boolean",
      "description": "true when the booking already had this status — nothing was written."
    },
    "meeting_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Call link, when one is attached on confirm."
    },
    "booking": {
      "oneOf": [
        {
          "$ref": "#/$defs/Booking"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "object",
    "booking_id",
    "from",
    "to",
    "replayed",
    "booking"
  ],
  "$defs": {
    "Booking": {
      "type": "object",
      "description": "A booking on one of your services. `contact` appears only with the customers:pii scope.",
      "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"
      ]
    }
  }
}