BanklyzeBanklyze/Developer Docs
Sign In

Transactions

Query extracted transactions by document or across all documents in a deal. Transactions are produced by the statement processing pipeline and include screening flags, balance data, and classification metadata. Individual transactions can be corrected when OCR or LLM extraction produces inaccurate values, and all corrections are recorded in a permanent audit trail.

Retrieve a paginated list of all transactions extracted from a single document. Supports filtering by transaction type and screening flag status, as well as date range restrictions. Only available for documents in completed status.

Path Parameters

NameTypeRequiredDescription
document_idintegerRequiredThe unique document ID

Query Parameters

NameTypeRequiredDescription
pageintegerDefault: 1Page number (1-indexed)
per_pageintegerDefault: 50Results per page (max 200)
typestringOptionalFilter by transaction direction: credit or debit
flaggedbooleanOptionalWhen true, returns only transactions that have a screening flag (screening_bucket is not null)
start_datestringOptionalEarliest transaction date to include, formatted YYYY-MM-DD (inclusive)
end_datestringOptionalLatest transaction date to include, formatted YYYY-MM-DD (inclusive)

Example

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

Response

Response — 200 OK
{
  "data": [
    {
      "id": 201,
      "document_id": 15,
      "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,
      "is_large_deposit": true,
      "is_large_strange": false,
      "is_repeat_charge": false,
      "is_suspicious": false,
      "screening_bucket": null,
      "flag_reason": null
    },
    {
      "id": 202,
      "document_id": 15,
      "date": "2026-01-05",
      "description": "ACH DEBIT - MERCHANT CASH ADVANCE REPAY",
      "amount": -1250.00,
      "balance": 31500.00,
      "transaction_type": "debit",
      "is_nsf_fee": false,
      "is_overdraft_fee": false,
      "is_large_deposit": false,
      "is_large_strange": false,
      "is_repeat_charge": true,
      "is_suspicious": false,
      "screening_bucket": "repeat_charge",
      "flag_reason": "Daily recurring debit pattern"
    }
  ],
  "meta": {
    "page": 1,
    "per_page": 50,
    "total": 47,
    "total_pages": 1
  }
}

Retrieve a paginated list of all transactions across every document attached to a deal. This is a convenience endpoint that aggregates transactions from all processed documents in the deal, ordered chronologically. Each transaction in the response includes a document_id field identifying its source document.

Path Parameters

NameTypeRequiredDescription
deal_idintegerRequiredThe unique deal ID

Query Parameters

NameTypeRequiredDescription
pageintegerDefault: 1Page number (1-indexed)
per_pageintegerDefault: 50Results per page (max 200)
typestringOptionalFilter by transaction direction: credit or debit
flaggedbooleanOptionalWhen true, returns only transactions that carry a screening flag
start_datestringOptionalEarliest transaction date to include, formatted YYYY-MM-DD (inclusive)
end_datestringOptionalLatest transaction date to include, formatted YYYY-MM-DD (inclusive)

Example

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

Response

Response — 200 OK
{
  "data": [
    {
      "id": 201,
      "document_id": 15,
      "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,
      "is_large_deposit": true,
      "is_large_strange": false,
      "is_repeat_charge": false,
      "is_suspicious": false,
      "screening_bucket": null,
      "flag_reason": null
    },
    {
      "id": 315,
      "document_id": 16,
      "date": "2026-02-04",
      "description": "ACH DEBIT - NSF FEE",
      "amount": -35.00,
      "balance": 412.00,
      "transaction_type": "debit",
      "is_nsf_fee": true,
      "is_overdraft_fee": false,
      "is_large_deposit": false,
      "is_large_strange": false,
      "is_repeat_charge": false,
      "is_suspicious": false,
      "screening_bucket": "nsf_fee",
      "flag_reason": "NSF fee detected"
    }
  ],
  "meta": {
    "page": 1,
    "per_page": 50,
    "total": 243,
    "total_pages": 5
  }
}

Corrections & Audit Trail

Transaction corrections allow underwriters to fix inaccurate values produced by OCR or LLM extraction without reprocessing the entire document. Only users with an admin or manager role may write corrections. Every correction is recorded in an append-only audit trail that is retrievable at any time. Correcting a transaction does not re-run screening — re-trigger analysis via POST /documents/{document_id}/reprocess if rescoring is needed after corrections.

Partially update one or more fields on a transaction to correct an extraction error. Only the fields provided in the request body are updated. The correction_reason field is required on every correction request and is stored verbatim in the audit trail.

Path Parameters

NameTypeRequiredDescription
document_idintegerRequiredThe unique document ID that owns the transaction
transaction_idintegerRequiredThe unique transaction ID to correct

Request Body

NameTypeRequiredDescription
amountnumberOptionalCorrected transaction amount in USD. Use a negative value for debits.
descriptionstringOptionalCorrected transaction description text
transaction_typestringOptionalCorrected transaction direction: credit or debit
correction_reasonstringRequiredExplanation for the correction, stored in the audit trail (max 500 characters)

Example

curl
curl -X PATCH https://api.banklyze.com/v1/documents/15/transactions/201 \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 4350.00,
    "correction_reason": "OCR misread — verified against original statement PDF. Correct deposit amount is $4,350.00."
  }'

Response

Response — 200 OK
{
  "id": 201,
  "document_id": 15,
  "date": "2026-01-03",
  "description": "ACH DEPOSIT - STRIPE PAYMENTS",
  "amount": 4350.00,
  "balance": 32750.00,
  "transaction_type": "credit",
  "is_nsf_fee": false,
  "is_overdraft_fee": false,
  "is_large_deposit": true,
  "is_large_strange": false,
  "is_repeat_charge": false,
  "is_suspicious": false,
  "screening_bucket": null,
  "flag_reason": null,
  "correction_count": 1,
  "last_corrected_at": "2026-02-15T16:10:00Z"
}

Retrieve the full correction audit trail for a single transaction. Each entry records the field changed, the old and new values, the correction reason, the API key that made the change, and the timestamp. Corrections are returned in chronological order (oldest first).

Path Parameters

NameTypeRequiredDescription
transaction_idintegerRequiredThe unique transaction ID

Example

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

Response

Response — 200 OK
{
  "transaction_id": 201,
  "corrections": [
    {
      "id": 1,
      "transaction_id": 201,
      "field": "amount",
      "old_value": "4250.00",
      "new_value": "4350.00",
      "correction_reason": "OCR misread — verified against original statement PDF. Correct deposit amount is $4,350.00.",
      "corrected_by": "Production API Key",
      "corrected_at": "2026-02-15T16:10:00Z"
    }
  ],
  "total": 1
}