> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Search Loyalty Accounts

> Searches for loyalty accounts in a loyalty program.

`square.searchLoyaltyAccounts` searches for loyalty accounts in a loyalty program.

## Example

```ts automations/square-search-loyalty-accounts.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { square } from "automate.ax/square"

export default automation("Search Square Loyalty Accounts", () => {
  onDashboardRun({ title: "Search Square Loyalty Accounts" })

  square.searchLoyaltyAccounts({
    query: {
      mappings: [
        {
          phoneNumber: "+14155551234",
        },
      ],
    },
    limit: 10,
  })
})
```

## Inputs

Every input accepts a compatible signal. It requires `LOYALTY_READ`.

| Field    | Type                                                     | Required | Default | Description                                                                                                                                                                                                                                                         |
| -------- | -------------------------------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `query`  | `Square.SearchLoyaltyAccountsRequestLoyaltyAccountQuery` | No       | —       | The search criteria for the request.                                                                                                                                                                                                                                |
| `limit`  | `number`                                                 | No       | 30      | The maximum number of results to include in the response. The default value is 30.                                                                                                                                                                                  |
| `cursor` | `string`                                                 | No       | —       | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |

Use the official [SearchLoyaltyAccounts reference](https://developer.squareup.com/reference/square/loyalty-api/search-loyalty-accounts) for provider field semantics and limits.

## Output

Returns the official `Square.SearchLoyaltyAccountsResponse` response as a codec-safe object. Square integer money amounts remain `bigint` values.
