{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rumoro-dev/json-schema/rumoro-dev-ledger-list-schema.json",
  "title": "LedgerList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rumoro-dev-billing-api-openapi.yml#/components/schemas/LedgerList",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ledger entry's id (led_...)."
          },
          "kind": {
            "type": "string",
            "enum": [
              "signup_credit",
              "topup",
              "refund",
              "debit_keyword_days",
              "debit_mentions",
              "debit_comments",
              "adjustment"
            ],
            "description": "Type of ledger entry."
          },
          "amountCents": {
            "type": "integer",
            "description": "Whole US cents. Credits are positive and debits negative."
          },
          "day": {
            "type": [
              "string",
              "null"
            ],
            "description": "For debits, the last UTC day this entry settles (YYYY-MM-DD)."
          },
          "units": {
            "type": [
              "integer",
              "null"
            ],
            "description": "For debits, the running total of mentions or keyword-days settled up to and including this entry."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Note attached to a credit or adjustment."
          },
          "polarOrderId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Polar order of a top-up or refund. Null otherwise."
          },
          "createdAt": {
            "type": "string",
            "description": "UTC time in ISO 8601."
          }
        },
        "required": [
          "id",
          "kind",
          "amountCents",
          "day",
          "units",
          "note",
          "polarOrderId",
          "createdAt"
        ]
      },
      "description": "Ledger entries, latest first."
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Cursor for the next page, or null when there are no more pages."
    }
  },
  "required": [
    "data",
    "nextCursor"
  ]
}