Prosp · Schema

CreditLedger

A customer's credit-transaction history (`GET /mcp/credits/ledger`). Every transaction row carries a signed `amount`, so `sum(transactions[].amount)` reconciles the credit movement against `balance`.

CompanyB2BSalesOutreachMarket Research

Properties

Name Type Description
customer_id string The authenticated customer these transactions belong to.
balance integer Current credit balance.
count integer Number of transactions in THIS page (never exceeds the requested `limit`).
total integer Total reconstructable transactions in the window (across all pages). When `history_incomplete` is true this is a lower bound — older, marker-expired history is not counted.
offset integer The starting index this page was served from (echoes the request `offset`, clamped to `total`).
has_more boolean True when this page left transactions unreturned — fetch the next page with `offset += count`.
window_start string RFC-3339 UTC start of the reconstructable window (`now − marker TTL`, ≈7 days). Transactions older than this have expired markers and cannot be reconstructed.
truncated boolean PURE this-page hard-cap signal: true only when an item/byte cap dropped rows from THIS page. The ledger paginates on `offset`/`limit` with no per-page item/byte cap (`has_more` covers the tail), so `t
history_incomplete boolean Data-COMPLETENESS signal (distinct from `truncated`): true when older account history exists that the bounded markers can no longer reconstruct — set in exactly two cases: (1) the customer has more jo
transactions array Credit transactions, newest first.
View JSON Schema on GitHub

JSON Schema

prosp-cc-credit-ledger-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prosp-cc/json-schema/prosp-cc-credit-ledger-schema.json",
  "title": "CreditLedger",
  "description": "A customer's credit-transaction history (`GET /mcp/credits/ledger`). Every transaction row carries a signed `amount`, so `sum(transactions[].amount)` reconciles the credit movement against `balance`.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prosp-cc-openapi.yaml#/components/schemas/CreditLedger",
  "type": "object",
  "required": [
    "customer_id",
    "balance",
    "transactions",
    "count",
    "total",
    "offset",
    "has_more",
    "window_start",
    "truncated",
    "history_incomplete"
  ],
  "properties": {
    "customer_id": {
      "type": "string",
      "description": "The authenticated customer these transactions belong to."
    },
    "balance": {
      "type": "integer",
      "description": "Current credit balance."
    },
    "count": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of transactions in THIS page (never exceeds the requested `limit`)."
    },
    "total": {
      "type": "integer",
      "minimum": 0,
      "description": "Total reconstructable transactions in the window (across all pages). When `history_incomplete` is true this is a lower bound — older, marker-expired history is not counted."
    },
    "offset": {
      "type": "integer",
      "minimum": 0,
      "description": "The starting index this page was served from (echoes the request `offset`, clamped to `total`)."
    },
    "has_more": {
      "type": "boolean",
      "description": "True when this page left transactions unreturned — fetch the next page with `offset += count`."
    },
    "window_start": {
      "type": "string",
      "format": "date-time",
      "description": "RFC-3339 UTC start of the reconstructable window (`now − marker TTL`, ≈7 days). Transactions older than this have expired markers and cannot be reconstructed."
    },
    "truncated": {
      "type": "boolean",
      "description": "PURE this-page hard-cap signal: true only when an item/byte cap dropped rows from THIS page. The ledger paginates on `offset`/`limit` with no per-page item/byte cap (`has_more` covers the tail), so `truncated` is always `false` here. Retained for a uniform pagination envelope across list surfaces. The \"older history exists\" signal is the DISTINCT `history_incomplete` field below — do NOT read `truncated` for data completeness."
    },
    "history_incomplete": {
      "type": "boolean",
      "description": "Data-COMPLETENESS signal (distinct from `truncated`): true when older account history exists that the bounded markers can no longer reconstruct — set in exactly two cases: (1) the customer has more jobs than a single read enumerates (only the newest are scanned), or (2) a job's paired debit/refund fell outside the reconstructable window so one half-pair row was suppressed. When true, the visible rows are still internally consistent but do NOT span the customer's whole account history. A COMPLETE page (`has_more=false`, `count == total`) can still be `history_incomplete=true` — the two flags are orthogonal."
    },
    "transactions": {
      "type": "array",
      "description": "Credit transactions, newest first.",
      "items": {
        "$ref": "#/$defs/LedgerTransaction"
      }
    }
  },
  "$defs": {
    "LedgerTransaction": {
      "type": "object",
      "description": "One credit-ledger row. EVERY row carries a signed `amount` (credits) — negative for a debit, positive for a refund/grant — so a client can sum the column to reconcile against `balance`. Carries NO internal provenance flags: this is a customer-facing billing surface.",
      "required": [
        "type",
        "amount",
        "reason",
        "timestamp"
      ],
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "debit",
            "refund",
            "adjustment"
          ],
          "description": "`debit` = a discovery-job charge; `refund` = credits returned for a terminated/refunded job; `adjustment` = a manual balance change."
        },
        "job_id": {
          "type": "string",
          "description": "The discovery job this row belongs to. Absent on manual adjustments."
        },
        "icp_id": {
          "type": "string",
          "description": "The saved ICP this charge is attributable to — the `icpId` the run was started with via `POST /api/v1/discoveries {\"icpId\": ...}`. Lets a customer running several saved ICPs reconcile a charge back to the ICP that caused it. Carried on both the `debit` row and its paired `refund` row, so an attribution survives the two landing on different pages. ABSENT (field omitted, never an empty string) for an ad-hoc run started from inline criteria, and on `adjustment` rows, which have no job. Ids are scoped to the calling customer — the same namespace `GET /api/v1/icps` returns."
        },
        "amount": {
          "type": "integer",
          "description": "Signed credit movement — negative for a debit, positive for a refund/grant."
        },
        "reason": {
          "type": "string",
          "description": "Bounded reason for the movement (e.g. `discovery_job`, `candidates_exhausted`, `time_limit_reached`, `manual_reconciliation`)."
        },
        "balance_after": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Best-effort: the TRUE balance immediately after this event, present ONLY when a durable post-event snapshot was recorded at the source (`jobs:charged-balance:{jobId}`, written by the gateway debit script). OMITTED (field absent) on rows with no snapshot — historical debits that predate the snapshot feature, and reconstructed/inferred refunds — because a running balance is NOT reliably reconstructable after the fact (concurrent jobs and top-ups make back-derivation unsound). Never fabricated: a null/absent value means \"unknown\", not zero. Reconcile via the signed `amount` column, which every row carries."
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "RFC-3339 UTC timestamp (…Z) of the transaction."
        },
        "adjustment_id": {
          "type": "string",
          "description": "Audit id of a manual adjustment (adjustment rows only)."
        },
        "actor": {
          "type": "string",
          "description": "Who performed a manual adjustment (adjustment rows only)."
        }
      }
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/prosp-cc-credit-ledger"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.