{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/medianfi-com/json-schema/medianfi-com-books-overview-schema.json",
  "title": "BooksOverview",
  "description": "Headline financial overview for the Books hub: balances as of today, revenue and expenses for the last completed calendar month. All monetary amounts are integers in **cents**.\nAsset segments are total assets by class (cash, what clients owe you, prepaid costs, inventory, equipment after depreciation, other), from posted entity-scoped report values; the service never derives an asset from a payable balance.\n",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/medianfi-com-openapi.json#/components/schemas/BooksOverview",
  "type": "object",
  "required": [
    "companyId",
    "entityId",
    "asOf",
    "lastFullMonthLabel",
    "netLastMonthCents",
    "assets",
    "liabilities",
    "revenue",
    "expenses"
  ],
  "properties": {
    "companyId": {
      "type": "string",
      "format": "uuid",
      "description": "Authenticated company whose Books data was read."
    },
    "entityId": {
      "type": "string",
      "format": "uuid",
      "description": "Authorized concrete legal entity whose Books data was read."
    },
    "asOf": {
      "type": "string",
      "format": "date",
      "description": "Today (UTC). Balances include every posting through the current month."
    },
    "lastFullMonthLabel": {
      "type": "string",
      "description": "Human-readable label for the last completed calendar month (e.g. \"May 2026\")."
    },
    "netLastMonthCents": {
      "type": "integer",
      "description": "Net income for the last completed month in cents (full P&L revenue − expenses)."
    },
    "assets": {
      "type": "object",
      "required": [
        "netBookValueCents",
        "segments"
      ],
      "properties": {
        "totalAssetsCents": {
          "type": "integer",
          "description": "Total balance-sheet assets as of today, in cents (the hub's Assets value)."
        },
        "netBookValueCents": {
          "type": "integer",
          "description": "Fixed-asset net book value (cost − accumulated depreciation) as of today, in cents. Ties out to the Assets page headline and the balance-sheet fixed-asset section, NOT to total balance-sheet assets.\n"
        },
        "segments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BooksOverviewSegment"
          }
        }
      }
    },
    "liabilities": {
      "type": "object",
      "required": [
        "totalCents",
        "segments"
      ],
      "properties": {
        "totalCents": {
          "type": "integer",
          "description": "Total liabilities as of today, in cents."
        },
        "equityCents": {
          "type": "integer",
          "description": "Balance-sheet equity as of today, including earnings not yet closed (#1994). The liabilities segments end with an \"Equity\" segment when it is positive."
        },
        "segments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BooksOverviewSegment"
          }
        }
      }
    },
    "revenue": {
      "type": "object",
      "required": [
        "recognizedLastMonthCents",
        "deferredCarryingCents",
        "sparkSeries"
      ],
      "properties": {
        "recognizedLastMonthCents": {
          "type": "integer",
          "description": "Operating revenue recognized in the last completed month, in cents (other income and 4999 Uncategorized Income excluded)."
        },
        "deferredCarryingCents": {
          "type": "integer",
          "description": "Outstanding deferred-revenue liability carrying balance as of today, in cents (unearned revenue still to be recognized).\n"
        },
        "sparkSeries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BooksOverviewSparkPoint"
          }
        }
      }
    },
    "expenses": {
      "type": "object",
      "required": [
        "recognizedLastMonthCents",
        "topCategoryCents",
        "sparkSeries"
      ],
      "properties": {
        "recognizedLastMonthCents": {
          "type": "integer",
          "description": "Total expenses in the last closed month, in cents."
        },
        "topCategoryCents": {
          "type": "integer",
          "description": "Largest single expense category recognized in the last completed month, in cents.\n"
        },
        "largestAccount": {
          "type": [
            "object",
            "null"
          ],
          "description": "The single expense account with the largest amount in the last completed month.",
          "required": [
            "name",
            "amountCents"
          ],
          "properties": {
            "name": {
              "type": "string"
            },
            "amountCents": {
              "type": "integer"
            }
          }
        },
        "sparkSeries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BooksOverviewSparkPoint"
          }
        }
      }
    }
  },
  "$defs": {
    "BooksOverviewSegment": {
      "type": "object",
      "description": "A single line-item segment inside an assets or liabilities breakdown. `amountCents` is always a non-negative integer.\n",
      "required": [
        "label",
        "amountCents"
      ],
      "properties": {
        "label": {
          "type": "string"
        },
        "amountCents": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "BooksOverviewSparkPoint": {
      "type": "object",
      "description": "One month's P&L data for the spark-line chart.",
      "required": [
        "month",
        "revenueCents",
        "expensesCents",
        "netCents"
      ],
      "properties": {
        "month": {
          "type": "string",
          "description": "YYYY-MM-DD (first of month)"
        },
        "revenueCents": {
          "type": "integer"
        },
        "expensesCents": {
          "type": "integer"
        },
        "netCents": {
          "type": "integer"
        }
      }
    }
  }
}