Totals over the loan files GET /api/v4/loans lists for the same
filters: counts and money figures added up by the server, optionally
grouped. Use it to answer "how much" and "how many" in one request
instead of reading every file.
The same files as the list. Every GET /api/v4/loans filter is
accepted here with the same name and meaning, and is applied by the
same code, so data.totals.files equals the list's
meta.pagination.total for the same filters when no date window
beyond the list's own is sent. There is no paging:
page and perPage are refused. Archived files are left out unless
archiveState or includeArchived says otherwise. When your access
is limited to your branches (see GET /api/v4/loans), every total
covers those branches only, exactly as the list does.
Unknown parameters are reported, not refused (D27, during its
deprecation window): the request answers 200, the parameter is
ignored, and it is named in meta.warnings as
{code: UNKNOWN_PARAMETER, parameter}. ⚠️ So check meta.warnings: a
misspelt filter means the totals are NOT filtered by it. An invalid
value of a known parameter is still a 422.
Date windows. Each date has its own From/To pair, both
inclusive and either usable alone: loanClosingFrom/loanClosingTo,
loanRequestedCloseFrom/loanRequestedCloseTo,
loanMaturityFrom/loanMaturityTo. The created date uses the list's
own createdFrom/createdTo; loanClosingFrom/loanClosingTo are
the list's own too. Several windows narrow together. A file with no
requested-close or maturity date is outside those windows.
⚠️ loanClosingFrom/loanClosingTo keep the list's rules exactly:
loanClosingTo sent alone still counts a file whose closing date is
stored as 0000-00-00. A backwards pair — To before From — is a
422 naming the To key on EVERY window here, the list's and this
route's own alike. (Until API 4.1 the list's pairs answered an empty
result instead.)
Grouping. groupBy takes one or two dimensions. Each group's
files add up to totals.files. Property state and type are the
file's primary property, so a file with several properties is counted
once. Grouped by status, every file falls in exactly one
statusBucket: listed, no-status-recorded, or
not-in-company-list (its status id is not one of this company's).
Grouped by status alone, the last two always appear, even at 0.
Reading a figure. Money is an exact decimal string to the cent.
Every money figure carries includedFiles and excludedFiles: files
left out because the figure is not recorded on them. For
cashNeededAtClosing, totalCommitment, unfundedCommitment and
averageLoanAmount that is a file missing either the base or the total
loan amount: the four share one set and one count. A stored 0 counts
as not recorded, the way GET /api/v4/loans/{id} returns it as null.
Amounts are the loan's stored calculated figures — the same ones the
loan read returns. They are not recalculated live: a save marks them
for recalculation, and a file never calculated has none and is
excluded.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||

