v1

latestOpenAPI 3.0.02026-07-2482421001.1 KB
Cash Flow Analytics

Book summary

This API retrieves the Cash Flow Analytics summary of a Book in JSON format. It provides daily balances, bank account PII, and time series for all transaction categories at the <glossary:Book> and bank account level.

It offers quicker analytics generation, more granular and accurate transaction categories (including improved revenue and expense calculations), and a more concise structure.


Async processing

This API supports asynchronous processing. To get the asynchronous result, add async=true in the query parameter to run the request as a background job and receive a job_id immediately instead of waiting for the full response inline. When async=true, the endpoint returns 202 Accepted with a job_id instead of the analytics payload.

Async mode is required for Books with more than 100,000 transactions. Books exceeding 1,000,000 transactions are rejected with 422 (error code 1100). Once submitted, poll Async job status API to retrieve the result when the job is complete.

get/v2/book/{book_uuid}/summary

Path parameters

book_uuidstring uuid required

The unique identifier of the <glossary:Book> that contains the bank statements you'd like to have analyzed.

Query parameters

exclude_bank_account_pksstring

Bank account primary key(s) to exclude from analytics calculations in the book summary. The underlying data remains in the system and is not deleted.

📘 This parameter is in beta. If you encounter any bug, please reach out to support@ocrolus.com.

exclude_monthsstring

Months (in YYYY-MM format) of transaction to exclude from analytics calculations in the book summary. The underlying data remains in the system and is not deleted.

📘 This parameter is in beta. If you encounter any bug, please reach out to support@ocrolus.com.

asyncboolean

When true, runs the request as a background job and returns a job_id immediately instead of the analytics payload. Required for Books with more than 100,000 transactions. Books exceeding 1,000,000 transactions are rejected with 422 (error code 1100).

Response

Success

book_pkinteger

A unique numerical identifier for a <glossary:Book>, commonly referred to as the Book primary key (Book pk).

book_namestring

The name of the Book used for the analytics calculation.

txn_countinteger

The number of transactions considered for analytics calculation.

naics4_codeinteger

A 4-digit North American Industry Classification System (NAICS) code that represents the industry of the Book.

naics_descriptionstring

The description of the 4-digit NAICS code, indicating the industry classification of the Book category.

📘 In Books with multiple businesses or fragmented merchant activity, the widget may show the following statuses as applicable:

  • Pending - Industry Data: Classification is in progress.
  • Unable to find a unique SMB merchant: The system is not able to find a unique merchant mapped to the documents in the Book.
  • Not Available: The system has found a unique merchant, but this merchant does not have industry classification data.
naics6_codeinteger

A six-digit NAICS code that provides a more granular industry classification for the merchant. This code refines the broader NAICS category and is commonly used for detailed industry analysis, peer comparisons, and benchmarking.

naics6_descriptionstring

A human-readable description of the six-digit NAICS code that specifies the merchant’s exact industry segment within the broader NAICS classification.

naics_overrideboolean

Shows if the 4-digit NAICSA code was overriden by the lender.

mcc_codeinteger

A four-digit code assigned by payment networks that classifies a merchant based on the primary type of goods or services they provide. Merchant Category Code (MCC) are commonly derived from card transaction data and are used for transaction categorization, risk assessment, and analytics.

mcc_description_string

A human-readable description of the MCC that explains the merchant’s primary business activity as defined by the card network.

sic_codeinteger

A four-digit Standard Industrial Classification (SIC) code that identifies the merchant’s primary business activity using the legacy SIC system. SIC codes are derived from bank statement data and are used for industry classification, regulatory reporting, and analytics.

sic_description_string

A human-readable description of the SIC code that explains the merchant’s primary industry classification under the SIC system.

book_mismatch_severitystring

The severity of mismatches detected in the Book, such as discrepancies between uploaded documents and extracted data. Possible values include Low, Medium, and High.

📘 This attribute is in beta. If you encounter any bug, please reach out to support@ocrolus.com.

average_daily_cash_flownumber

The average value in daily_cash_flows.

average_daily_balancenumber

The average amount in daily_balances.

average_daily_balance_weekdaynumber

The average daily balance on weekdays

total_daysnumber

Total number of days for which analytics is calculated.

cash_balance_trend_30dnumber

Daily cash balance trend of 30 days. The calculation formula is ((Mean cash balance over first 15 days ) - (Mean cash balance over last 15 days) ) / standard deviation of cash balance over the period.

cash_balance_trend_60dnumber

Daily cash balance trend of 60 days. The calculation formula is ((Mean cash balance over first 30 days ) - (Mean cash balance over last 30 days) ) / standard deviation of cash balance over the period.

cash_balance_trend_90dnumber

Daily cash balance trend of 90 days. The calculation formula is ((Mean cash balance over first 45 days ) - (Mean cash balance over last 45 days) ) / standard deviation of cash balance over the period.

cash_flow_trend_30dnumber

Daily cash flow trend of 30 days. The calculation formula is ((Mean cash flow over first 15 days ) - (Mean cash flow over last 15 days) ) / standard deviation of cash flow over the period.

cash_flow_trend_60dnumber

Daily cash flow trend of 60 days. The calculation formula is ((Mean cash flow over first 30 days ) - (Mean cash flow over last 30 days) ) / standard deviation of cash flow over the period.

cash_flow_trend_90dnumber

Daily cash flow trend of 90 days. The calculation formula is ((Mean cash flow over first 45 days ) - (Mean cash flow over last 45 days) ) / standard deviation of cash flow over the period.

average_txn_size_by_monthobject

The average transaction size grouped by month.

average_deposits_by_monthobject

The average number of deposits size grouped by month.

nsf_divisornumber

Calculated amount for a single NSF fee.\nThe common divisor is defined as "the least common multiple (in 0.50 increments) of amount values corresponding to transactions with nsf = True".\nThis multiple must fall between 25 and 60 (inclusive) otherwise nsf_divisor = None and no scaling occurs.

overdraft_divisornumber

Calculated amount for a single overdraft fee.\nThe common divisor is defined as "the least common multiple (in 0.50 increments) of amount values corresponding to transactions with overdraft = True".\nThis multiple must fall between 25 and 60 (inclusive) otherwise overdraft = None and no scaling occurs.

num_fintech_loan_sourcesinteger

Number of unique fintech_loan_sources.

num_fintech_mca_sourcesinteger

Number of unique fintech_mca_sources.

number_of_docs_in_bookinteger

The total count of <glossary:Document>s uploaded to this <glossary:Book>.

number_of_docs_processedinteger

The total count of <glossary:Document>s in this <glossary:Book> that completed verification.

book_uuidinteger

A unique numerical identifier for a <glossary:Book>, commonly referred to as the Book UUID.

Example response

{
  "book_pk": 18843681,
  "book_name": "Jill's Coffee  (v.3)",
  "txn_count": 324,
  "naics4_code": 7225,
  "naics_description": "Restaurants and Other Eating Places",
  "naics6_code": 7225,
  "naics6_description": "Snack and Nonalcoholic Beverage Bars",
  "naics_override": true,
  "mcc_code": 7225,
  "mcc_description_": "Snack and Nonalcoholic Beverage Bars",
  "sic_code": 172,
  "sic_description_": "GRAPES",
  "loan_inquiries": {
    "smb_entity_name": "ABC Corp",
    "total_applications": 3,
    "application_history": [
      {
        "created_ts": "2025-10-10T12:00:00Z"
      }
    ],
    "velocity": {
      "30_day_count": 2,
      "60_day_count": 2,
      "90_day_count": 3,
      "180_day_count": 3,
      "270_day_count": 3,
      "365_day_count": 3
    }
  },
  "book_mismatch_severity": "high",
  "bank_accounts": [
    {
      "txn_count": 244
    }
  ]
}