{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/klisten-co-kr/json-schema/klisten-co-kr-escrow-draft-schema.json",
  "title": "EscrowDraft",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/klisten-co-kr-agentescrow-api-openapi.yml#/components/schemas/EscrowDraft",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "status": {
      "type": "string",
      "const": "UNFUNDED_DRAFT"
    },
    "funds": {
      "type": "string",
      "const": "unfunded"
    },
    "release_authorized": {
      "type": "boolean",
      "const": false
    },
    "scope": {
      "type": "object",
      "properties": {
        "org_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "visibility": {
          "type": "string",
          "const": "private"
        }
      },
      "required": [
        "org_id",
        "visibility"
      ],
      "additionalProperties": false
    },
    "terms": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$"
        },
        "org_id": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$"
        },
        "payer_id": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$"
        },
        "payee_id": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$"
        },
        "amount_cents": {
          "type": "integer",
          "minimum": 100,
          "maximum": 5000
        },
        "currency": {
          "type": "string",
          "const": "USD"
        },
        "settlement_mode": {
          "type": "string",
          "enum": [
            "test",
            "live"
          ]
        },
        "delivery_digest": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$"
        },
        "binding": {
          "type": "object",
          "properties": {
            "repository_id": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
            },
            "base_commit": {
              "type": "string",
              "pattern": "^(?:[a-f0-9]{40}|[a-f0-9]{64})$"
            },
            "patch_hash": {
              "type": "string",
              "pattern": "^sha256:[a-f0-9]{64}$"
            },
            "profile_hash": {
              "type": "string",
              "pattern": "^sha256:[a-f0-9]{64}$"
            },
            "image_digest": {
              "type": "string",
              "pattern": "^sha256:[a-f0-9]{64}$"
            }
          },
          "required": [
            "repository_id",
            "base_commit",
            "patch_hash",
            "profile_hash",
            "image_digest"
          ],
          "additionalProperties": false
        },
        "audience": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$"
        },
        "verification_job_id": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$"
        },
        "deadline": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "dispute_rule": {
          "type": "string",
          "const": "mutual_resolution"
        }
      },
      "required": [
        "id",
        "org_id",
        "payer_id",
        "payee_id",
        "amount_cents",
        "currency",
        "settlement_mode",
        "delivery_digest",
        "binding",
        "audience",
        "verification_job_id",
        "deadline",
        "dispute_rule"
      ],
      "additionalProperties": false
    },
    "terms_hash": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    }
  },
  "required": [
    "id",
    "status",
    "funds",
    "release_authorized",
    "scope",
    "terms",
    "terms_hash",
    "created_at"
  ],
  "additionalProperties": false
}