> For the complete documentation index, see [llms.txt](https://docs.udara360.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.udara360.io/udara360-docs-1/cards/interswitch/search.md).

# Search

The "Search" endpoint allows customers to look up card records in the Interswitch card data store using any combination of filters

<mark style="color:green;">`GET`</mark> `/api/Card/v{{version}}/Interswitch/Search`

{% hint style="info" %}
Pass only the field(s) you intend to search by, every query parameter is optional, and the endpoint filters on whatever combination you provide.
{% endhint %}

{% hint style="info" %}
`MaskedPan` must follow the platform's masking format: the first 6 and last 4 digits of the card, with nine asterisks (`*`) in between (e.g. `506122*********2039`).
{% endhint %}

To search for cards, you can pass any of the supported query parameters, `MaskedPan`, `IssuanceStatus`, `CardType`, `CardScheme`, `Status`, `CardExpiry`, `StartDate`, `EndDate`, `PageNumber`, `PageSize`, `Direction` as needed.&#x20;

A successful request returns a paginated list of matching card records under `data`, each with the same full card profile as [GetSingleCard](/udara360-docs-1/cards/interswitch/getsinglecard.md) alongside a `recordCount` showing the total number of matching records.

This endpoint streamlines card lookups by letting you search and filter across the entire card data store in a single call, rather than retrieving records one ID at a time.

**Headers**

| Name                                           | Value              |
| ---------------------------------------------- | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> | `application/json` |
| Request-Reference                              | `unique_string`    |

**Query Params**

| Name             | Description                                                                                          |
| ---------------- | ---------------------------------------------------------------------------------------------------- |
| `MaskedPan`      | The card's masked PAN to search by (first 6 and last 4 digits, nine asterisks in between). Optional. |
| `IssuanceStatus` | The card's issuance status to filter by (e.g. Issued). Optional.                                     |
| `CardType`       | The card type to filter by (e.g. Default). Optional.                                                 |
| `CardScheme`     | The card scheme to filter by (e.g. Verve). Optional.                                                 |
| `Status`         | The card's status to filter by (e.g. Active). Optional.                                              |
| `CardExpiry`     | The card expiry date to filter by. Optional.                                                         |
| `StartDate`      | The start of the date range to filter by. Optional.                                                  |
| `EndDate`        | The end of the date range to filter by. Optional.                                                    |
| `PageNumber`     | The page number to retrieve. Optional.                                                               |
| `PageSize`       | The number of records to return per page. Optional.                                                  |
| `Direction`      | The sort direction for the results (e.g. Desc). Optional.                                            |

Here is an example request and response with a sample payload sent to the endpoint in Curl format.

<details>

<summary>Sample Request</summary>

```json
curl --location -g '{{baseUrl}}/api/Card/v{{version}}/Interswitch/Search?MaskedPan=506122*********2039&IssuanceStatus=Issued&CardType=Default&CardScheme=Verve&Status=Active&CardExpiry=2022-12-02&StartDate=2025-03-28&EndDate=2025-03-31&PageNumber=1&PageSize=10&Direction=Desc' \
--header 'Content-Type: application/json'
```

</details>

<details>

<summary>Response: <code>200</code></summary>

```json
{
  "status": true,
  "message": "Operation Successful",
  "data": {
    "data": [
      {
        "batchNo": null,
        "maskedPan": "506136*********3971",
        "encrptedPan": "9SwhhFsBSsLF2wPx5G8mOnaROaL7Zz1W+IqHjsOq0kA=",
        "hashedPan": "3FC26AA400EB45B70E786230339D9CB4B03FA0605ADDDAA8F3D99CAF8564AF91",
        "accountNumber": null,
        "nameOnCard": null,
        "clearPan": null,
        "serialNumber": "97523971",
        "bankCode": "000003",
        "cardGenerationRequestId": "00000000-0000-0000-0000-000000000000",
        "expiryDate": "2023-03-26T00:00:00",
        "requestDate": null,
        "issuedDate": "2024-11-18T12:12:09.2566667",
        "issuanceStatus": "Issued",
        "cardProfileId": "88e146b6-7b8e-41e4-9c04-1ef78fc859a0",
        "cardType": "Default",
        "cardScheme": "MasterCard",
        "status": "Active",
        "isATMEnabled": true,
        "isPOSEnabled": true,
        "isWebEnabled": true,
        "cardFileLink": null,
        "id": "33c21285-3704-4519-ab4d-cb3cc2210ad1",
        "dateCreated": "2023-03-26T21:04:36.0466667",
        "dateLastModified": null
      }
    ],
    "recordCount": 0
  }
}
```

</details>
