Square: Bulk Update Customers
Square customers.bulkUpdateCustomers: arguments, response, policy and SDK examples.
← Customers operations · Get started
Operation square.bulkupdatecustomers
Provider route: POST /v2/customers/bulk-update. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/square with npm, or alter-sdk-square with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { SquareIntegration } from "@alter-ai/square";
async function execute(input: Parameters<SquareIntegration["customers"]["bulkUpdateCustomers"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new SquareIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.customers.bulkUpdateCustomers(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_square import SquareIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = SquareIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.customers.bulk_update_customers(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | Model | Required within parent | Expand Bulk Update Customers — request body — body |
Referenced models: Bulk Update Customers — request body — body
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Bulk Update Customers — response body |
Referenced models: Bulk Update Customers — response body
Schemas
Section titled “Schemas”8 more schemas are linked from the tables above, on the schema pages.
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 — 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
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
Get Shift — response body — errors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an error encountered during a request to the Connect API. See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information. |
category | string | Required within parent | Indicates which high-level category of error has occurred during a request to the Connect API. The high-level category for the error. See [ErrorCategory](#type-errorcategory) for possible values Known values: API_ERROR, AUTHENTICATION_ERROR, INVALID_REQUEST_ERROR, RATE_LIMIT_ERROR, PAYMENT_METHOD_ERROR, REFUND_ERROR, MERCHANT_SUBSCRIPTION_ERROR, EXTERNAL_VENDOR_ERROR |
code | Model | Required within parent | Expand Get Shift — response body — errors item code The specific code of the error. See [ErrorCode](#type-errorcode) for possible values |
detail | string | Optional | A human-readable description of the error for debugging purposes. |
field | string | Optional | The name of the field provided in the original request (if any) that the error pertains to. |
Referenced models: Get Shift — response body — errors item code
Create Customer — response body — customer preferences email unsubscribed
| 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 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.bulkupdatecustomers. Catalog operation: BulkUpdateCustomers. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["CUSTOMERS_WRITE"]
Pinned headers: {"Square-Version": "2026-11-18"}