square.listPayments retrieves a list of payments taken by the account making the request.
Example
automations/square-list-payments.automation.ts
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 requiresPAYMENTS_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. |
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. |
Output
Returns the officialSquare.ListPaymentsResponse response as a codec-safe object. Square integer money amounts remain bigint values.