{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/flint-network/json-schema/flint-network-scout-credits-balance-response-schema.json",
  "title": "ScoutCreditsBalanceResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/flint-network-scout-credits-api-openapi.yml#/components/schemas/ScoutCreditsBalanceResponse",
  "type": "object",
  "required": [
    "ok",
    "balance",
    "purchased_total",
    "used_total",
    "ledger"
  ],
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "balance": {
      "type": "integer",
      "minimum": 0
    },
    "purchased_total": {
      "type": "integer",
      "minimum": 0
    },
    "used_total": {
      "type": "integer",
      "minimum": 0
    },
    "ledger": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ScoutCreditLedgerEntry"
      }
    }
  },
  "$defs": {
    "ScoutCreditLedgerEntry": {
      "type": "object",
      "required": [
        "at",
        "kind",
        "amount"
      ],
      "properties": {
        "at": {
          "type": "string",
          "format": "date-time"
        },
        "kind": {
          "type": "string",
          "enum": [
            "topup",
            "debit",
            "refund"
          ]
        },
        "amount": {
          "type": "integer"
        },
        "receipt_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "record_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}