{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/infinihash-com/json-schema/infinihash-com-batch-eod-result-schema.json",
  "title": "BatchEodResult",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kyc-api-infinihash-openapi.json#/components/schemas/BatchEodResult",
  "type": "object",
  "required": [
    "ok",
    "business_date",
    "format",
    "received",
    "accepted",
    "rejected",
    "obligations_satisfied",
    "decisions_checked",
    "missing_from_file",
    "missing_count",
    "balanced"
  ],
  "properties": {
    "ok": {
      "type": "boolean",
      "enum": [
        true
      ]
    },
    "business_date": {
      "type": [
        "string",
        "null"
      ]
    },
    "format": {
      "type": "string",
      "enum": [
        "json",
        "csv"
      ]
    },
    "received": {
      "type": "integer"
    },
    "accepted": {
      "type": "integer"
    },
    "rejected": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "row",
          "transaction_ref",
          "errors"
        ],
        "properties": {
          "row": {
            "type": [
              "integer",
              "null"
            ],
            "description": "1-based row number; null for file-level errors such as a failed obligation discharge."
          },
          "transaction_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "obligations_satisfied": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "obligation_id": {
            "type": "string"
          },
          "card_ref": {
            "type": "string"
          },
          "transaction_ref": {
            "type": "string"
          },
          "was": {
            "type": "string",
            "description": "Prior status: open or lapsed."
          }
        }
      }
    },
    "decisions_checked": {
      "type": "integer",
      "description": "POS policy decisions on the business date that were compared with the file."
    },
    "missing_from_file": {
      "type": "array",
      "description": "POS decisions we recorded that have no matching row in the file (first 500).",
      "items": {
        "type": "object",
        "properties": {
          "decision_id": {
            "type": "string"
          },
          "transaction_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "card_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "outcome": {
            "type": "string"
          },
          "reason_code": {
            "type": "string"
          },
          "decided_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "missing_count": {
      "type": "integer",
      "description": "Total number of missing decisions (may exceed the 500 listed)."
    },
    "balanced": {
      "type": "boolean",
      "description": "true when nothing was rejected and nothing is missing."
    }
  }
}