Skip to content

Square: Customers schemas

40 Square schemas with complete fields and constraints.

← Customers operations · All schemas

Add Group To Customer — response body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields that are included in the response body of
a request to the [AddGroupToCustomer](api-endpoint:Customers-AddGroupToCustomer) endpoint.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item

Referenced models: Get Shift — response body — errors item

Bulk Create Customers — request body — body

FieldTypePresenceDescription and constraints
$objectRootDefines the body parameters that can be included in requests to the
[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint.
customersobjectRequired within parentA map of 1 to 100 individual create requests, represented by `idempotency key: { customer data }`
key-value pairs.

Each key is an [idempotency key](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)
that uniquely identifies the create request. Each value contains the customer data used to create the
customer profile.
Additional keys: see wildcard field
customers.*ModelAdditional keysExpand Bulk Create Customers — request body — body customers value

Referenced models: Bulk Create Customers — request body — body customers value

Bulk Create Customers — request body — body customers value

FieldTypePresenceDescription and constraints
$objectRootDefines the customer data provided in individual create requests for a
[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) operation.
addressJSONOptional
address (anyOf 1)ModelAlternativeExpand Create Customer — request body — body address
The physical address associated with the customer profile. For maximum length constraints,
see [Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address).
The `first_name` and `last_name` fields are ignored if they are present in the request.
address (anyOf 2)nullAlternative
birthdayJSONOptional
birthday (anyOf 1)stringAlternativeThe birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format.
For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21.
Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or
`0000` if a birth year is not specified.
birthday (anyOf 2)nullAlternative
company_nameJSONOptional
company_name (anyOf 1)stringAlternativeA business name associated with the customer profile.
Maximum length: 500
company_name (anyOf 2)nullAlternative
email_addressJSONOptional
email_address (anyOf 1)stringAlternativeThe email address associated with the customer profile.
Maximum length: 254
email_address (anyOf 2)nullAlternative
family_nameJSONOptional
family_name (anyOf 1)stringAlternativeThe family name (that is, the last name) associated with the customer profile.
Maximum length: 300
family_name (anyOf 2)nullAlternative
given_nameJSONOptional
given_name (anyOf 1)stringAlternativeThe given name (that is, the first name) associated with the customer profile.
Maximum length: 300
given_name (anyOf 2)nullAlternative
nicknameJSONOptional
nickname (anyOf 1)stringAlternativeA nickname for the customer profile.
Maximum length: 100
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. The phone number must be valid
and can contain 9–16 digits, with an optional `+` prefix and country code. For more information,
see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number).
phone_number (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.
Maximum length: 100
reference_id (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 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).
tax_ids (anyOf 2)nullAlternative

Referenced models: Create Customer — request body — body address, Create Customer — request body — body tax ids

Bulk Create Customers — response body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields included in the response body from the
[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint.
errorsarrayOptionalAny top-level errors that prevented the bulk operation from running.
errors[]ModelEach itemExpand Get Shift — response body — errors item
responsesobjectOptionalA map of responses that correspond to individual create requests, represented by
key-value pairs.

Each key is the idempotency key that was provided for a create request and each value
is the corresponding response.
If the request succeeds, the value is the new customer profile.
If the request fails, the value contains any errors that occurred during the request.
Additional keys: see wildcard field
responses.*ModelAdditional keysExpand Create Customer — response body

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

Bulk Delete Customers — request body — body

FieldTypePresenceDescription and constraints
$objectRootDefines the body parameters that can be included in requests to the
[BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) endpoint.
customer_idsarrayRequired within parentThe IDs of the [customer profiles](entity:Customer) to delete.
customer_ids[]stringEach item

Bulk Delete Customers — response body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields included in the response body from the
[BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) endpoint.
errorsarrayOptionalAny top-level errors that prevented the bulk operation from running.
errors[]ModelEach itemExpand Get Shift — response body — errors item
responsesobjectOptionalA map of responses that correspond to individual delete requests, represented by
key-value pairs.

Each key is the customer ID that was specified for a delete request and each value
is the corresponding response.
If the request succeeds, the value is an empty object (`{ }`).
If the request fails, the value contains any errors that occurred during the request.
Additional keys: see wildcard field
responses.*ModelAdditional keysExpand Delete Customer — response body

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

Bulk Retrieve Customers — request body — body

FieldTypePresenceDescription and constraints
$objectRootDefines the body parameters that can be included in requests to the
[BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) endpoint.
customer_idsarrayRequired within parentThe IDs of the [customer profiles](entity:Customer) to retrieve.
customer_ids[]stringEach item

Bulk Retrieve Customers — response body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields included in the response body from the
[BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) endpoint.
errorsarrayOptionalAny top-level errors that prevented the bulk operation from running.
errors[]ModelEach itemExpand Get Shift — response body — errors item
responsesobjectOptionalA map of responses that correspond to individual retrieve requests, represented by
key-value pairs.

Each key is the customer ID that was specified for a retrieve request and each value
is the corresponding response.
If the request succeeds, the value is the requested customer profile.
If the request fails, the value contains any errors that occurred during the request.
Additional keys: see wildcard field
responses.*ModelAdditional keysExpand Retrieve Customer — response body

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

Bulk Update Customers — request body — body

FieldTypePresenceDescription and constraints
$objectRootDefines the body parameters that can be included in requests to the
[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint.
customersobjectRequired within parentA map of 1 to 100 individual update requests, represented by `customer ID: { customer data }`
key-value pairs.

Each key is the ID of the [customer profile](entity:Customer) to update. To update a customer profile
that was created by merging existing profiles, provide the ID of the newly created profile.

Each value contains the updated customer data. Only new or changed fields are required. To add or
update a field, specify the new value. To remove a field, specify `null`.
Additional keys: see wildcard field
customers.*ModelAdditional keysExpand Bulk Update Customers — request body — body customers value

Referenced models: Bulk Update Customers — request body — body customers value

Bulk Update Customers — request body — body customers value

FieldTypePresenceDescription and constraints
$objectRootDefines the customer data provided in individual update requests for a
[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) operation.
addressJSONOptional
address (anyOf 1)ModelAlternativeExpand Create Customer — request body — body address
The physical address associated with the customer profile. For maximum length constraints,
see [Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address).
The `first_name` and `last_name` fields are ignored if they are present in the request.
address (anyOf 2)nullAlternative
birthdayJSONOptional
birthday (anyOf 1)stringAlternativeThe birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format.
For example, specify `1998-09-21` for September 21, 1998, or `09-21` for September 21.
Birthdays are returned in `YYYY-MM-DD` format, where `YYYY` is the specified birth year or
`0000` if a birth year is not specified.
birthday (anyOf 2)nullAlternative
company_nameJSONOptional
company_name (anyOf 1)stringAlternativeA business name associated with the customer profile.
Maximum length: 500
company_name (anyOf 2)nullAlternative
email_addressJSONOptional
email_address (anyOf 1)stringAlternativeThe email address associated with the customer profile.
Maximum length: 254
email_address (anyOf 2)nullAlternative
family_nameJSONOptional
family_name (anyOf 1)stringAlternativeThe family name (that is, the last name) associated with the customer profile.
Maximum length: 300
family_name (anyOf 2)nullAlternative
given_nameJSONOptional
given_name (anyOf 1)stringAlternativeThe given name (that is, the first name) associated with the customer profile.
Maximum length: 300
given_name (anyOf 2)nullAlternative
nicknameJSONOptional
nickname (anyOf 1)stringAlternativeA nickname for the customer profile.
Maximum length: 100
nickname (anyOf 2)nullAlternative
noteJSONOptional
note (anyOf 1)stringAlternativeAn custom note associates with the customer profile.
note (anyOf 2)nullAlternative
phone_numberJSONOptional
phone_number (anyOf 1)stringAlternativeThe phone number associated with the customer profile. The phone number must be valid
and can contain 9–16 digits, with an optional `+` prefix and country code. For more information,
see [Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number).
phone_number (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.
Maximum length: 100
reference_id (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 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).
tax_ids (anyOf 2)nullAlternative
versionJSONOptional
version (anyOf 1)integerAlternativeThe current version of the customer profile.

As a best practice, you should include this field to enable
[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
control.
Format: int64
Minimum: -9223372036854775808
Maximum: 9223372036854775807
version (anyOf 2)stringAlternativePattern: ^(?:-(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-8]))))))))))))))))|-[1-9][0-9]{0,17}|0|(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-7]))))))))))))))))|[1-9][0-9]{0,17})$(?!\n)

Referenced models: Create Customer — request body — body address, Create Customer — request body — body tax ids

Bulk Update Customers — response body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields included in the response body from the
[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint.
errorsarrayOptionalAny top-level errors that prevented the bulk operation from running.
errors[]ModelEach itemExpand Get Shift — response body — errors item
responsesobjectOptionalA map of responses that correspond to individual update requests, represented by
key-value pairs.

Each key is the customer ID that was specified for an update request and each value
is the corresponding response.
If the request succeeds, the value is the updated customer profile.
If the request fails, the value contains any errors that occurred during the request.
Additional keys: see wildcard field
responses.*ModelAdditional keysExpand Update Customer — response body

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

Create Customer Card — request body — body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields that are included in the request body of a request
to the `CreateCustomerCard` endpoint.
billing_addressModelOptionalExpand Create Customer — request body — body address
Address information for the card on file.

__NOTE:__ If a billing address is provided in the request, the
`CreateCustomerCardRequest.billing_address.postal_code` must match
the postal code encoded in the card nonce.
card_noncestringRequired within parentA card nonce representing the credit card to link to the customer.

Card nonces are generated by the Square payment form when customers enter
their card information. For more information, see
[Walkthrough: Integrate Square Payments in a Website](https://developer.squareup.com/docs/web-payments/take-card-payment).

__NOTE:__ Card nonces generated by digital wallets (such as Apple Pay)
cannot be used to create a customer card.
cardholder_namestringOptionalThe full name printed on the credit card.
verification_tokenstringOptionalAn identifying token generated by [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer).
Verification tokens encapsulate customer device information and 3-D Secure
challenge results to indicate that Square has verified the buyer identity.

Referenced models: Create Customer — request body — body address

Create Customer Card — response body

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

Either `errors` or `card` is present in a given response (never both).
cardModelOptionalExpand Create Card — response body — card
The created card on file.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item

Referenced models: Create Card — response body — card, Get Shift — response body — errors item

Create Customer — request body — body

FieldTypePresenceDescription and constraints
$objectRootDefines the body parameters that can be included in a request to the
`CreateCustomer` endpoint.
addressModelOptionalExpand Create Customer — request body — body address
The physical address associated with the customer profile. For maximum length constraints, see
[Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address).
The `first_name` and `last_name` fields are ignored if they are present in the request.
birthdaystringOptionalThe birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example,
specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in `YYYY-MM-DD`
format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified.
company_namestringOptionalA business name associated with the customer profile.

The maximum length for this value is 500 characters.
email_addressstringOptionalThe email address associated with the customer profile.

The maximum length for this value is 254 characters.
family_namestringOptionalThe family name (that is, the last name) associated with the customer profile.

The maximum length for this value is 300 characters.
given_namestringOptionalThe given name (that is, the first name) associated with the customer profile.

The maximum length for this value is 300 characters.
idempotency_keystringOptionalThe idempotency key for the request. For more information, see
[Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
nicknamestringOptionalA nickname for the customer profile.

The maximum length for this value is 100 characters.
notestringOptionalA custom note associated with the customer profile.
phone_numberstringOptionalThe phone number associated with the customer profile. The phone number must be valid and can contain
9–16 digits, with an optional `+` prefix and country code. For more information, see
[Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number).
reference_idstringOptionalAn optional second ID used to associate the customer profile with an
entity in another system.

The maximum length for this value is 100 characters.
tax_idsModelOptionalExpand Create Customer — request body — body tax ids
The tax ID associated with the customer profile. This 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).

Referenced models: Create Customer — request body — body address, Create Customer — request body — body tax ids

Create Customer — request body — body address

FieldTypePresenceDescription and constraints
$objectRootRepresents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).
address_line_1JSONOptional
address_line_1 (anyOf 1)stringAlternativeThe first line of the address.

Fields that start with `address_line` provide the address's most specific
details, like street number, street name, and building name. They do *not*
provide less specific details like city, state/province, or country (these
details are provided in other fields).
address_line_1 (anyOf 2)nullAlternative
address_line_2JSONOptional
address_line_2 (anyOf 1)stringAlternativeThe second line of the address, if any.
address_line_2 (anyOf 2)nullAlternative
address_line_3JSONOptional
address_line_3 (anyOf 1)stringAlternativeThe third line of the address, if any.
address_line_3 (anyOf 2)nullAlternative
administrative_district_level_1JSONOptional
administrative_district_level_1 (anyOf 1)stringAlternativeA civil entity within the address's country. In the US, this
is the state. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).
administrative_district_level_1 (anyOf 2)nullAlternative
administrative_district_level_2JSONOptional
administrative_district_level_2 (anyOf 1)stringAlternativeA civil entity within the address's `administrative_district_level_1`.
In the US, this is the county.
administrative_district_level_2 (anyOf 2)nullAlternative
administrative_district_level_3JSONOptional
administrative_district_level_3 (anyOf 1)stringAlternativeA civil entity within the address's `administrative_district_level_2`,
if any.
administrative_district_level_3 (anyOf 2)nullAlternative
countryJSONOptional
country (anyOf 1)ModelAlternativeExpand Create Location — request body — body location country
The address's country, in the two-letter format of ISO 3166. For example, `US` or `FR`.
See [Country](#type-country) for possible values
country (anyOf 2)nullAlternative
first_nameJSONOptional
first_name (anyOf 1)stringAlternativeOptional first name when it's representing recipient.
first_name (anyOf 2)nullAlternative
last_nameJSONOptional
last_name (anyOf 1)stringAlternativeOptional last name when it's representing recipient.
last_name (anyOf 2)nullAlternative
localityJSONOptional
locality (anyOf 1)stringAlternativeThe city or town of the address. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).
locality (anyOf 2)nullAlternative
postal_codeJSONOptional
postal_code (anyOf 1)stringAlternativeThe address's postal code. For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).
postal_code (anyOf 2)nullAlternative
sublocalityJSONOptional
sublocality (anyOf 1)stringAlternativeA civil region within the address's `locality`, if any.
sublocality (anyOf 2)nullAlternative
sublocality_2JSONOptional
sublocality_2 (anyOf 1)stringAlternativeA civil region within the address's `sublocality`, if any.
sublocality_2 (anyOf 2)nullAlternative
sublocality_3JSONOptional
sublocality_3 (anyOf 1)stringAlternativeA civil region within the address's `sublocality_2`, if any.
sublocality_3 (anyOf 2)nullAlternative

Referenced models: Create Location — request body — body location country

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

Create Customer — response body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields that are included in the response body of
a request to the [CreateCustomer](api-endpoint:Customers-CreateCustomer) or
[BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint.

Either `errors` or `customer` is present in a given response (never both).
customerModelOptionalExpand Create Customer — response body — customer
The created 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

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

Delete Customer Card — response body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields that are included in the response body of
a request to the `DeleteCustomerCard` endpoint.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item

Referenced models: Get Shift — response body — errors item

Delete Customer — request body — query

FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
versionJSONOptional
version (anyOf 1)integerAlternativeFormat: int64
Minimum: -9223372036854775808
Maximum: 9223372036854775807
version (anyOf 2)stringAlternativePattern: ^(?:-(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-8]))))))))))))))))|-[1-9][0-9]{0,17}|0|(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-7]))))))))))))))))|[1-9][0-9]{0,17})$(?!\n)

Delete Customer — response body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields that are included in the response body of
a request to the `DeleteCustomer` endpoint.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item

Referenced models: Get Shift — response body — errors item

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

Remove Group From Customer — response body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields that are included in the response body of
a request to the [RemoveGroupFromCustomer](api-endpoint:Customers-RemoveGroupFromCustomer)
endpoint.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item

Referenced models: Get Shift — response body — errors item

Retrieve Customer — response body

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

Either `errors` or `customer` is present in a given response (never both).
customerModelOptionalExpand Create Customer — response body — customer
The requested 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

Search Customers — request body — body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields that are included in the request body of a request to the
`SearchCustomers` endpoint.
countbooleanOptionalIndicates whether to return the total count of matching customers in the `count` field of the response.

The default value is `false`.
cursorstringOptionalInclude the pagination cursor in subsequent calls to this endpoint to retrieve
the next set of results associated with the original query.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
limitJSONOptional
limit (anyOf 1)integerAlternativeThe maximum number of results to return in a single page. This limit is advisory. The response might contain more or fewer results.
If the specified limit is invalid, Square returns a `400 VALUE_TOO_LOW` or `400 VALUE_TOO_HIGH` error. The default value is 100.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
Format: int64
Maximum: 100
Minimum: 1
limit (anyOf 2)stringAlternativePattern: ^(?:100|[1-9][0-9]{0,1})$(?!\n)
queryModelOptionalExpand Search Customers — request body — body query
The filtering and sorting criteria for the search request. If a query is not specified,
Square returns all customer profiles ordered alphabetically by `given_name` and `family_name`.

Referenced models: Search Customers — request body — body query

Search Customers — request body — body query

FieldTypePresenceDescription and constraints
$objectRootRepresents filtering and sorting criteria for a [SearchCustomers](api-endpoint:Customers-SearchCustomers) request.
filterJSONOptional
filter (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at
The filtering criteria for the search query. A query can contain multiple filters in any combination.
Multiple filters are combined as `AND` statements.

__Note:__ Combining multiple filters as `OR` statements is not supported. Instead, send multiple single-filter
searches and join the result sets.
filter (anyOf 2)nullAlternative
sortJSONOptional
sort (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query sort field, order
Sorting criteria for query results. The default behavior is to sort
customers alphabetically by `given_name` and `family_name`.
sort (anyOf 2)nullAlternative

Referenced models: Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at, Search Customers — request body — body query sort field, order

Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at

FieldTypePresenceDescription and constraints
$objectRootRepresents the filtering criteria in a [search query](entity:CustomerQuery) that defines how to filter
customer profiles returned in [SearchCustomers](api-endpoint:Customers-SearchCustomers) results.
created_atModelOptionalExpand Search Availability — request body — body query filter start at range
A filter to select customers based on when they were created.
creation_sourceJSONOptional
creation_source (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at creation source The creation source filter
A filter to select customers based on their creation source.
creation_source (anyOf 2)nullAlternative
custom_attributeJSONOptional
custom_attribute (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters
A filter to select customers based on one or more custom attributes.
This filter can contain up to 10 custom attribute filters. Each custom attribute filter specifies filtering criteria for a target custom
attribute. If multiple custom attribute filters are provided, they are combined as an `AND` operation.

To be valid for a search, the custom attributes must be visible to the requesting application. For more information, including example queries,
see [Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute).

Square returns matching customer profiles, which do not contain custom attributes. To retrieve customer-related custom attributes,
use the [Customer Custom Attributes API](api:CustomerCustomAttributes). For example, you can call
[RetrieveCustomerCustomAttribute](api-endpoint:CustomerCustomAttributes-RetrieveCustomerCustomAttribute) using a customer ID from the result set.
custom_attribute (anyOf 2)nullAlternative
email_addressJSONOptional
email_address (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at phone number exact, fuzzy
A filter to [select customers by their email address](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-email-address)
visible to the seller.
This filter is case-insensitive.

For [exact matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-email-address), this
filter causes the search to return customer profiles
whose `email_address` field value are identical to the email address provided
in the query.

For [fuzzy matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-email-address),
this filter causes the search to return customer profiles
whose `email_address` field value has a token-wise partial match against the filtering
expression in the query. For example, with `Steven gmail` provided in a search
query, the search returns customers whose email address is `steven.johnson@example.com`
or `mygmail@example.com`. Square removes any punctuation (including periods (.),
underscores (_), and the @ symbol) and tokenizes the email addresses on spaces. A match is
found if a tokenized email address contains all the tokens in the search query,
irrespective of the token order.
email_address (anyOf 2)nullAlternative
group_idsJSONOptional
group_ids (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at group ids all, any, none
A filter to select customers based on the [groups](entity:CustomerGroup) they belong to.
Group membership is controlled by sellers and developers.

The `group_ids` filter has the following syntax:
```
"group_ids": {
"any": ["{group_a_id}", "{group_b_id}", ...],
"all": ["{group_1_id}", "{group_2_id}", ...],
"none": ["{group_i_id}", "{group_ii_id}", ...]
}
```

You can use any combination of the `any`, `all`, and `none` fields in the filter.
With `any`, the search returns customers in groups `a` or `b` or any other group specified in the list.
With `all`, the search returns customers in groups `1` and `2` and all other groups specified in the list.
With `none`, the search returns customers not in groups `i` or `ii` or any other group specified in the list.

If any of the search conditions are not met, including when an invalid or non-existent group ID is provided,
the result is an empty object (`{}`).
group_ids (anyOf 2)nullAlternative
phone_numberJSONOptional
phone_number (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at phone number exact, fuzzy
A filter to [select customers by their phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-phone-number)
visible to the seller.

For [exact matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-phone-number),
this filter returns customers whose phone number matches the specified query expression. The number in the query must be of an
E.164-compliant form. In particular, it must include the leading `+` sign followed by a country code and then a subscriber number.
For example, the standard E.164 form of a US phone number is `+12062223333` and an E.164-compliant variation is `+1 (206) 222-3333`.
To match the query expression, stored customer phone numbers are converted to the standard E.164 form.

For [fuzzy matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-phone-number),
this filter returns customers whose phone number matches the token or tokens provided in the query expression. For example, with `415`
provided in a search query, the search returns customers with the phone numbers `+1-415-212-1200`, `+1-212-415-1234`, and `+1 (551) 234-1567`.
Similarly, a search query of `415 123` returns customers with the phone numbers `+1-212-415-1234` and `+1 (551) 234-1567` but not
`+1-212-415-1200`. A match is found if a tokenized phone number contains all the tokens in the search query, irrespective of the token order.
phone_number (anyOf 2)nullAlternative
reference_idJSONOptional
reference_id (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at phone number exact, fuzzy
A filter to [select customers by their reference IDs](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-reference-id).
This filter is case-insensitive.

[Exact matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#exact-search-by-reference-id)
of a customer's reference ID against a query's reference ID is evaluated as an
exact match between two strings, character by character in the given order.

[Fuzzy matching](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#fuzzy-search-by-reference-id)
of stored reference IDs against queried reference IDs works
exactly the same as fuzzy matching on email addresses. Non-alphanumeric characters
are replaced by spaces to tokenize stored and queried reference IDs. A match is found
if a tokenized stored reference ID contains all tokens specified in any order in the query. For example,
a query of `NYC M` matches customer profiles with the `reference_id` value of `NYC_M_35_JOHNSON`
and `NYC_27_MURRAY`.
reference_id (anyOf 2)nullAlternative
segment_idsJSONOptional
segment_ids (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at group ids all, any, none
A filter to select customers based on the [segments](entity:CustomerSegment) they belong to.
Segment membership is dynamic and adjusts automatically based on whether customers meet the segment criteria.

You can provide up to three segment IDs in the filter, using any combination of the `all`, `any`, and `none` fields.
For the following example, the results include customers who belong to both segment A and segment B but do not belong to segment C.

```
"segment_ids": {
"all": ["{segment_A_id}", "{segment_B_id}"],
"none": ["{segment_C_id}"]
}
```

If an invalid or non-existent segment ID is provided in the filter, Square stops processing the request
and returns a `400 BAD_REQUEST` error that includes the segment ID.
segment_ids (anyOf 2)nullAlternative
updated_atModelOptionalExpand Search Availability — request body — body query filter start at range
A filter to select customers based on when they were last updated.

Referenced models: Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at creation source The creation source filter, Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters, Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at phone number exact, fuzzy, Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at group ids all, any, none, Search Availability — request body — body query filter start at range

Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at creation source The creation source filter

FieldTypePresenceDescription and constraints
$objectRootThe creation source filter.

If one or more creation sources are set, customer profiles are included in,
or excluded from, the result if they match at least one of the filter criteria.
ruleJSONOptional
rule (anyOf 1)stringAlternativeIndicates whether customers should be included in, or excluded from,
the result set when they match the filtering criteria.
Indicates whether a customer profile matching the filter criteria
should be included in the result or excluded from the result.

Default: `INCLUDE`.
See [CustomerInclusionExclusion](#type-customerinclusionexclusion) for possible values
One of: INCLUDE, EXCLUDE
rule (anyOf 2)nullAlternative
valuesJSONOptional
values (anyOf 1)arrayAlternativeThe list of creation sources used as filtering criteria.
See [CustomerCreationSource](#type-customercreationsource) for possible values
values (anyOf 1)[]stringEach itemIndicates the method used to create the customer profile.
One of: 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
values (anyOf 2)nullAlternative

Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters

FieldTypePresenceDescription and constraints
$objectRootThe custom attribute filters in a set of [customer filters](entity:CustomerFilter) used in a search query. Use this filter
to search based on [custom attributes](entity:CustomAttribute) that are assigned to customer profiles. For more information, see
[Search by custom attribute](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#search-by-custom-attribute).
filtersJSONOptional
filters (anyOf 1)arrayAlternativeThe custom attribute filters. Each filter must specify `key` and include the `filter` field with a type-specific filter,
the `updated_at` field, or both. The provided keys must be unique within the list of custom attribute filters.
filters (anyOf 1)[]ModelEach itemExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters filters array item
filters (anyOf 2)nullAlternative

Referenced models: Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters filters array item

Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters filters array item

FieldTypePresenceDescription and constraints
$objectRootThe custom attribute filter. Use this filter in a set of [custom attribute filters](entity:CustomerCustomAttributeFilters) to search
based on the value or last updated date of a customer-related [custom attribute](entity:CustomAttribute).
filterJSONOptional
filter (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters filters array item filter address, boolean, date, email, number, phone, selection, text
A filter that corresponds to the data type of the target custom attribute. For example, provide the `phone` filter to
search based on the value of a `PhoneNumber`-type custom attribute. The data type is specified by the schema field of the custom attribute definition,
which can be retrieved using the [Customer Custom Attributes API](api:CustomerCustomAttributes).

You must provide this `filter` field, the `updated_at` field, or both.
filter (anyOf 2)nullAlternative
keystringRequired within parentThe `key` of the [custom attribute](entity:CustomAttribute) to filter by. The key is the identifier of the custom attribute
(and the corresponding custom attribute definition) and can be retrieved using the [Customer Custom Attributes API](api:CustomerCustomAttributes).
updated_atModelOptionalExpand Search Availability — request body — body query filter start at range
The date range for when the custom attribute was last updated. The date range can include `start_at`, `end_at`, or
both. Range boundaries are inclusive. Dates are specified as RFC 3339 timestamps.

You must provide this `updated_at` field, the `filter` field, or both.

Referenced models: Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters filters array item filter address, boolean, date, email, number, phone, selection, text, Search Availability — request body — body query filter start at range

Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters filters array item filter address, boolean, date, email, number, phone, selection, text

FieldTypePresenceDescription and constraints
$objectRootA type-specific filter used in a [custom attribute filter](entity:CustomerCustomAttributeFilter) to search based on the value
of a customer-related [custom attribute](entity:CustomAttribute).
addressJSONOptional
address (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters filters array item filter address, boolean, date, email, number, phone, selection, text address country, postal code
A filter for a query based on the value of an `Address`-type custom attribute. The filter can include `postal_code`, `country`, or both.
address (anyOf 2)nullAlternative
booleanJSONOptional
boolean (anyOf 1)booleanAlternativeA filter for a query based on the value of a `Boolean`-type custom attribute.
boolean (anyOf 2)nullAlternative
dateJSONOptional
date (anyOf 1)ModelAlternativeExpand Search Availability — request body — body query filter start at range
A filter for a query based on the value of a `Date`-type custom attribute.

Provide a date range for this filter using `start_at`, `end_at`, or both. Range boundaries are inclusive. Dates can be specified
in `YYYY-MM-DD` format or as RFC 3339 timestamps.
date (anyOf 2)nullAlternative
emailJSONOptional
email (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at phone number exact, fuzzy
A filter for a query based on the value of an `Email`-type custom attribute. This filter is case-insensitive and can
include `exact` or `fuzzy`, but not both.

For an `exact` match, provide the complete email address.

For a `fuzzy` match, provide a query expression containing one or more query tokens to match against the email address. Square removes
any punctuation (including periods (.), underscores (_), and the @ symbol) and tokenizes the email addresses on spaces. A match is found
if a tokenized email address contains all the tokens in the search query, irrespective of the token order. For example, `Steven gmail`
matches steven.jones@example.com and mygmail@example.com.
email (anyOf 2)nullAlternative
numberJSONOptional
number (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters filters array item filter address, boolean, date, email, number, phone, selection, text number Specifies a decimal number range
A filter for a query based on the value of a `Number`-type custom attribute, which can be an integer or a decimal with up to
5 digits of precision.

Provide a numerical range for this filter using `start_at`, `end_at`, or both. Range boundaries are inclusive. Numbers are specified
as decimals or integers. The absolute value of range boundaries must not exceed `(2^63-1)/10^5`, or 92233720368547.
number (anyOf 2)nullAlternative
phoneJSONOptional
phone (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at phone number exact, fuzzy
A filter for a query based on the value of a `PhoneNumber`-type custom attribute. This filter is case-insensitive and
can include `exact` or `fuzzy`, but not both.

For an `exact` match, provide the complete phone number. This is always an E.164-compliant phone number that starts
with the + sign followed by the country code and subscriber number. For example, the format for a US phone number is +12061112222.

For a `fuzzy` match, provide a query expression containing one or more query tokens to match against the phone number.
Square removes any punctuation and tokenizes the expression on spaces. A match is found if a tokenized phone number contains
all the tokens in the search query, irrespective of the token order. For example, `415 123 45` is tokenized to `415`, `123`, and `45`,
which matches +14151234567 and +12345674158, but does not match +1234156780. Similarly, the expression `415` matches
+14151234567, +12345674158, and +1234156780.
phone (anyOf 2)nullAlternative
selectionJSONOptional
selection (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at group ids all, any, none
A filter for a query based on the display name for a `Selection`-type custom attribute value. This filter is case-sensitive
and can contain `any`, `all`, or both. The `none` condition is not supported.

Provide the display name of each item that you want to search for. To find the display names for the selection, use the
[Customer Custom Attributes API](api:CustomerCustomAttributes) to retrieve the corresponding custom attribute definition
and then check the `schema.items.names` field. For more information, see
[Search based on selection](https://developer.squareup.com/docs/customers-api/use-the-api/search-customers#custom-attribute-value-filter-selection).

Note that when a `Selection`-type custom attribute is assigned to a customer profile, the custom attribute value is a list of one
or more UUIDs (sourced from the `schema.items.enum` field) that map to the item names. These UUIDs are unique per seller.
selection (anyOf 2)nullAlternative
textJSONOptional
text (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at phone number exact, fuzzy
A filter for a query based on the value of a `String`-type custom attribute. This filter is case-insensitive and
can include `exact` or `fuzzy`, but not both.

For an `exact` match, provide the complete string.

For a `fuzzy` match, provide a query expression containing one or more query tokens in any order that contain complete words
to match against the string. Square tokenizes the expression using a grammar-based tokenizer. For example, the expressions `quick brown`,
`brown quick`, and `quick fox` match "The quick brown fox jumps over the lazy dog". However, `quick foxes` and `qui` do not match.
text (anyOf 2)nullAlternative

Referenced models: Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters filters array item filter address, boolean, date, email, number, phone, selection, text address country, postal code, Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at phone number exact, fuzzy, Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at group ids all, any, none, Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters filters array item filter address, boolean, date, email, number, phone, selection, text number Specifies a decimal number range, Search Availability — request body — body query filter start at range

Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters filters array item filter address, boolean, date, email, number, phone, selection, text address country, postal code

FieldTypePresenceDescription and constraints
$objectRootThe customer address filter. This filter is used in a [CustomerCustomAttributeFilterValue](entity:CustomerCustomAttributeFilterValue) filter when
searching by an `Address`-type custom attribute.
countryJSONOptional
country (anyOf 1)ModelAlternativeExpand Create Location — request body — body location country
The country code to search for.
See [Country](#type-country) for possible values
country (anyOf 2)nullAlternative
postal_codeJSONOptional
postal_code (anyOf 1)ModelAlternativeExpand Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at phone number exact, fuzzy
The postal code to search for. Only an `exact` match is supported.
postal_code (anyOf 2)nullAlternative

Referenced models: Create Location — request body — body location country, Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at phone number exact, fuzzy

Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at custom attribute filters filters array item filter address, boolean, date, email, number, phone, selection, text number Specifies a decimal number range

FieldTypePresenceDescription and constraints
$objectRootSpecifies a decimal number range.
end_atJSONOptional
end_at (anyOf 1)stringAlternativeA decimal value indicating where the range ends.
end_at (anyOf 2)nullAlternative
start_atJSONOptional
start_at (anyOf 1)stringAlternativeA decimal value indicating where the range starts.
start_at (anyOf 2)nullAlternative

Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at group ids all, any, none

FieldTypePresenceDescription and constraints
$objectRootA filter to select resources based on an exact field value. For any given
value, the value can only be in one property. Depending on the field, either
all properties can be set or only a subset will be available.

Refer to the documentation of the field.
allJSONOptional
all (anyOf 1)arrayAlternativeA list of terms that must be present on the field of the resource.
all (anyOf 1)[]stringEach item
all (anyOf 2)nullAlternative
anyJSONOptional
any (anyOf 1)arrayAlternativeA list of terms where at least one of them must be present on the
field of the resource.
any (anyOf 1)[]stringEach item
any (anyOf 2)nullAlternative
noneJSONOptional
none (anyOf 1)arrayAlternativeA list of terms that must not be present on the field the resource
none (anyOf 1)[]stringEach item
none (anyOf 2)nullAlternative

Search Customers — request body — body query filter created at, creation source, custom attribute, email address, group ids, phone number, reference id, segment ids, updated at phone number exact, fuzzy

FieldTypePresenceDescription and constraints
$objectRootA filter to select customers based on exact or fuzzy matching of
customer attributes against a specified query. Depending on the customer attributes,
the filter can be case-sensitive. This filter can be exact or fuzzy, but it cannot be both.
exactJSONOptional
exact (anyOf 1)stringAlternativeUse the exact filter to select customers whose attributes match exactly the specified query.
exact (anyOf 2)nullAlternative
fuzzyJSONOptional
fuzzy (anyOf 1)stringAlternativeUse the fuzzy filter to select customers whose attributes match the specified query
in a fuzzy manner. When the fuzzy option is used, search queries are tokenized, and then
each query token must be matched somewhere in the searched attribute. For single token queries,
this is effectively the same behavior as a partial match operation.
fuzzy (anyOf 2)nullAlternative

Search Customers — request body — body query sort field, order

FieldTypePresenceDescription and constraints
$objectRootRepresents the sorting criteria in a [search query](entity:CustomerQuery) that defines how to sort
customer profiles returned in [SearchCustomers](api-endpoint:Customers-SearchCustomers) results.
fieldJSONOptional
field (anyOf 1)stringAlternativeSpecifies customer attributes as the sort key to customer profiles returned from a search.
Indicates the fields to use as the sort key, which is either the default set of fields or `created_at`.

The default value is `DEFAULT`.
See [CustomerSortField](#type-customersortfield) for possible values
One of: DEFAULT, CREATED_AT
field (anyOf 2)nullAlternative
orderJSONOptional
order (anyOf 1)stringAlternativeThe order (e.g., chronological or alphabetical) in which results from a request are returned.
Indicates the order in which results should be sorted based on the
sort field value. Strings use standard alphabetic comparison
to determine order. Strings representing numbers are sorted as strings.

The default value is `ASC`.
See [SortOrder](#type-sortorder) for possible values
One of: DESC, ASC
order (anyOf 2)nullAlternative

Search Customers — response body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields that are included in the response body of
a request to the `SearchCustomers` 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 that match the search query. 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 that can be used during subsequent calls
to `SearchCustomers` to retrieve the next set of results associated
with the original query. Pagination cursors are only present when
a request succeeds and additional results are available.

For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
customersarrayOptionalThe customer profiles that match the search query. If any search condition is not met, the result is an empty object (`{}`).
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

Update Customer — request body — body

FieldTypePresenceDescription and constraints
$objectRootDefines the body parameters that can be included in a request to the
`UpdateCustomer` endpoint.
addressJSONOptional
address (anyOf 1)ModelAlternativeExpand Create Customer — request body — body address
The physical address associated with the customer profile. Only new or changed fields are required in the request.

For maximum length constraints, see [Customer addresses](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#address).
The `first_name` and `last_name` fields are ignored if they are present in the request.
address (anyOf 2)nullAlternative
birthdayJSONOptional
birthday (anyOf 1)stringAlternativeThe birthday associated with the customer profile, in `YYYY-MM-DD` or `MM-DD` format. For example,
specify `1998-09-21` for September 21, 1998, or `09-21` for September 21. Birthdays are returned in `YYYY-MM-DD`
format, where `YYYY` is the specified birth year or `0000` if a birth year is not specified.
birthday (anyOf 2)nullAlternative
company_nameJSONOptional
company_name (anyOf 1)stringAlternativeA business name associated with the customer profile.

The maximum length for this value is 500 characters.
company_name (anyOf 2)nullAlternative
email_addressJSONOptional
email_address (anyOf 1)stringAlternativeThe email address associated with the customer profile.

The maximum length for this value is 254 characters.
email_address (anyOf 2)nullAlternative
family_nameJSONOptional
family_name (anyOf 1)stringAlternativeThe family name (that is, the last name) associated with the customer profile.

The maximum length for this value is 300 characters.
family_name (anyOf 2)nullAlternative
given_nameJSONOptional
given_name (anyOf 1)stringAlternativeThe given name (that is, the first name) associated with the customer profile.

The maximum length for this value is 300 characters.
given_name (anyOf 2)nullAlternative
nicknameJSONOptional
nickname (anyOf 1)stringAlternativeA nickname for the customer profile.

The maximum length for this value is 100 characters.
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. The phone number must be valid and can contain
9–16 digits, with an optional `+` prefix and country code. For more information, see
[Customer phone numbers](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#phone-number).
phone_number (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.

The maximum length for this value is 100 characters.
reference_id (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 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).
tax_ids (anyOf 2)nullAlternative
versionJSONOptional
version (anyOf 1)integerAlternativeThe current version of the customer profile.

As a best practice, you should include this field to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For more information, see [Update a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#update-a-customer-profile).
Format: int64
Minimum: -9223372036854775808
Maximum: 9223372036854775807
version (anyOf 2)stringAlternativePattern: ^(?:-(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-8]))))))))))))))))|-[1-9][0-9]{0,17}|0|(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-7]))))))))))))))))|[1-9][0-9]{0,17})$(?!\n)

Referenced models: Create Customer — request body — body address, Create Customer — request body — body tax ids

Update Customer — response body

FieldTypePresenceDescription and constraints
$objectRootDefines the fields that are included in the response body of
a request to the [UpdateCustomer](api-endpoint:Customers-UpdateCustomer) or
[BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint.

Either `errors` or `customer` is present in a given response (never both).
customerModelOptionalExpand Create Customer — response body — customer
The updated 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

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.