> ## 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.

# List Payments

> Retrieves a list of payments taken by the account making the request.

`square.listPayments` retrieves a list of payments taken by the account making the request.

## Example

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

export default automation("List Square Payments", () => {
  onDashboardRun({ title: "List Square Payments" })

  square.listPayments({
    beginTime: "begin_time",
    endTime: "end_time",
    sortOrder: "sort_order",
    cursor: "cursor",
    locationId: "location_id",
    total: BigInt("1000000"),
    last4: "last_4",
    cardBrand: "card_brand",
    limit: 1,
    isOfflinePayment: true,
    offlineBeginTime: "offline_begin_time",
    offlineEndTime: "offline_end_time",
    updatedAtBeginTime: "updated_at_begin_time",
    updatedAtEndTime: "updated_at_end_time",
    sortField: "CREATED_AT",
  })
})
```

## Inputs

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

| Field                | Type                                          | Required | Default                         | Description                                                                                                                                                                                                                                                                                                                                                 |
| -------------------- | --------------------------------------------- | -------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `beginTime`          | `string \| null`                              | No       | The current time minus one year | Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The range is determined using the `created_at` field for each Payment. Inclusive. Default: The current time minus one year.                                                                                                                                             |
| `endTime`            | `string \| null`                              | No       | The current time                | Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The range is determined using the `created_at` field for each Payment. Default: The current time.                                                                                                                                                                         |
| `sortOrder`          | `string \| null`                              | No       | —                               | The order in which results are listed by `ListPaymentsRequest.sort_field`: - `ASC` - Oldest to newest. - `DESC` - Newest to oldest (default).                                                                                                                                                                                                               |
| `cursor`             | `string \| null`                              | No       | —                               | A pagination cursor returned by a previous call to this endpoint. Provide this cursor 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).                                                                                  |
| `locationId`         | `string \| null`                              | No       | —                               | Limit results to the location supplied. By default, results are returned for the default (main) location associated with the seller.                                                                                                                                                                                                                        |
| `total`              | `bigint \| null`                              | No       | —                               | The exact amount in the `total_money` for a payment.                                                                                                                                                                                                                                                                                                        |
| `last4`              | `string \| null`                              | No       | —                               | The last four digits of a payment card.                                                                                                                                                                                                                                                                                                                     |
| `cardBrand`          | `string \| null`                              | No       | —                               | The brand of the payment card (for example, VISA).                                                                                                                                                                                                                                                                                                          |
| `limit`              | `number \| null`                              | No       | used instead                    | The maximum number of results to be returned in a single page. It is possible to receive fewer results than the specified limit on a given page. The default value of 100 is also the maximum allowed value. If the provided value is greater than 100, it is ignored and the default value is used instead. Default: `100`                                 |
| `isOfflinePayment`   | `boolean \| null`                             | No       | —                               | Whether the payment was taken offline or not.                                                                                                                                                                                                                                                                                                               |
| `offlineBeginTime`   | `string \| null`                              | No       | The current time                | Indicates the start of the time range for which to retrieve offline payments, in RFC 3339 format for timestamps. The range is determined using the `offline_payment_details.client_created_at` field for each Payment. If set, payments without a value set in `offline_payment_details.client_created_at` will not be returned. Default: The current time. |
| `offlineEndTime`     | `string \| null`                              | No       | The current time                | Indicates the end of the time range for which to retrieve offline payments, in RFC 3339 format for timestamps. The range is determined using the `offline_payment_details.client_created_at` field for each Payment. If set, payments without a value set in `offline_payment_details.client_created_at` will not be returned. Default: The current time.   |
| `updatedAtBeginTime` | `string \| null`                              | No       | —                               | Indicates the start of the time range to retrieve payments for, in RFC 3339 format. The range is determined using the `updated_at` field for each Payment.                                                                                                                                                                                                  |
| `updatedAtEndTime`   | `string \| null`                              | No       | —                               | Indicates the end of the time range to retrieve payments for, in RFC 3339 format. The range is determined using the `updated_at` field for each Payment.                                                                                                                                                                                                    |
| `sortField`          | `Square.ListPaymentsRequestSortField \| null` | No       | —                               | The field used to sort results by. The default is `CREATED_AT`.                                                                                                                                                                                                                                                                                             |

Use the official [ListPayments reference](https://developer.squareup.com/reference/square/payments-api/list-payments) for provider field semantics and limits.

## Output

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