{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentbookable-com/json-schema/agentbookable-com-service-schema.json",
  "title": "Service",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentbookable-com-services-api-openapi.yml#/components/schemas/Service",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "businessId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "durationMinutes": {
      "type": "integer"
    },
    "price": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "amount": {
          "type": "number"
        },
        "currency": {
          "type": "string"
        }
      }
    },
    "staff": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "bookingRequirements": {
      "$ref": "#/$defs/BookingRequirements"
    }
  },
  "$defs": {
    "BookingRequirements": {
      "type": "object",
      "description": "What the agent must collect from the user BEFORE booking. Contact requirements are provider-derived; AgentBookable never reveals which provider.",
      "properties": {
        "name": {
          "type": "string",
          "enum": [
            "required",
            "optional"
          ],
          "description": "Customer name."
        },
        "email": {
          "type": "string",
          "enum": [
            "required",
            "optional"
          ],
          "description": "Customer email."
        },
        "phone": {
          "type": "string",
          "enum": [
            "required",
            "optional"
          ],
          "description": "Customer phone. 'required' means the booking is rejected without one — collect it first."
        },
        "payment": {
          "type": "boolean",
          "description": "True when payment is required to confirm."
        }
      }
    }
  }
}