{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/actuallycare-com/json-schema/actuallycare-com-escrow-schema.json",
  "title": "Escrow",
  "description": "Real estate transaction (escrow) record",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/actuallycare-com-v1-openapi.json#/components/schemas/Escrow",
  "type": "object",
  "required": [
    "property_address"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier"
    },
    "user_id": {
      "type": "string",
      "format": "uuid",
      "description": "Owner/agent ID"
    },
    "property_address": {
      "type": "string",
      "description": "Full property address"
    },
    "city": {
      "type": "string",
      "description": "City name"
    },
    "state": {
      "type": "string",
      "description": "State abbreviation"
    },
    "zip_code": {
      "type": "string",
      "description": "ZIP code"
    },
    "purchase_price": {
      "type": "number",
      "format": "double",
      "minimum": 0,
      "description": "Purchase price in USD"
    },
    "escrow_status": {
      "type": "string",
      "enum": [
        "active",
        "pending",
        "closed",
        "cancelled"
      ],
      "description": "Current status"
    },
    "acceptance_date": {
      "type": "string",
      "format": "date",
      "description": "Offer acceptance date"
    },
    "closing_date": {
      "type": "string",
      "format": "date",
      "description": "Expected closing date"
    },
    "buyers": {
      "type": "array",
      "description": "List of buyers",
      "items": {
        "$ref": "#/$defs/Person"
      }
    },
    "sellers": {
      "type": "array",
      "description": "List of sellers",
      "items": {
        "$ref": "#/$defs/Person"
      }
    },
    "listing_agent": {
      "$ref": "#/$defs/Agent"
    },
    "selling_agent": {
      "$ref": "#/$defs/Agent"
    },
    "escrow_company": {
      "type": "string",
      "description": "Escrow/title company name"
    },
    "escrow_officer": {
      "type": "string",
      "description": "Escrow officer name"
    },
    "property_type": {
      "type": "string",
      "enum": [
        "single_family",
        "condo",
        "townhouse",
        "multi_family",
        "land",
        "commercial"
      ]
    },
    "bedrooms": {
      "type": "integer",
      "minimum": 0
    },
    "bathrooms": {
      "type": "number",
      "format": "float",
      "minimum": 0
    },
    "square_feet": {
      "type": "integer",
      "minimum": 0
    },
    "lot_size": {
      "type": "number",
      "format": "float",
      "minimum": 0,
      "description": "Lot size in acres"
    },
    "year_built": {
      "type": "integer",
      "minimum": 1800,
      "maximum": 2100
    },
    "contingencies": {
      "type": "array",
      "description": "Active contingencies",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "due_date": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "satisfied",
              "waived",
              "removed"
            ]
          }
        }
      }
    },
    "earnest_money": {
      "type": "number",
      "format": "double",
      "minimum": 0,
      "description": "Earnest money deposit amount"
    },
    "commission_rate": {
      "type": "number",
      "format": "float",
      "minimum": 0,
      "maximum": 100,
      "description": "Commission percentage"
    },
    "notes": {
      "type": "string",
      "description": "Internal notes"
    },
    "version": {
      "type": "integer",
      "description": "Optimistic locking version"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "last_modified_by": {
      "type": "string",
      "format": "uuid",
      "description": "Last user to modify record"
    }
  },
  "$defs": {
    "Agent": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "phone": {
          "type": "string"
        },
        "license": {
          "type": "string",
          "description": "Real estate license number"
        },
        "brokerage": {
          "type": "string"
        }
      }
    },
    "Person": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "phone": {
          "type": "string"
        }
      }
    }
  }
}