---
title: "Ledger row counts for a filter"
method: GET
path: "/credits/ledger/summary"
tags: ["Ledger"]
---

# Ledger row counts for a filter

`GET /credits/ledger/summary`

## Request

- Base URL: `https://api.paywithlocus.com/api`
- URL: `https://api.paywithlocus.com/api/credits/ledger/summary`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Counts the rows GET /credits/ledger would page through under the same filters. Cursor pagination can report neither a total nor a per-category split, which the Activity pager and its type chips need.

## Query parameters

- `category` 'TOPUP' | 'BURN' | 'REFUND' | 'CLAWBACK' | 'FEE' | 'ADJUSTMENT' | 'ALLOCATION' | 'PROMO'
- `externalUserId` string: Case-sensitive immutable ID in the tenant namespace. Prefer an identity-provider subject, not an email address.
- `initiator` string
- `provider` string
- `endpoint` string
- `createdAfter` string, date-time
- `createdBefore` string, date-time
- `attribution.{key}` string
- `sourceKey` string
- `account` 'platform'

## Response `200`

Total row count, plus per-category counts and amounts

- TenantLedgerSummary
  - `success` true, required
  - `total` integer, required
  - `byCategory` object, required: Counts keyed by ledger category; categories with no rows are absent.
  - `amountUsdcByCategory` object, required: Unsigned USDC magnitude keyed by ledger category, over the same rows (direction carries the sign). Analytics covers BURN rows only, so a refund total for the same filters comes from here.
  - `appliedFilters` string[], required: Names of the narrowing query filters this server applied. An empty array means the request did not include a narrowing filter.

---

[API](https://skmtc.dev/paywithlocus/apis/locus-pro-api.md) - [All operations](https://skmtc.dev/paywithlocus/apis/locus-pro-api/llms.txt) - [OpenAPI document](https://skmtc.dev/paywithlocus/apis/locus-pro-api/revisions/aab8fa5d6cef?raw)
