# Returns the bank transactions that match the given filters.

`POST /banking/bank-transactions/search`

Group: Banking › Bank Transactions · Operation ID: `searchBankTransaction`

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.

[Open in the interactive reference](https://docs.api.lensing.ai/?op=searchBankTransaction)

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | `"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. |
| `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. |
| `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. |

Example:

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

## Response

`200` Success

Under `data` (searchBankTransactionOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | array of 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` | string (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` | string (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` | string (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. |

## Statuses

- `400` — Invalid request or business failure
- `401` — Missing or invalid access token
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests
- `500` — Internal server error
