# Query Information
source: https://developer.mastercard.com/agent-suite-for-merchants/documentation/use-cases/querying-database-information/index.md

👉 Replace the generic search examples, query parameters, endpoint names, and Mermaid diagrams with the real filtering and search behavior for your service. Update every Mermaid `basename` to the correct source file in `data/mermaid/`, and replace each Swagger embed with the real OpenAPI file, search path, and HTTP method. Remove any search category that does not exist in your API.

Search current resource records by status, search historical transaction records by date, or look up administrative records by a sensitive identifier.

## Search for Resource Records {#search-for-resource-records}

Use the list endpoint to search active or available resource records based on status and any supported query parameters. In the sample specification bundled with this starter, this is represented by `GET /pets`.

### Example sequence {#example-sequence}

Diagram search-for-pets

### Search resource records request {#search-resource-records-request}

An operator searches current resources by status to find a record that can be used in the next workflow step. Query parameters narrow the result set and help support paging, sorting, or filtering.

See the endpoint structure used by the sample specification:


API Reference: `GET /pets`

<br />

## Search for Historical Transaction Records {#search-for-historical-transaction-records}

Use the transaction listing endpoint to retrieve records within a date range and, where supported, filter further by category or related identifiers. In the sample specification, this is represented by `GET /adoptions`.

### Example sequence {#example-sequence-1}

Diagram search-previously-adopted-pets

### Search transaction records request {#search-transaction-records-request}

An operations team generates a report of past transaction activity to reconcile lifecycle state, downstream processing, or historical volume. Querying by date range and pagination keeps the response targeted and performant.

See the endpoint structure used by the sample specification:


API Reference: `GET /adoptions`

<br />

## Search for an Administrative Record by Sensitive Identifier {#search-for-an-administrative-record-by-sensitive-identifier}

Some sensitive identifiers should not appear in a URL. For those cases, use a search endpoint that accepts the value in the request body. In the sample specification, this is represented by `POST /employees/searches`.

### Preconditions {#preconditions}

* The administrative record must already exist in the system.
* You must have the exact identifier value required by the search endpoint.

### Example sequence {#example-sequence-2}

Diagram oauth-search-ssn

### Search administrative records request {#search-administrative-records-request}

An internal operations team looks up an administrative record by a sensitive identifier for verification or case management. A POST search endpoint is used instead of GET so the sensitive value is not exposed in a URL.

See the endpoint structure used by the sample specification:


API Reference: `POST /employees/searches`

<br />

## Error Resolution {#error-resolution}

For details on error resolution please visit our [Code and Formats](https://developer.mastercard.com/agent-suite-for-merchants/documentation/code-and-formats/index.md) section.
