{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/teliax/json-schema/teliax-github-com-ringer-warp-api-gateway-internal-models-ledger-statement-schema.json",
  "title": "github_com_ringer-warp_api-gateway_internal_models.LedgerStatement",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/teliax-customer-billing-api-openapi.yml#/components/schemas/github_com_ringer-warp_api-gateway_internal_models.LedgerStatement",
  "type": "object",
  "properties": {
    "charge_total": {
      "description": "ChargeTotal is the sum of negative lines only, which is the denominator\nthe composition bar proportions against. Summing signed amounts would let\na payment shrink the bar and misstate every share.",
      "type": "number"
    },
    "from": {
      "type": "string"
    },
    "lines": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/github_com_ringer-warp_api-gateway_internal_models.LedgerSKUSummary"
      }
    },
    "net_amount": {
      "description": "NetAmount is the signed sum of every line — the period's balance movement.",
      "type": "number"
    },
    "to": {
      "type": "string"
    }
  },
  "$defs": {
    "github_com_ringer-warp_api-gateway_internal_models.LedgerSKUSummary": {
      "type": "object",
      "properties": {
        "amount": {
          "description": "Amount is signed, matching ledger convention: negative = charge.",
          "type": "number"
        },
        "events": {
          "description": "Events is the number of ledger rows behind this line.",
          "type": "integer"
        },
        "is_usage": {
          "description": "IsUsage distinguishes a rated SKU from money-in, so the UI can present\ncharges and credits differently without string-matching the label.",
          "type": "boolean"
        },
        "quantity": {
          "description": "Quantity/Unit are populated for usage-based lines; null for money-in\nrows (payments, credits, adjustments).",
          "type": "number"
        },
        "sku_code": {
          "description": "SKUCode is the billing SKU, or the txn_type for money-in rows.",
          "type": "string"
        },
        "unit": {
          "type": "string"
        }
      }
    }
  }
}