# Search bank transactions

Operation ID: `searchBankTransaction`

Group: Banking › Bank Transactions

[Open in the interactive reference](https://docs.api.lensing.ai/lensing/v1/endpoints/searchBankTransaction)

`POST /banking/bank-transactions/search`

Read-only: A read that takes its filters in the body. Changes nothing, and ignores Idempotency-Key.

Searches bank transactions. Every filter is optional and they are combined with AND. Omit them all to return every bank transaction. Each match is the full transaction record.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | string · v1 | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |

## Request body

Required, `application/json`: searchBankTransactionInput.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `filters` | object | no | The filters to apply. A bank transaction must match every filter you send. Omit to return all bank transactions. Example: `{"matchStatus":"unmatched"}`. |
| `filters.id` | string | no | Limits results to the bank transaction with this identifier. |
| `filters.bankTransactionNumber` | string | no | Limits results to the bank transaction with this number. The match is exact. |
| `filters.externalTransactionId` | string | no | Limits results to the transaction with this external identifier. The match is exact. |
| `filters.externalPaymentId` | string | no | Limits results to transactions with this end-to-end payment identifier. The match is exact. |
| `filters.bankAccountId` | string | no | Limits results to transactions on this bank account. See id on GET banking/bank-accounts/:id. |
| `filters.entityId` | string | no | Limits results to transactions whose bank account belongs to this legal entity. See id on GET base/entities. |
| `filters.currency` | string | no | Limits results to transactions in this currency. Format ISO 4217, for example 'USD'. |
| `filters.matchStatus` | string | no | Limits results to transactions in this reconciliation state. The states are 'unmatched', 'suggested', 'pending', 'matched', 'autoMatched' and 'needsAttention'. Any other value matches nothing. |
| `page` | object | no | The pagination controls. Omit for the first page. Example: `{"size":50}`. |
| `page.cursor` | string | no | The cursor from the previous response's pagination.nextCursor. Omit on the first request. |
| `page.size` | number | no | The number of bank transactions per page, between 1 and 200. Defaults to 50. A value above 200 is treated as 200, not rejected. |

```json
{
  "filters": {
    "matchStatus": "unmatched"
  },
  "page": {
    "size": 50
  }
}
```

## Response

`200` Success

Under `data` (searchBankTransactionOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | array<object> | yes | The bank transactions on this page, most recently created first. An empty array when nothing matches. |
| `items[].id` | string | yes | The unique identifier for the bank transaction. |
| `items[].bankTransactionNumber` | string | no | The bank transaction number. Absent until one has been assigned. |
| `items[].externalTransactionId` | string | yes | The identifier this transaction has in the bank or aggregator it was imported from. Unique across transactions. |
| `items[].externalPaymentId` | string | no | The end-to-end payment identifier supplied by the integration, where the bank provides one. |
| `items[].endToEndId` | string | no | A payment reference recovered from the external transaction data by the integration. |
| `items[].externalCreationDate` | date | yes | The date the transaction was created in the source bank, not the date it was imported. Format YYYY-MM-DD. |
| `items[].description` | string | no | The description recorded on the transaction. |
| `items[].externalDescription` | string | no | The description as the bank supplied it, unmodified. |
| `items[].additionalInformation` | string | no | Any additional detail the bank supplied with the transaction. |
| `items[].payeeOrPayor` | string | no | The name of the counterparty the money went to or came from. |
| `items[].amount` | decimal | no | The transaction amount, as a decimal in the transaction currency. A negative amount is money leaving the account and a positive amount is money arriving. |
| `items[].currency` | string | no | The currency of the transaction. Format ISO 4217, for example 'USD'. It governs the amount. |
| `items[].matchStatus` | string | no | The reconciliation state of the transaction, computed from its matches. The states are 'unmatched', 'suggested', 'pending', 'matched', 'autoMatched' and 'needsAttention'. |
| `items[].matchId` | string | no | The unique identifier for the match this transaction belongs to. Absent when the transaction is unmatched. There is no endpoint for it. |
| `items[].notes` | string | no | Free-form notes recorded against the transaction. |
| `items[].transactionPaymentMethod` | string | no | How the payment was made, as reported by the integration. The values are 'ACH', 'WIRE' and 'Unknown'. |
| `items[].bankAccountId` | string | no | The bank account this transaction belongs to. See id on GET banking/bank-accounts/:id. |
| `items[].accountName` | string | no | The name of the linked chart-of-accounts account. Suffixed with '(Inactive)' when the account link is broken. |
| `items[].sourceBankName` | string | no | The name of the bank the account is held at. |
| `items[].entityName` | string | no | The name of the legal entity the owning bank account belongs to. |
| `items[].lastModifiedDate` | date-time | yes | The date and time the bank transaction last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `pagination` | object | yes | The pagination cursor for this page. |
| `pagination.nextCursor` | string | no | The cursor for the next page. Pass it as page.cursor. Absent on the last page. |
| `pagination.hasMore` | boolean | yes | Whether more matches remain beyond this page. |

```json
{
  "data": {
    "items": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "bankTransactionNumber": "<bankTransactionNumber>",
        "externalTransactionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "externalPaymentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "endToEndId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "externalCreationDate": "2026-01-15",
        "description": "<description>",
        "externalDescription": "<externalDescription>",
        "additionalInformation": "<additionalInformation>",
        "payeeOrPayor": "<payeeOrPayor>",
        "amount": "19.99",
        "currency": "<currency>",
        "matchStatus": "<matchStatus>",
        "matchId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "notes": "<notes>",
        "transactionPaymentMethod": "<transactionPaymentMethod>",
        "bankAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "accountName": "<accountName>",
        "sourceBankName": "<sourceBankName>",
        "entityName": "<entityName>",
        "lastModifiedDate": "2026-01-15T09:30:00.000Z"
      }
    ],
    "pagination": {
      "nextCursor": "<nextCursor>",
      "hasMore": true
    }
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}
```

## Statuses

- `400` — Invalid request or business failure
- `401` — The request carries no valid access token.
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests from this client address. The response has no body and no `Retry-After` header.
- `500` — Internal server error
