Skip to content

Square: Update Booking Custom Attribute Definition

Square bookingCustomAttributes.updateBookingCustomAttributeDefinition: arguments, response, policy and SDK examples.

← Booking custom attributes operations · Get started

Operation square.updatebookingcustomattributedefinition

Provider route: PUT /v2/bookings/custom-attribute-definitions/{key}. 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["bookingCustomAttributes"]["updateBookingCustomAttributeDefinition"]>[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.bookingCustomAttributes.updateBookingCustomAttributeDefinition(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.booking_custom_attributes.update_booking_custom_attribute_definition(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.keystringRequired within parent
bodyModelRequired within parentExpand Update Booking Custom Attribute Definition — request body — body

Referenced models: Update Booking Custom Attribute Definition — 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 Update Booking Custom Attribute Definition — response body

Referenced models: Update Booking Custom Attribute Definition — response body

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

Update Booking Custom Attribute Definition — response body
FieldTypePresenceDescription and constraints
$objectRootRepresents an [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) response.
Either `custom_attribute_definition` or `errors` is present in the response.
custom_attribute_definitionModelOptionalExpand Create Order Custom Attribute Definition — response body — custom attribute definition
The updated custom attribute definition.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item

Referenced models: Create Order Custom Attribute Definition — response body — custom attribute definition, Get Shift — response body — errors item

Update Booking Custom Attribute Definition — request body — body
FieldTypePresenceDescription and constraints
$objectRootRepresents an [UpdateBookingCustomAttributeDefinition](api-endpoint:BookingCustomAttributes-UpdateBookingCustomAttributeDefinition) request.
custom_attribute_definitionModelRequired within parentExpand Create Order Custom Attribute Definition — request body — body custom attribute definition
The custom attribute definition that contains the fields to update. Only the following fields can be updated:
- `name`
- `description`
- `visibility`
- `schema` for a `Selection` data type. Only changes to the named options or the maximum number of allowed
selections are supported.

For more information, see
[Updatable definition fields](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attribute-definitions#updatable-definition-fields).

To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency)
control, include the optional `version` field and specify the current version of the custom attribute definition.
idempotency_keyJSONOptional
idempotency_key (anyOf 1)stringAlternativeA unique identifier for this request, used to ensure idempotency. For more information,
see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
Maximum length: 45
idempotency_key (anyOf 2)nullAlternative

Referenced models: Create Order Custom Attribute Definition — request body — body custom attribute definition

Create Order Custom Attribute Definition — response body — custom attribute definition
FieldTypePresenceDescription and constraints
$objectRootRepresents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute.
created_atstringOptionalThe timestamp that indicates when the custom attribute definition was created, in RFC 3339 format.
Read only: true
descriptionJSONOptional
description (anyOf 1)stringAlternativeSeller-oriented description of the custom attribute definition, including any constraints
that the seller should observe. May be displayed as a tooltip in Square UIs. This field is
required if the `visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
Maximum length: 255
description (anyOf 2)nullAlternative
keyJSONOptional
key (anyOf 1)stringAlternativeThe identifier
of the custom attribute definition and its corresponding custom attributes. This value
can be a simple key, which is the key that is provided when the custom attribute definition
is created, or a qualified key, if the requesting
application is not the definition owner. The qualified key consists of the application ID
of the custom attribute definition owner
followed by the simple key that was provided when the definition was created. It has the
format application_id:simple key.

The value for a simple key can contain up to 60 alphanumeric characters, periods (.),
underscores (_), and hyphens (-).

This field can not be changed
after the custom attribute definition is created. This field is required when creating
a definition and must be unique per application, seller, and resource type.
Minimum length: 1
Pattern: ^([a-zA-Z0-9\._-]+:)?[a-zA-Z0-9\._-]{1,60}$
key (anyOf 2)nullAlternative
nameJSONOptional
name (anyOf 1)stringAlternativeThe name of the custom attribute definition for API and seller-facing UI purposes. The name must
be unique within the seller and application pair. This field is required if the
`visibility` field is `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
Maximum length: 255
name (anyOf 2)nullAlternative
schemaJSONOptional
schema (anyOf 1)objectAlternativeThe JSON schema for the custom attribute definition, which determines the data type of the corresponding custom attributes. For more information,
see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). This field is required when creating a definition.
schema (anyOf 2)nullAlternative
updated_atstringOptionalThe timestamp that indicates when the custom attribute definition was created or most recently updated,
in RFC 3339 format.
Read only: true
versionJSONOptional
version (anyOf 1)integerAlternativeRead only. The current version of the custom attribute definition.
The value is incremented each time the custom attribute definition is updated.
When updating a custom attribute definition, you can provide this field
and specify the current version of the custom attribute definition to enable
[optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency).

On writes, this field must be set to the latest version. Stale writes are rejected.

This field can also be used to enforce strong consistency for reads. For more information about strong consistency for reads,
see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview).
version (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
visibilityJSONOptional
visibility (anyOf 1)stringAlternativeThe level of permission that a seller or other applications requires to
view this custom attribute definition.
The `Visibility` field controls who can read and write the custom attribute values
and custom attribute definition.
Specifies how the custom attribute definition and its values should be shared with
the seller and other applications. If no value is specified, the value defaults to `VISIBILITY_HIDDEN`.
See [Visibility](#type-visibility) for possible values
Known values: VISIBILITY_HIDDEN, VISIBILITY_READ_ONLY, VISIBILITY_READ_WRITE_VALUES
visibility (anyOf 2)nullAlternative
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

SDK function policy ID: square.updatebookingcustomattributedefinition. Catalog operation: UpdateBookingCustomAttributeDefinition. 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: ["APPOINTMENTS_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.