{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agent-accord.org/schemas/agent-accord-receipt/v1-draft/schema.json",
  "title": "Agent Accord Receipt",
  "description": "Draft-only schema for a bilateral acceptance record. Receipt transport, custody, and transparency anchoring remain open questions in v1-draft.",
  "type": "object",
  "required": [
    "version",
    "status",
    "draft_label",
    "receipt_id",
    "template",
    "origin",
    "counterparty",
    "accepted_terms",
    "issued_at"
  ],
  "properties": {
    "version": {
      "type": "string"
    },
    "status": {
      "const": "draft"
    },
    "draft_label": {
      "const": "v1-draft"
    },
    "receipt_id": {
      "type": "string"
    },
    "template": {
      "type": "string",
      "format": "uri"
    },
    "origin": {
      "type": "object",
      "required": ["domain"],
      "properties": {
        "domain": {
          "type": "string"
        },
        "signing_method": {
          "type": "string"
        },
        "signature": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "counterparty": {
      "type": "object",
      "required": ["identity_method"],
      "properties": {
        "identity_method": {
          "type": "string"
        },
        "identifier": {
          "type": "string"
        },
        "signature_agent": {
          "type": "string",
          "format": "uri"
        }
      },
      "additionalProperties": true
    },
    "accepted_terms": {
      "type": "object",
      "properties": {
        "purposes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "expiry": {
          "type": "string",
          "format": "date-time"
        },
        "rate_expectation": {
          "type": "string"
        },
        "attribution_mode": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "transparency": {
      "type": "object",
      "properties": {
        "hash": {
          "type": "string"
        },
        "log_uri": {
          "type": "string",
          "format": "uri"
        },
        "status": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "issued_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": true
}
