Transactions

Transactions are individual line items extracted from bank statements during document processing. Each transaction includes the date, description, amount, running balance, and classification metadata. The screening engine automatically flags transactions that match risk patterns such as large unusual deposits, NSF fees, overdraft fees, and recurring MCA repayments.

Transactions can be listed per document or aggregated across all documents in a deal. Underwriters can correct transaction data (e.g., recategorize a deposit as non-revenue), and all corrections are tracked in an audit trail.

Listing Transactions

Retrieve a paginated list of transactions extracted from a single document. Supports filtering by transaction type, flagged status, and date range.

Path Parameters

NameTypeRequiredDescription
document_idintegerRequiredThe unique document ID

Query Parameters

NameTypeRequiredDescription
pageintegerDefault: 1Page number (1-indexed)
per_pageintegerDefault: 50Results per page (max 200)
transaction_typestringOptionalFilter by type: credit or debit
flaggedbooleanOptionalWhen true, returns only flagged/screened transactions
date_fromstringOptionalStart date filter (YYYY-MM-DD, inclusive)
date_tostringOptionalEnd date filter (YYYY-MM-DD, inclusive)

Example

curl
curl -X GET "https://api.banklyze.com/v1/documents/15/transactions?page=1&per_page=50&transaction_type=credit" \
  -H "X-API-Key: your_api_key_here"

Response

Response — 200 OK
{
  "data": [
    {
      "id": 201,
      "date": "2026-01-03",
      "description": "ACH DEPOSIT - STRIPE PAYMENTS",
      "amount": 4250.00,
      "balance": 32750.00,
      "transaction_type": "credit",
      "is_nsf_fee": false,
      "is_overdraft_fee": false,
      "screening_bucket": null,
      "flag_reason": null,
      "category": "revenue",
      "document_id": 15
    },
    {
      "id": 205,
      "date": "2026-01-07",
      "description": "WIRE TRANSFER IN - FLEET SERVICES CO",
      "amount": 18500.00,
      "balance": 47200.00,
      "transaction_type": "credit",
      "is_nsf_fee": false,
      "is_overdraft_fee": false,
      "screening_bucket": "large_unusual_deposit",
      "flag_reason": "Deposit exceeds 3x average daily deposit",
      "category": "revenue",
      "document_id": 15
    },
    {
      "id": 210,
      "date": "2026-01-10",
      "description": "ACH DEPOSIT - STRIPE PAYMENTS",
      "amount": 3180.00,
      "balance": 38900.00,
      "transaction_type": "credit",
      "is_nsf_fee": false,
      "is_overdraft_fee": false,
      "screening_bucket": null,
      "flag_reason": null,
      "category": "revenue",
      "document_id": 15
    }
  ],
  "meta": {
    "page": 1,
    "per_page": 50,
    "total": 34,
    "total_pages": 1
  }
}

Retrieve a paginated list of all transactions across every document attached to a deal. This aggregated view is useful for deal-level analysis and exporting. Supports the same filtering parameters as the per-document endpoint.

Path Parameters

NameTypeRequiredDescription
deal_idintegerRequiredThe unique deal ID

Query Parameters

NameTypeRequiredDescription
pageintegerDefault: 1Page number (1-indexed)
per_pageintegerDefault: 50Results per page (max 200)
transaction_typestringOptionalFilter by type: credit or debit
flaggedbooleanOptionalWhen true, returns only flagged/screened transactions
date_fromstringOptionalStart date filter (YYYY-MM-DD, inclusive)
date_tostringOptionalEnd date filter (YYYY-MM-DD, inclusive)

Example

curl
curl -X GET "https://api.banklyze.com/v1/deals/42/transactions?flagged=true&date_from=2026-01-01&date_to=2026-01-31" \
  -H "X-API-Key: your_api_key_here"

Response

Response — 200 OK
{
  "data": [
    {
      "id": 205,
      "date": "2026-01-07",
      "description": "WIRE TRANSFER IN - FLEET SERVICES CO",
      "amount": 18500.00,
      "balance": 47200.00,
      "transaction_type": "credit",
      "is_nsf_fee": false,
      "is_overdraft_fee": false,
      "screening_bucket": "large_unusual_deposit",
      "flag_reason": "Deposit exceeds 3x average daily deposit",
      "category": "revenue",
      "document_id": 15
    },
    {
      "id": 215,
      "date": "2026-01-12",
      "description": "ACH DEBIT - MERCHANT CASH ADVANCE REPAY",
      "amount": -1250.00,
      "balance": 35100.00,
      "transaction_type": "debit",
      "is_nsf_fee": false,
      "is_overdraft_fee": false,
      "screening_bucket": "repeat_charge",
      "flag_reason": "Daily recurring debit pattern",
      "category": "debt_service",
      "document_id": 15
    }
  ],
  "meta": {
    "page": 1,
    "per_page": 50,
    "total": 2,
    "total_pages": 1
  }
}

Corrections

Update one or more fields on an extracted transaction. This is used by underwriters to correct OCR errors or recategorize transactions (e.g., marking a large deposit as non-revenue). All corrections are tracked in the audit history. After correction, the deal health score and recommendation may need to be regenerated to reflect the updated data.

Path Parameters

NameTypeRequiredDescription
document_idintegerRequiredThe document containing the transaction
transaction_idintegerRequiredThe unique transaction ID

Request Body

NameTypeRequiredDescription
amountnumberOptionalCorrected transaction amount (positive for credits, negative for debits)
descriptionstringOptionalCorrected transaction description
transaction_typestringOptionalCorrected type: credit or debit
categorystringOptionalTransaction category: revenue, non_revenue, debt_service, operating_expense, transfer, other

Example

curl
curl -X PATCH https://api.banklyze.com/v1/documents/15/transactions/205 \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 18500.00,
    "description": "WIRE TRANSFER IN - FLEET SERVICES CO (EQUIPMENT SALE)",
    "transaction_type": "credit",
    "category": "non_revenue"
  }'

Response

Response — 200 OK
{
  "id": 205,
  "date": "2026-01-07",
  "description": "WIRE TRANSFER IN - FLEET SERVICES CO (EQUIPMENT SALE)",
  "amount": 18500.00,
  "balance": 47200.00,
  "transaction_type": "credit",
  "is_nsf_fee": false,
  "is_overdraft_fee": false,
  "screening_bucket": "large_unusual_deposit",
  "flag_reason": "Deposit exceeds 3x average daily deposit",
  "category": "non_revenue",
  "document_id": 15,
  "corrected": true,
  "corrected_at": "2026-02-16T10:45:00Z",
  "corrected_by": "Jane D."
}

Retrieve the full correction audit trail for a transaction. Each correction entry shows the field that was changed, the old and new values, who made the change, and when. This provides a complete history of manual adjustments for compliance and review purposes.

Path Parameters

NameTypeRequiredDescription
transaction_idintegerRequiredThe unique transaction ID

Example

curl
curl -X GET https://api.banklyze.com/v1/transactions/205/corrections \
  -H "X-API-Key: your_api_key_here"

Response

Response — 200 OK
{
  "transaction_id": 205,
  "corrections": [
    {
      "id": 1,
      "field": "description",
      "old_value": "WIRE TRANSFER IN - FLEET SERVICES CO",
      "new_value": "WIRE TRANSFER IN - FLEET SERVICES CO (EQUIPMENT SALE)",
      "corrected_by": "Jane D.",
      "corrected_at": "2026-02-16T10:45:00Z"
    },
    {
      "id": 2,
      "field": "category",
      "old_value": "revenue",
      "new_value": "non_revenue",
      "corrected_by": "Jane D.",
      "corrected_at": "2026-02-16T10:45:00Z"
    }
  ],
  "total_corrections": 2
}