Skip to main content
GET /books/{book_id}/analytics is the main underwriting response for bank data. It contains Book totals, monthly account rows, enriched transactions, detected debt positions, payment schedules, counterparty clusters, and screening. The response is computed when you request it. Changes to tags, exclusions, organization settings, or screening rules appear on the next call.
The complete typed contract is on the Analytics endpoint page. Keep that model beside your integration rather than recreating response fields from examples.

Fetch and validate the response

If you copied the Pydantic contracts from the endpoint reference into pathway_models.py, validate at the boundary:
Validation catches a changed or unexpected payload before it moves into a credit decision, spreadsheet, or CRM field.

Start with the Book totals

The most commonly used fields are already calculated.
Do not recompute these values from raw book_meta. The analytics response has already applied the Book’s excluded documents, accounts, positions, and revenue tags, along with organization-level business-day settings.

Gross deposits and true revenue

total_deposits includes every credit. It can contain transfers, loan proceeds, owner contributions, reversals, and operating revenue. true_revenue includes credits that survive the active revenue-exclusion rules. The exact tag set used for the request appears in revenue_exclusion_tags.

Debt-to-income ratio

Pathway returns debt_to_income_ratio as a percentage. A value of 18.4 means 18.4%. The value can be null when there is no qualifying revenue denominator.

Read statement periods

statements is chronological bank data organized by statement period. Each period contains one or more account rows.
Banks sometimes issue separate PDFs for each account in the same month. Pathway folds those files into one statement period and lists every source in document_ids. The row with account_id == 0 represents the combined cash position across included accounts for that statement period.
Use individual rows when the decision needs account-level detail. Avoid summing the combined row together with its individual account rows because that counts the same activity twice. average_statement_metrics contains the average period row used by Pathway’s tables and CSV export.

Read transactions

merged_accounts contains the normalized transaction history. It is keyed by account ID as a string.
Each transaction includes its bank description, direction, amount, running balance, cleaned tags, source document, and attached debt position when one exists.

Find true revenue credits

Find loan payments

Use the tags returned by GET /parse/tags when you need a complete dynamic tag registry. For a single response, position attachment is a clean way to isolate identified debt activity:

Group by tag

A transaction can carry several tags. Decide whether your output is multi-label before aggregating.
The totals across tags will usually exceed deposits plus withdrawals because one transaction can contribute to more than one tag.

Read debt positions

Each object in positions represents one detected relationship with a lender or funder.
status is just_funded, active, or closed. The episodes tree gives the history behind that rollup:
  • An initial episode begins the observed relationship.
  • A renewal begins after earlier schedules have closed.
  • A stack begins while an earlier schedule is still active.
  • An orphan contains payments whose advance occurred before the available statement window.
Payment schedules inside each episode include cadence, expected daily remittance, active state, inferred misses, and amount modifications.

Read counterparties

counterparty_clusters groups similar transaction descriptions separately for credits and debits.
Use transaction_ids to trace any cluster back to the underlying activity in merged_accounts.

Read screening

When organization screening is enabled, the response includes the complete fact sheet and current result.
screening_metrics contains the normalized values available to rules, including recent-month snapshots, recency measures, applicant facts, and payment-risk counts. Missing facts remain null. Screening is evaluated during the analytics request. A rule update affects the next response without reparsing the Book.

Build an integration payload

Keep the Pathway response available for audit and map only the fields the receiving system understands.
Store the Book ID with the destination record. It provides a stable path back to source documents, raw parser output, and refreshed analytics.