> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Update Location Custom Attribute Definition

> Updates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.

`square.updateLocationCustomAttributeDefinition` updates a location-related [custom attribute definition](entity:CustomAttributeDefinition) for a Square seller account.

## Example

```ts automations/square-update-location-custom-attribute-definition.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { square } from "automate.ax/square"

export default automation(
  "Update Square Location Custom Attribute Definition",
  () => {
    onDashboardRun({
      title: "Update Square Location Custom Attribute Definition",
    })

    square.updateLocationCustomAttributeDefinition({
      key: "key",
      customAttributeDefinition: {
        description: "Update the description as desired.",
        visibility: "VISIBILITY_READ_ONLY",
      },
    })
  },
)
```

## Inputs

Every input accepts a compatible signal. It requires `MERCHANT_PROFILE_WRITE`.

| Field                       | Type                               | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------------------- | ---------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `key`                       | `string`                           | Yes      | —       | The key of the custom attribute definition to update.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `customAttributeDefinition` | `Square.CustomAttributeDefinition` | Yes      | —       | The custom attribute definition that contains the fields to update. This endpoint supports sparse updates, so only new or changed fields need to be included in the request. 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 [Update a location custom attribute definition](https://developer.squareup.com/docs/location-custom-attributes-api/custom-attribute-definitions#update-custom-attribute-definition). To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control, specify the current version of the custom attribute definition. If this is not important for your application, `version` can be set to -1. |
| `idempotencyKey`            | `string \| null`                   | No       | —       | A 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).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

Use the official [UpdateLocationCustomAttributeDefinition reference](https://developer.squareup.com/reference/square/location-custom-attributes-api/update-location-custom-attribute-definition) for provider field semantics and limits.

## Output

Returns the official `Square.UpdateLocationCustomAttributeDefinitionResponse` response as a codec-safe object. Square integer money amounts remain `bigint` values.
