Square: Customers schemas
40 Square schemas with complete fields and constraints.
← Customers operations · All schemas
Add Group To Customer — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields that are included in the response body of a request to the [AddGroupToCustomer](api-endpoint:Customers-AddGroupToCustomer) endpoint. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Get Shift — response body — errors item
Bulk Create Customers — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the body parameters that can be included in requests to the [BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint. |
customers | object | Required within parent | A 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.* | Model | Additional keys | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the customer data provided in individual create requests for a [BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) operation. |
address | JSON | Optional | |
address (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
birthday | JSON | Optional | |
birthday (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
company_name | JSON | Optional | |
company_name (anyOf 1) | string | Alternative | A business name associated with the customer profile. Maximum length: 500 |
company_name (anyOf 2) | null | Alternative | |
email_address | JSON | Optional | |
email_address (anyOf 1) | string | Alternative | The email address associated with the customer profile. Maximum length: 254 |
email_address (anyOf 2) | null | Alternative | |
family_name | JSON | Optional | |
family_name (anyOf 1) | string | Alternative | The family name (that is, the last name) associated with the customer profile. Maximum length: 300 |
family_name (anyOf 2) | null | Alternative | |
given_name | JSON | Optional | |
given_name (anyOf 1) | string | Alternative | The given name (that is, the first name) associated with the customer profile. Maximum length: 300 |
given_name (anyOf 2) | null | Alternative | |
nickname | JSON | Optional | |
nickname (anyOf 1) | string | Alternative | A nickname for the customer profile. Maximum length: 100 |
nickname (anyOf 2) | null | Alternative | |
note | JSON | Optional | |
note (anyOf 1) | string | Alternative | A custom note associated with the customer profile. |
note (anyOf 2) | null | Alternative | |
phone_number | JSON | Optional | |
phone_number (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
reference_id | JSON | Optional | |
reference_id (anyOf 1) | string | Alternative | An optional second ID used to associate the customer profile with an entity in another system. Maximum length: 100 |
reference_id (anyOf 2) | null | Alternative | |
tax_ids | JSON | Optional | |
tax_ids (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative |
Referenced models: Create Customer — request body — body address, Create Customer — request body — body tax ids
Bulk Create Customers — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields included in the response body from the [BulkCreateCustomers](api-endpoint:Customers-BulkCreateCustomers) endpoint. |
errors | array | Optional | Any top-level errors that prevented the bulk operation from running. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
responses | object | Optional | A 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.* | Model | Additional keys | Expand Create Customer — response body |
Referenced models: Create Customer — response body, Get Shift — response body — errors item
Bulk Delete Customers — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the body parameters that can be included in requests to the [BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) endpoint. |
customer_ids | array | Required within parent | The IDs of the [customer profiles](entity:Customer) to delete. |
customer_ids[] | string | Each item |
Bulk Delete Customers — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields included in the response body from the [BulkDeleteCustomers](api-endpoint:Customers-BulkDeleteCustomers) endpoint. |
errors | array | Optional | Any top-level errors that prevented the bulk operation from running. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
responses | object | Optional | A 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.* | Model | Additional keys | Expand Delete Customer — response body |
Referenced models: Delete Customer — response body, Get Shift — response body — errors item
Bulk Retrieve Customers — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the body parameters that can be included in requests to the [BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) endpoint. |
customer_ids | array | Required within parent | The IDs of the [customer profiles](entity:Customer) to retrieve. |
customer_ids[] | string | Each item |
Bulk Retrieve Customers — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields included in the response body from the [BulkRetrieveCustomers](api-endpoint:Customers-BulkRetrieveCustomers) endpoint. |
errors | array | Optional | Any top-level errors that prevented the bulk operation from running. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
responses | object | Optional | A 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.* | Model | Additional keys | Expand Retrieve Customer — response body |
Referenced models: Get Shift — response body — errors item, Retrieve Customer — response body
Bulk Update Customers — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the body parameters that can be included in requests to the [BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint. |
customers | object | Required within parent | A 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.* | Model | Additional keys | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the customer data provided in individual update requests for a [BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) operation. |
address | JSON | Optional | |
address (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
birthday | JSON | Optional | |
birthday (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
company_name | JSON | Optional | |
company_name (anyOf 1) | string | Alternative | A business name associated with the customer profile. Maximum length: 500 |
company_name (anyOf 2) | null | Alternative | |
email_address | JSON | Optional | |
email_address (anyOf 1) | string | Alternative | The email address associated with the customer profile. Maximum length: 254 |
email_address (anyOf 2) | null | Alternative | |
family_name | JSON | Optional | |
family_name (anyOf 1) | string | Alternative | The family name (that is, the last name) associated with the customer profile. Maximum length: 300 |
family_name (anyOf 2) | null | Alternative | |
given_name | JSON | Optional | |
given_name (anyOf 1) | string | Alternative | The given name (that is, the first name) associated with the customer profile. Maximum length: 300 |
given_name (anyOf 2) | null | Alternative | |
nickname | JSON | Optional | |
nickname (anyOf 1) | string | Alternative | A nickname for the customer profile. Maximum length: 100 |
nickname (anyOf 2) | null | Alternative | |
note | JSON | Optional | |
note (anyOf 1) | string | Alternative | An custom note associates with the customer profile. |
note (anyOf 2) | null | Alternative | |
phone_number | JSON | Optional | |
phone_number (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
reference_id | JSON | Optional | |
reference_id (anyOf 1) | string | Alternative | An optional second ID used to associate the customer profile with an entity in another system. Maximum length: 100 |
reference_id (anyOf 2) | null | Alternative | |
tax_ids | JSON | Optional | |
tax_ids (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
version | JSON | Optional | |
version (anyOf 1) | integer | Alternative | The 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) | string | Alternative | Pattern: ^(?:-(?: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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields included in the response body from the [BulkUpdateCustomers](api-endpoint:Customers-BulkUpdateCustomers) endpoint. |
errors | array | Optional | Any top-level errors that prevented the bulk operation from running. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
responses | object | Optional | A 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.* | Model | Additional keys | Expand Update Customer — response body |
Referenced models: Get Shift — response body — errors item, Update Customer — response body
Create Customer Card — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields that are included in the request body of a request to the `CreateCustomerCard` endpoint. |
billing_address | Model | Optional | Expand 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_nonce | string | Required within parent | A 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_name | string | Optional | The full name printed on the credit card. |
verification_token | string | Optional | An 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines 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). |
card | Model | Optional | Expand Create Card — response body — card The created card on file. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Card — response body — card, Get Shift — response body — errors item
Create Customer — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the body parameters that can be included in a request to the `CreateCustomer` endpoint. |
address | Model | Optional | Expand 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. |
birthday | string | Optional | The 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_name | string | Optional | A business name associated with the customer profile. The maximum length for this value is 500 characters. |
email_address | string | Optional | The email address associated with the customer profile. The maximum length for this value is 254 characters. |
family_name | string | Optional | The family name (that is, the last name) associated with the customer profile. The maximum length for this value is 300 characters. |
given_name | string | Optional | The given name (that is, the first name) associated with the customer profile. The maximum length for this value is 300 characters. |
idempotency_key | string | Optional | The idempotency key for the request. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). |
nickname | string | Optional | A nickname for the customer profile. The maximum length for this value is 100 characters. |
note | string | Optional | A custom note associated with the customer profile. |
phone_number | string | Optional | The 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_id | string | Optional | An 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_ids | Model | Optional | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents 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_1 | JSON | Optional | |
address_line_1 (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
address_line_2 | JSON | Optional | |
address_line_2 (anyOf 1) | string | Alternative | The second line of the address, if any. |
address_line_2 (anyOf 2) | null | Alternative | |
address_line_3 | JSON | Optional | |
address_line_3 (anyOf 1) | string | Alternative | The third line of the address, if any. |
address_line_3 (anyOf 2) | null | Alternative | |
administrative_district_level_1 | JSON | Optional | |
administrative_district_level_1 (anyOf 1) | string | Alternative | A 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) | null | Alternative | |
administrative_district_level_2 | JSON | Optional | |
administrative_district_level_2 (anyOf 1) | string | Alternative | A civil entity within the address's `administrative_district_level_1`. In the US, this is the county. |
administrative_district_level_2 (anyOf 2) | null | Alternative | |
administrative_district_level_3 | JSON | Optional | |
administrative_district_level_3 (anyOf 1) | string | Alternative | A civil entity within the address's `administrative_district_level_2`, if any. |
administrative_district_level_3 (anyOf 2) | null | Alternative | |
country | JSON | Optional | |
country (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
first_name | JSON | Optional | |
first_name (anyOf 1) | string | Alternative | Optional first name when it's representing recipient. |
first_name (anyOf 2) | null | Alternative | |
last_name | JSON | Optional | |
last_name (anyOf 1) | string | Alternative | Optional last name when it's representing recipient. |
last_name (anyOf 2) | null | Alternative | |
locality | JSON | Optional | |
locality (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
postal_code | JSON | Optional | |
postal_code (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
sublocality | JSON | Optional | |
sublocality (anyOf 1) | string | Alternative | A civil region within the address's `locality`, if any. |
sublocality (anyOf 2) | null | Alternative | |
sublocality_2 | JSON | Optional | |
sublocality_2 (anyOf 1) | string | Alternative | A civil region within the address's `sublocality`, if any. |
sublocality_2 (anyOf 2) | null | Alternative | |
sublocality_3 | JSON | Optional | |
sublocality_3 (anyOf 1) | string | Alternative | A civil region within the address's `sublocality_2`, if any. |
sublocality_3 (anyOf 2) | null | Alternative |
Referenced models: Create Location — request body — body location country
Create Customer — request body — body tax ids
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents 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_vat | JSON | Optional | |
eu_vat (anyOf 1) | string | Alternative | The EU VAT identification number for the customer. For example, `IE3426675K`. The ID can contain alphanumeric characters only. Maximum length: 20 |
eu_vat (anyOf 2) | null | Alternative |
Create Customer — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines 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). |
customer | Model | Optional | Expand Create Customer — response body — customer The created customer. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Customer — response body — customer, Get Shift — response body — errors item
Create Customer — response body — customer
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a Square customer profile in the Customer Directory of a Square seller. |
address | JSON | Optional | |
address (anyOf 1) | Model | Alternative | Expand Get Payment — response body — payment billing address The physical address associated with the customer profile. |
address (anyOf 2) | null | Alternative | |
birthday | JSON | Optional | |
birthday (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
company_name | JSON | Optional | |
company_name (anyOf 1) | string | Alternative | A business name associated with the customer profile. |
company_name (anyOf 2) | null | Alternative | |
created_at | string | Optional | The timestamp when the customer profile was created, in RFC 3339 format. Read only: true |
creation_source | JSON | Optional | |
creation_source (anyOf 1) | string | Alternative | Indicates 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) | null | Alternative | |
email_address | JSON | Optional | |
email_address (anyOf 1) | string | Alternative | The email address associated with the customer profile. |
email_address (anyOf 2) | null | Alternative | |
family_name | JSON | Optional | |
family_name (anyOf 1) | string | Alternative | The family name (that is, the last name) associated with the customer profile. |
family_name (anyOf 2) | null | Alternative | |
given_name | JSON | Optional | |
given_name (anyOf 1) | string | Alternative | The given name (that is, the first name) associated with the customer profile. |
given_name (anyOf 2) | null | Alternative | |
group_ids | JSON | Optional | |
group_ids (anyOf 1) | array | Alternative | The IDs of [customer groups](entity:CustomerGroup) the customer belongs to. |
group_ids (anyOf 1)[] | string | Each item | |
group_ids (anyOf 2) | null | Alternative | |
id | string | Optional | A 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. |
nickname | JSON | Optional | |
nickname (anyOf 1) | string | Alternative | A nickname for the customer profile. |
nickname (anyOf 2) | null | Alternative | |
note | JSON | Optional | |
note (anyOf 1) | string | Alternative | A custom note associated with the customer profile. |
note (anyOf 2) | null | Alternative | |
phone_number | JSON | Optional | |
phone_number (anyOf 1) | string | Alternative | The phone number associated with the customer profile. |
phone_number (anyOf 2) | null | Alternative | |
preferences | JSON | Optional | |
preferences (anyOf 1) | Model | Alternative | Expand Create Customer — response body — customer preferences email unsubscribed Represents general customer preferences. |
preferences (anyOf 2) | null | Alternative | |
reference_id | JSON | Optional | |
reference_id (anyOf 1) | string | Alternative | An optional second ID used to associate the customer profile with an entity in another system. |
reference_id (anyOf 2) | null | Alternative | |
segment_ids | JSON | Optional | |
segment_ids (anyOf 1) | array | Alternative | The IDs of [customer segments](entity:CustomerSegment) the customer belongs to. |
segment_ids (anyOf 1)[] | string | Each item | |
segment_ids (anyOf 2) | null | Alternative | |
tax_ids | JSON | Optional | |
tax_ids (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
updated_at | string | Optional | The timestamp when the customer profile was last updated, in RFC 3339 format. Read only: true |
version | JSON | Optional | |
version (anyOf 1) | integer | Alternative | The 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) | string | Alternative | Pattern: ^-?[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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents communication preferences for the customer profile. |
email_unsubscribed | JSON | Optional | |
email_unsubscribed (anyOf 1) | boolean | Alternative | Indicates 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) | null | Alternative |
Delete Customer Card — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields that are included in the response body of a request to the `DeleteCustomerCard` endpoint. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Get Shift — response body — errors item
Delete Customer — request body — query
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
version | JSON | Optional | |
version (anyOf 1) | integer | Alternative | Format: int64 Minimum: -9223372036854775808 Maximum: 9223372036854775807 |
version (anyOf 2) | string | Alternative | Pattern: ^(?:-(?: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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields that are included in the response body of a request to the `DeleteCustomer` endpoint. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Get Shift — response body — errors item
List Customers — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines 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). |
count | JSON | Optional | |
count (anyOf 1) | integer | Alternative | The 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) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
cursor | string | Optional | A 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). |
customers | array | Optional | The 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[] | Model | Each item | Expand Create Customer — response body — customer |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields that are included in the response body of a request to the [RemoveGroupFromCustomer](api-endpoint:Customers-RemoveGroupFromCustomer) endpoint. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Get Shift — response body — errors item
Retrieve Customer — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines 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). |
customer | Model | Optional | Expand Create Customer — response body — customer The requested customer. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Customer — response body — customer, Get Shift — response body — errors item
Search Customers — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields that are included in the request body of a request to the `SearchCustomers` endpoint. |
count | boolean | Optional | Indicates whether to return the total count of matching customers in the `count` field of the response. The default value is `false`. |
cursor | string | Optional | Include 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). |
limit | JSON | Optional | |
limit (anyOf 1) | integer | Alternative | The 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) | string | Alternative | Pattern: ^(?:100|[1-9][0-9]{0,1})$(?!\n) |
query | Model | Optional | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents filtering and sorting criteria for a [SearchCustomers](api-endpoint:Customers-SearchCustomers) request. |
filter | JSON | Optional | |
filter (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
sort | JSON | Optional | |
sort (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents 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_at | Model | Optional | Expand Search Availability — request body — body query filter start at range A filter to select customers based on when they were created. |
creation_source | JSON | Optional | |
creation_source (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
custom_attribute | JSON | Optional | |
custom_attribute (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
email_address | JSON | Optional | |
email_address (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
group_ids | JSON | Optional | |
group_ids (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
phone_number | JSON | Optional | |
phone_number (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
reference_id | JSON | Optional | |
reference_id (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
segment_ids | JSON | Optional | |
segment_ids (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
updated_at | Model | Optional | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The 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. |
rule | JSON | Optional | |
rule (anyOf 1) | string | Alternative | Indicates 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) | null | Alternative | |
values | JSON | Optional | |
values (anyOf 1) | array | Alternative | The list of creation sources used as filtering criteria. See [CustomerCreationSource](#type-customercreationsource) for possible values |
values (anyOf 1)[] | string | Each item | Indicates 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) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The 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). |
filters | JSON | Optional | |
filters (anyOf 1) | array | Alternative | The 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)[] | Model | Each item | Expand 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) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The 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). |
filter | JSON | Optional | |
filter (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
key | string | Required within parent | The `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_at | Model | Optional | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A 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). |
address | JSON | Optional | |
address (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
boolean | JSON | Optional | |
boolean (anyOf 1) | boolean | Alternative | A filter for a query based on the value of a `Boolean`-type custom attribute. |
boolean (anyOf 2) | null | Alternative | |
date | JSON | Optional | |
date (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
email | JSON | Optional | |
email (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
number | JSON | Optional | |
number (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
phone | JSON | Optional | |
phone (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
selection | JSON | Optional | |
selection (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
text | JSON | Optional | |
text (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The customer address filter. This filter is used in a [CustomerCustomAttributeFilterValue](entity:CustomerCustomAttributeFilterValue) filter when searching by an `Address`-type custom attribute. |
country | JSON | Optional | |
country (anyOf 1) | Model | Alternative | Expand Create Location — request body — body location country The country code to search for. See [Country](#type-country) for possible values |
country (anyOf 2) | null | Alternative | |
postal_code | JSON | Optional | |
postal_code (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Specifies a decimal number range. |
end_at | JSON | Optional | |
end_at (anyOf 1) | string | Alternative | A decimal value indicating where the range ends. |
end_at (anyOf 2) | null | Alternative | |
start_at | JSON | Optional | |
start_at (anyOf 1) | string | Alternative | A decimal value indicating where the range starts. |
start_at (anyOf 2) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A 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. |
all | JSON | Optional | |
all (anyOf 1) | array | Alternative | A list of terms that must be present on the field of the resource. |
all (anyOf 1)[] | string | Each item | |
all (anyOf 2) | null | Alternative | |
any | JSON | Optional | |
any (anyOf 1) | array | Alternative | A list of terms where at least one of them must be present on the field of the resource. |
any (anyOf 1)[] | string | Each item | |
any (anyOf 2) | null | Alternative | |
none | JSON | Optional | |
none (anyOf 1) | array | Alternative | A list of terms that must not be present on the field the resource |
none (anyOf 1)[] | string | Each item | |
none (anyOf 2) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A 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. |
exact | JSON | Optional | |
exact (anyOf 1) | string | Alternative | Use the exact filter to select customers whose attributes match exactly the specified query. |
exact (anyOf 2) | null | Alternative | |
fuzzy | JSON | Optional | |
fuzzy (anyOf 1) | string | Alternative | Use 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) | null | Alternative |
Search Customers — request body — body query sort field, order
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the sorting criteria in a [search query](entity:CustomerQuery) that defines how to sort customer profiles returned in [SearchCustomers](api-endpoint:Customers-SearchCustomers) results. |
field | JSON | Optional | |
field (anyOf 1) | string | Alternative | Specifies 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) | null | Alternative | |
order | JSON | Optional | |
order (anyOf 1) | string | Alternative | The 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) | null | Alternative |
Search Customers — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines 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). |
count | JSON | Optional | |
count (anyOf 1) | integer | Alternative | The 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) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
cursor | string | Optional | A 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). |
customers | array | Optional | The 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[] | Model | Each item | Expand Create Customer — response body — customer |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Customer — response body — customer, Get Shift — response body — errors item
Update Customer — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the body parameters that can be included in a request to the `UpdateCustomer` endpoint. |
address | JSON | Optional | |
address (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
birthday | JSON | Optional | |
birthday (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
company_name | JSON | Optional | |
company_name (anyOf 1) | string | Alternative | A business name associated with the customer profile. The maximum length for this value is 500 characters. |
company_name (anyOf 2) | null | Alternative | |
email_address | JSON | Optional | |
email_address (anyOf 1) | string | Alternative | The email address associated with the customer profile. The maximum length for this value is 254 characters. |
email_address (anyOf 2) | null | Alternative | |
family_name | JSON | Optional | |
family_name (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
given_name | JSON | Optional | |
given_name (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
nickname | JSON | Optional | |
nickname (anyOf 1) | string | Alternative | A nickname for the customer profile. The maximum length for this value is 100 characters. |
nickname (anyOf 2) | null | Alternative | |
note | JSON | Optional | |
note (anyOf 1) | string | Alternative | A custom note associated with the customer profile. |
note (anyOf 2) | null | Alternative | |
phone_number | JSON | Optional | |
phone_number (anyOf 1) | string | Alternative | The 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) | null | Alternative | |
reference_id | JSON | Optional | |
reference_id (anyOf 1) | string | Alternative | An 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) | null | Alternative | |
tax_ids | JSON | Optional | |
tax_ids (anyOf 1) | Model | Alternative | Expand 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) | null | Alternative | |
version | JSON | Optional | |
version (anyOf 1) | integer | Alternative | The 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) | string | Alternative | Pattern: ^(?:-(?: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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines 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). |
customer | Model | Optional | Expand Create Customer — response body — customer The updated customer. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Customer — response body — customer, Get Shift — response body — errors item