{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/norekey/main/json-schema/norekey-conversion-schema.json",
  "title": "Conversion",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/norekey-api-openapi.json#/components/schemas/Conversion",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "ULID identifying the conversion."
    },
    "statement": {
      "type": "string",
      "description": "Original filename of the uploaded PDF."
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "processing",
        "completed",
        "failed",
        "expired"
      ]
    },
    "pages": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Page count of the statement."
    },
    "scanned": {
      "type": "boolean",
      "description": "Whether the statement was detected as scanned and converted through OCR."
    },
    "pages_charged": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Pages drawn from the monthly allowance — the page count, scanned or not."
    },
    "expected_seconds": {
      "type": "integer",
      "description": "Live estimate of total processing time for a statement of this size, in seconds."
    },
    "bank": {
      "type": [
        "string",
        "null"
      ],
      "description": "Bank or issuer detected from the statement, once completed."
    },
    "currency": {
      "type": [
        "string",
        "null"
      ],
      "description": "Currency detected from the statement, once completed."
    },
    "balanced": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Whether the extracted transactions reconciled against the statement's own opening and closing balances. False means the conversion is flagged for review — inspect before trusting."
    },
    "opening_balance": {
      "type": [
        "number",
        "string",
        "null"
      ],
      "description": "The statement's declared opening balance."
    },
    "closing_balance": {
      "type": [
        "number",
        "string",
        "null"
      ],
      "description": "The statement's declared closing balance."
    },
    "error": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable failure reason when status is failed."
    },
    "formats": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Export formats available from the export endpoint."
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  }
}