Skip to main content
These recipes assume you’ve read Authentication and Conventions — they cover the Bearer header, pagination shape (cursor/limitnext_cursor), money fields (integer cents), and error envelopes. Each recipe shows the same workflow in three forms: a one-line curl, a Python snippet, and a TypeScript snippet using built-in fetch with inline types. The host in every example is https://api.montereyfinancial.app. Replace mk_your_key_here with your real key.

Daily incremental sync

Pull yesterday’s new transactions into your warehouse. Anchor on the effective_at date range, paginate with cursor/limit, dedupe on transaction_id in your warehouse rather than tracking a high-water mark on the API side. Re-running the same window is safe — the API returns the same transaction IDs.
# Replace YESTERDAY with yesterday's date in UTC (e.g. 2026-05-27)
curl -H "Authorization: Bearer mk_your_key_here" \
  "https://api.montereyfinancial.app/transactions?from=YESTERDAY&to=YESTERDAY&limit=500"

# Then paginate by passing back next_cursor:
curl -H "Authorization: Bearer mk_your_key_here" \
  "https://api.montereyfinancial.app/transactions?from=YESTERDAY&to=YESTERDAY&limit=500&cursor=NEXT_CURSOR_VALUE"

Reconcile a payment to your books

This is the most concrete use of external_contract_number. Two directions: You see a payment in Monterey, want to find the matching record in your system. Fetch the account by ID, read external_contract_number, look up in your DB. You have a contract number in your system, want all Monterey transactions for it. List accounts filtered by your contract number (via list-and-filter, since there’s no ?external_contract_number= query parameter today), then list transactions per matching account.
# Direction 1: MFS payment → your contract number
# Given a transaction with account_id="01J..."
curl -H "Authorization: Bearer mk_your_key_here" \
  "https://api.montereyfinancial.app/accounts/01J..."
# → response includes external_contract_number; look that up in your DB

# Direction 2: your contract number → all MFS transactions for it
# First find the account (no direct filter; scan accounts list)
curl -H "Authorization: Bearer mk_your_key_here" \
  "https://api.montereyfinancial.app/accounts?limit=500"
# Filter locally for the account whose external_contract_number matches yours.
# Then list its transactions:
curl -H "Authorization: Bearer mk_your_key_here" \
  "https://api.montereyfinancial.app/accounts/01J.../transactions?limit=500"

Drill from organization → account → transaction

The resource-composition pattern. Useful for customer service tools and “everything about this customer” views. Three hops: pick an organization, list its accounts, then list a specific account’s transactions. For org-wide aggregates (total payments this month across all accounts), the Reports family is usually a better fit than walking the resource tree — the server-side aggregation is cheaper than fetching every row.
# 1. Get the organization (if you only have its id from a list response)
curl -H "Authorization: Bearer mk_your_key_here" \
  "https://api.montereyfinancial.app/organizations/01K..."

# 2. List all accounts in that organization
curl -H "Authorization: Bearer mk_your_key_here" \
  "https://api.montereyfinancial.app/accounts?organization_id=01K...&limit=500"

# 3. List transactions for one specific account
curl -H "Authorization: Bearer mk_your_key_here" \
  "https://api.montereyfinancial.app/accounts/01J.../transactions?limit=500"

Backfill historical data at scale

Walk a multi-year date range in monthly chunks. The pagination pattern is identical to the daily sync — just scaled up. Three operational notes:
  • Chunk by month, not year. Keeps individual jobs short enough to retry without losing too much state.
  • Save next_cursor between chunks. A multi-hour backfill that crashes shouldn’t restart from scratch — store the cursor in your job state and resume.
  • Respect the limit ceiling. The maximum limit is 1000; passing higher returns 422 (see Conventions).
# Pull one month at a time. Loop in shell or in your job runner.
for month in 2024-01 2024-02 2024-03; do
  from="${month}-01"
  to=$(date -d "${from} +1 month -1 day" +%F)
  cursor=""
  while :; do
    url="https://api.montereyfinancial.app/transactions?from=${from}&to=${to}&limit=500${cursor:+&cursor=$cursor}"
    resp=$(curl -s -H "Authorization: Bearer mk_your_key_here" "$url")
    echo "$resp" | jq -c '.rows[]' >> backfill.jsonl
    cursor=$(echo "$resp" | jq -r '.page.next_cursor // empty')
    [ -z "$cursor" ] && break
  done
done

Choosing reports vs resource endpoints

The Reporting API surface has two answer shapes — pre-shaped Reports and composable resource endpoints. They cover the same underlying data; the right choice depends on the shape of your question.
Your questionUse
”Give me all NSF returns in March.”GET /reports/nsfr
”What payments came in yesterday?”GET /reports/crr or GET /transactions
”What’s account 01J… worth right now?”GET /accounts/{id}
”Who is the primary borrower on account 01J…?”GET /accounts/{id} (includes primary_borrower_party_id)
“Show every transaction for borrower 01K….”GET /persons/{id}/accounts → fan out to /accounts/{id}/transactions
”All write-offs this quarter, grouped by organization.”GET /reports/wor (already returns organization_id per row)
“Recent activity on this one account.”GET /accounts/{id}/transactions
”Reconcile all your contracts against MFS this month.”GET /reports/crr (filter locally by external_contract_number)
Heuristics:
  • If the question is a row-shaped business answer (“payments”, “returns”, “balances”), there’s probably a report for it.
  • If the question is about a specific entity (“this account”, “this person”), use the resource endpoints.
  • If the question is “everything about X”, drill from the resource endpoint.
  • When in doubt, reports are less code — they pre-filter on the server, so you write less pagination code on your side.