{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/domani-run/json-schema/domani-run-domain-detail-schema.json",
  "title": "DomainDetail",
  "description": "Detailed domain information",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/domani-run-openapi.json#/components/schemas/DomainDetail",
  "type": "object",
  "properties": {
    "domain": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "expired",
        "pending"
      ]
    },
    "auto_renew": {
      "type": "boolean",
      "description": "Whether auto-renew is enabled"
    },
    "purchased_at": {
      "type": "string",
      "format": "date-time"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "days_until_expiry": {
      "type": "integer",
      "description": "Days until domain expiry"
    },
    "renewal_price": {
      "type": [
        "number",
        "null"
      ],
      "description": "What one year of renewal costs in USD at the registrar that holds the domain; renewing N years costs N times this. Null when domani cannot renew the domain or its price is unknown."
    },
    "payment_method": {
      "type": "string",
      "enum": [
        "card",
        "x402",
        "crypto"
      ],
      "description": "How the domain was paid for"
    },
    "payment_tx": {
      "type": [
        "string",
        "null"
      ],
      "description": "On-chain tx hash (USDC payments)"
    },
    "registrant": {
      "type": "string",
      "enum": [
        "customer",
        "domani",
        "unknown"
      ],
      "description": "Who the registry lists as the domain's registrant. `customer`: your own contact details (from set_contact). `domani`: Domani's default contact, holding the domain on your behalf until you add yours with set_contact, which makes you the registrant. `unknown`: not checked yet. WHOIS privacy hides the details either way."
    },
    "transfer_out": {
      "type": "object",
      "description": "Moving the domain to another registrar. `mode` `api`: get_auth_code returns the code. `manual`: the registrar has no API for it, so Domani's team gets it by hand within 1 business day. null: not available for this domain.",
      "properties": {
        "mode": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "api",
            "manual"
          ]
        },
        "locked_until": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Until when get_auth_code answers TRANSFER_LOCKED (ICANN's 60-day lock after a registration or transfer-in; manual mode)"
        },
        "request": {
          "type": [
            "object",
            "null"
          ],
          "description": "The latest transfer code request (manual mode)",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "requested",
                "ready",
                "cancelled"
              ],
              "description": "`requested`: Domani's team is getting the code. `ready`: get_auth_code returns it. `cancelled`: the registrar refused; `note` says why."
            },
            "requested_at": {
              "type": "string",
              "format": "date-time"
            },
            "expected_by": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "When the code will be ready at the latest (status requested)"
            },
            "ready_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "note": {
              "type": [
                "string",
                "null"
              ],
              "description": "Why the request was cancelled"
            }
          },
          "required": [
            "status",
            "requested_at",
            "expected_by",
            "ready_at",
            "note"
          ]
        }
      },
      "required": [
        "mode",
        "locked_until",
        "request"
      ]
    },
    "registrar_status": {
      "type": "string",
      "enum": [
        "connected",
        "unavailable",
        "external"
      ],
      "description": "Whether live registrar data was refreshed or is managed externally"
    },
    "registrar_checked_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the registrar refresh was attempted"
    },
    "registrar": {
      "type": [
        "object",
        "null"
      ],
      "description": "Domain registration details (null if unavailable)",
      "properties": {
        "security_lock": {
          "type": "boolean",
          "description": "Whether the domain is locked against transfers"
        },
        "whois_privacy": {
          "type": "boolean",
          "description": "Whether WHOIS privacy is enabled"
        },
        "auto_renew": {
          "type": "boolean",
          "description": "Auto-renew status"
        },
        "create_date": {
          "type": "string",
          "description": "Domain creation date"
        },
        "expire_date": {
          "type": "string",
          "description": "Domain expiration date"
        }
      }
    }
  },
  "required": [
    "domain",
    "status",
    "auto_renew",
    "purchased_at",
    "expires_at",
    "days_until_expiry",
    "renewal_price",
    "payment_method",
    "registrant",
    "transfer_out",
    "registrar_status",
    "registrar_checked_at"
  ]
}