# Querying and Filtering

<figure><img src="https://855896703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4UWkWFnnmVPzvJTdMtC0%2Fuploads%2Fy6t8GBY6rL6xCs1h7q0z%2FQuerying%20B.png?alt=media&#x26;token=8b6525ae-9bd1-404d-9b91-d38d1a262039" alt=""><figcaption></figcaption></figure>

If you need to find a specific record in our database (such as a transaction or saved consent) or you need to find all records matching your criteria, you can either **query our APIs** programatically or **use the Virtual Terminal** to view and filter the records from its user interface.

## REST API

To query records, you'll need to find a relevant method in the [rest-api](https://docs.number.tech/api-reference/rest-api "mention") reference.

When querying, you'll need to prepare the `Query` string. It should consist of variables that correspond to fields on the records and logical terms built using those variables.&#x20;

**All `Query` string variable options are fully described in the API reference under specific API methods and in the** [querying](https://docs.number.tech/documentation/resources/querying "mention") **reference.** You can use the variables to build logical terms, and you can build and join logical terms using "&&" for a logical AND or "||" for a logical OR.

Read about Number's query language in our [querying](https://docs.number.tech/documentation/resources/querying "mention") reference.

{% hint style="info" %}
Depending on the type of record you're querying (transaction, consent, ...), the variables you can use inside of a `Query` string will differ. The formatting rules do not change.
{% endhint %}

### Example

As an example, if want to find settled ACH transactions made in January 2025 made using Verifone card readers, you can call [#apicardprocrest-v1.0.0-query-achtransaction](https://docs.number.tech/api-reference/rest-api-alt/query/ach#apicardprocrest-v1.0.0-query-achtransaction "mention") or [#ach-transaction-query](https://docs.number.tech/api-reference/soap-api/ach#ach-transaction-query "mention") depending on which API you are using.

You can check the description of the `Query` string parameter or check the [querying](https://docs.number.tech/documentation/resources/querying "mention") reference for [#transaction-query](https://docs.number.tech/resources/querying#transaction-query "mention") section to find out that **variable 'B' corresponds to transaction status, variable 'C' corresponds to date created, and 'U' corresponds to the transaction origin**.

Each variable which requires an enum includes a description of valid values. **Settled transactions have a transaction status of '2', and Verifone transactions have an origin of 'SDK'.** To format the date correctly, follow the examples given for the variable.

You can combine the filters to build your `Query` string like so:

```sql
(B=2)&&(C>='1/1/2025')&&(C<='1/31/2025')&&(U='SDK')
```

***

## Virtual Terminal

You can filter consents, transactions, and other records through the Virtual Terminal user interface.&#x20;

To log into the Virtual Terminal, you need to have a user account created through the Client Admin Portal as described in the [authentication](https://docs.number.tech/documentation/developer-quickstart/authentication "mention") quickstart guide.

Once you're logged in, see the navigation on the left and click on *Scheduled* to view scheduled payments, click on *Settlement* to view settlements, or expand *Reports* to find other reports. There, you'll be able to search and filter records using the user interface.

You can read more about using the Virtual Terminal in the [virtual-terminal](https://docs.number.tech/documentation/getting-started/integration-options/virtual-terminal "mention") guide.

<figure><img src="https://855896703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4UWkWFnnmVPzvJTdMtC0%2Fuploads%2FiDLwPHo1oXaKAggwqFQZ%2FVirtual%20Terminal.png?alt=media&#x26;token=4147a117-bdcb-4af8-ae38-4dcb7697efda" alt=""><figcaption><p>Virtual Terminal navigation</p></figcaption></figure>

<figure><img src="https://855896703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4UWkWFnnmVPzvJTdMtC0%2Fuploads%2FcBEpxdITkvcDWpUEeuF9%2FVirtual%20Terminal%206a%20Consent%20list.png?alt=media&#x26;token=50dfcd0a-d72a-4e5c-bc34-4dbc8e7e4df9" alt=""><figcaption><p>Consent list and filters</p></figcaption></figure>

<figure><img src="https://855896703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4UWkWFnnmVPzvJTdMtC0%2Fuploads%2FsQef93GbyCfIMkusLNK1%2FVirtual%20Terminal%208a%20Transaction%20list.png?alt=media&#x26;token=909eba3a-2e18-4de0-9478-0d43b157ed1e" alt=""><figcaption><p>Transaction list and filters</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.number.tech/documentation/developer-quickstart/querying-and-filtering.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
