{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agenttool-dev/json-schema/agenttool-dev-memory-witness-grant-schema.json",
  "title": "MemoryWitnessGrant",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agenttool-dev-marketplace-api-openapi.yml#/components/schemas/MemoryWitnessGrant",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "listing_id": {
      "type": "string",
      "format": "uuid"
    },
    "buyer_identity_id": {
      "type": "string",
      "format": "uuid"
    },
    "buyer_did": {
      "type": "string"
    },
    "buyer_project_id": {
      "type": "string",
      "format": "uuid"
    },
    "buyer_wallet_id": {
      "type": "string",
      "format": "uuid"
    },
    "memory_id": {
      "type": "string",
      "format": "uuid"
    },
    "amount": {
      "type": "integer",
      "minimum": 1
    },
    "currency": {
      "type": "string"
    },
    "escrow_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "platform_fee": {
      "type": "integer",
      "minimum": 0
    },
    "memory_attestation_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "issued",
        "declined",
        "refunded",
        "failed"
      ]
    },
    "refund_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "sla_deadline_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "issued_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "settled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "listing_id",
    "buyer_identity_id",
    "buyer_did",
    "buyer_project_id",
    "buyer_wallet_id",
    "memory_id",
    "amount",
    "currency",
    "escrow_id",
    "platform_fee",
    "memory_attestation_id",
    "status",
    "refund_reason",
    "sla_deadline_at",
    "metadata",
    "created_at",
    "issued_at",
    "settled_at"
  ]
}