Skip to content

Square: List Customers

Square customers.listCustomers: arguments, response, policy and SDK examples.

← Customers operations · Get started

Operation square.listcustomers

Provider route: GET /v2/customers. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/square with npm, or alter-sdk-square with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { SquareIntegration } from "@alter-ai/square";
async function execute(input: Parameters<SquareIntegration["customers"]["listCustomers"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new SquareIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.customers.listCustomers(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_square import SquareIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = SquareIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.customers.list_customers(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
queryobjectOptionalAdditional keys: not allowed
query.cursorstringOptional
query.limitintegerOptional
query.sort_fieldstringOptionalSpecifies customer attributes as the sort key to customer profiles returned from a search.
One of: DEFAULT, CREATED_AT
query.sort_orderstringOptionalThe order (e.g., chronological or alphabetical) in which results from a request are returned.
One of: DESC, ASC
query.countbooleanOptionalDefault: false

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand List Customers — response body

Referenced models: List Customers — response body

3 more schemas are linked from the tables above, on the schema pages.

List Customers — response body
FieldTypePresenceDescription and constraints
$objectRootDefines the fields that are included in the response body of
a request to the `ListCustomers` endpoint.

Either `errors` or `customers` is present in a given response (never both).
countJSONOptional
count (anyOf 1)integerAlternativeThe total count of customers associated with the Square account. Only customer profiles with public information
(`given_name`, `family_name`, `company_name`, `email_address`, or `phone_number`) are counted. This field is present
only if `count` is set to `true` in the request.
Format: int64
count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
cursorstringOptionalA pagination cursor to retrieve the next set of results for the
original query. A cursor is only present if the request succeeded and additional results
are available.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
customersarrayOptionalThe customer profiles associated with the Square account or an empty object (`{}`) if none are found.
Only customer profiles with public information (`given_name`, `family_name`, `company_name`, `email_address`, or
`phone_number`) are included in the response.
customers[]ModelEach itemExpand Create Customer — response body — customer
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item

Referenced models: Create Customer — response body — customer, Get Shift — response body — errors item

Create Customer — response body — customer
FieldTypePresenceDescription and constraints
$objectRootRepresents a Square customer profile in the Customer Directory of a Square seller.
addressJSONOptional
address (anyOf 1)ModelAlternativeExpand Get Payment — response body — payment billing address
The physical address associated with the customer profile.
address (anyOf 2)nullAlternative
birthdayJSONOptional
birthday (anyOf 1)stringAlternativeThe birthday associated with the customer profile, in `YYYY-MM-DD` format. For example, `1998-09-21`
represents September 21, 1998, and `0000-09-21` represents September 21 (without a birth year).
birthday (anyOf 2)nullAlternative
company_nameJSONOptional
company_name (anyOf 1)stringAlternativeA business name associated with the customer profile.
company_name (anyOf 2)nullAlternative
created_atstringOptionalThe timestamp when the customer profile was created, in RFC 3339 format.
Read only: true
creation_sourceJSONOptional
creation_source (anyOf 1)stringAlternativeIndicates the method used to create the customer profile.
The method used to create the customer profile.
See [CustomerCreationSource](#type-customercreationsource) for possible values
Known values: OTHER, APPOINTMENTS, COUPON, DELETION_RECOVERY, DIRECTORY, EGIFTING, EMAIL_COLLECTION, FEEDBACK, IMPORT, INVOICES, LOYALTY, MARKETING, MERGE, ONLINE_STORE, INSTANT_PROFILE, TERMINAL, THIRD_PARTY, THIRD_PARTY_IMPORT, UNMERGE_RECOVERY
creation_source (anyOf 2)nullAlternative
email_addressJSONOptional
email_address (anyOf 1)stringAlternativeThe email address associated with the customer profile.
email_address (anyOf 2)nullAlternative
family_nameJSONOptional
family_name (anyOf 1)stringAlternativeThe family name (that is, the last name) associated with the customer profile.
family_name (anyOf 2)nullAlternative
given_nameJSONOptional
given_name (anyOf 1)stringAlternativeThe given name (that is, the first name) associated with the customer profile.
given_name (anyOf 2)nullAlternative
group_idsJSONOptional
group_ids (anyOf 1)arrayAlternativeThe IDs of [customer groups](entity:CustomerGroup) the customer belongs to.
group_ids (anyOf 1)[]stringEach item
group_ids (anyOf 2)nullAlternative
idstringOptionalA unique Square-assigned ID for the customer profile.

If you need this ID for an API request, use the ID returned when you created the customer profile or call the [SearchCustomers](api-endpoint:Customers-SearchCustomers)
or [ListCustomers](api-endpoint:Customers-ListCustomers) endpoint.
nicknameJSONOptional
nickname (anyOf 1)stringAlternativeA nickname for the customer profile.
nickname (anyOf 2)nullAlternative
noteJSONOptional
note (anyOf 1)stringAlternativeA custom note associated with the customer profile.
note (anyOf 2)nullAlternative
phone_numberJSONOptional
phone_number (anyOf 1)stringAlternativeThe phone number associated with the customer profile.
phone_number (anyOf 2)nullAlternative
preferencesJSONOptional
preferences (anyOf 1)ModelAlternativeExpand Create Customer — response body — customer preferences email unsubscribed
Represents general customer preferences.
preferences (anyOf 2)nullAlternative
reference_idJSONOptional
reference_id (anyOf 1)stringAlternativeAn optional second ID used to associate the customer profile with an
entity in another system.
reference_id (anyOf 2)nullAlternative
segment_idsJSONOptional
segment_ids (anyOf 1)arrayAlternativeThe IDs of [customer segments](entity:CustomerSegment) the customer belongs to.
segment_ids (anyOf 1)[]stringEach item
segment_ids (anyOf 2)nullAlternative
tax_idsJSONOptional
tax_ids (anyOf 1)ModelAlternativeExpand Create Customer — request body — body tax ids
The tax ID associated with the customer profile. This field is present only for customers of sellers in EU countries or the United Kingdom.
For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).
tax_ids (anyOf 2)nullAlternative
updated_atstringOptionalThe timestamp when the customer profile was last updated, in RFC 3339 format.
Read only: true
versionJSONOptional
version (anyOf 1)integerAlternativeThe Square-assigned version number of the customer profile. The version number is incremented each time an update is committed to the customer profile, except for changes to customer segment membership.
Format: int64
version (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Create Customer — response body — customer preferences email unsubscribed, Create Customer — request body — body tax ids, Get Payment — response body — payment billing address

Get Shift — response body — errors item
FieldTypePresenceDescription and constraints
$objectRootRepresents an error encountered during a request to the Connect API.

See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information.
categorystringRequired within parentIndicates which high-level category of error has occurred during a
request to the Connect API.
The high-level category for the error.
See [ErrorCategory](#type-errorcategory) for possible values
Known values: API_ERROR, AUTHENTICATION_ERROR, INVALID_REQUEST_ERROR, RATE_LIMIT_ERROR, PAYMENT_METHOD_ERROR, REFUND_ERROR, MERCHANT_SUBSCRIPTION_ERROR, EXTERNAL_VENDOR_ERROR
codeModelRequired within parentExpand Get Shift — response body — errors item code
The specific code of the error.
See [ErrorCode](#type-errorcode) for possible values
detailstringOptionalA human-readable description of the error for debugging purposes.
fieldstringOptionalThe name of the field provided in the original request (if any) that
the error pertains to.

Referenced models: Get Shift — response body — errors item code

Create Customer — response body — customer preferences email unsubscribed
FieldTypePresenceDescription and constraints
$objectRootRepresents communication preferences for the customer profile.
email_unsubscribedJSONOptional
email_unsubscribed (anyOf 1)booleanAlternativeIndicates whether the customer has unsubscribed from marketing campaign emails. A value of `true` means that the customer chose to opt out of email marketing from the current Square seller or from all Square sellers. This value is read-only from the Customers API.
email_unsubscribed (anyOf 2)nullAlternative
Create Customer — request body — body tax ids
FieldTypePresenceDescription and constraints
$objectRootRepresents the tax ID associated with a [customer profile](entity:Customer). The corresponding `tax_ids` field is available only for customers of sellers in EU countries or the United Kingdom.
For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).
eu_vatJSONOptional
eu_vat (anyOf 1)stringAlternativeThe EU VAT identification number for the customer. For example, `IE3426675K`. The ID can contain alphanumeric characters only.
Maximum length: 20
eu_vat (anyOf 2)nullAlternative

SDK function policy ID: square.listcustomers. Catalog operation: ListCustomers. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["CUSTOMERS_READ"]

Pinned headers: {"Square-Version": "2026-11-18"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand how our website, product, and documentation are used.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

Advertising

Shares visits and sign-ups with Meta, Reddit, and X so we can measure which of our ads work.

You can change these choices at any time from Cookie settings.