Skip to content

Square: Bulk Create Customers

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

← Customers operations · Get started

Operation square.bulkcreatecustomers

Provider route: POST /v2/customers/bulk-create. Alter supplies the connection’s credentials and routing.

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

import { App } from "@alter-ai/sdk";
import { SquareIntegration } from "@alter-ai/square";
async function execute(input: Parameters<SquareIntegration["customers"]["bulkCreateCustomers"]>[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.bulkCreateCustomers(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_square import SquareIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = SquareIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.customers.bulk_create_customers(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyModelRequired within parentExpand Bulk Create Customers — request body — body

Referenced models: Bulk Create Customers — request body — body

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

FieldTypePresenceDescription and constraints
$ModelRootExpand Bulk Create Customers — response body

Referenced models: Bulk Create Customers — response body

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

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 — 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 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

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

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

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

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

Create Customer — 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 Location — request body — body location country
FieldTypePresenceDescription and constraints
$stringRootIndicates the country associated with another entity, such as a business.
Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm).
One of: ZZ, AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, YE, YT, ZA, ZM, ZW

SDK function policy ID: square.bulkcreatecustomers. Catalog operation: BulkCreateCustomers. 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"}

Official provider source

Report an issue with this page

Necessary

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

Always active

Analytics

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

Performance diagnostics

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

Advertising

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

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