> ## 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.

# Create Location Custom Attribute Definition

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

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

## Example

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

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

    square.createLocationCustomAttributeDefinition({
      customAttributeDefinition: {
        key: "bestseller",
        schema: {
          $ref: "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String",
        },
        name: "Bestseller",
        description: "Bestselling item at location",
        visibility: "VISIBILITY_READ_WRITE_VALUES",
      },
    })
  },
)
```

## Inputs

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

| Field                       | Type                               | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------------------- | ---------------------------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `customAttributeDefinition` | `Square.CustomAttributeDefinition` | Yes      | —       | The custom attribute definition to create. Note the following: - With the exception of the `Selection` data type, the `schema` is specified as a simple URL to the JSON schema definition hosted on the Square CDN. For more information, including supported values and constraints, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). - `name` is required unless `visibility` is set to `VISIBILITY_HIDDEN`. |
| `idempotencyKey`            | `string`                           | 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 [CreateLocationCustomAttributeDefinition reference](https://developer.squareup.com/reference/square/location-custom-attributes-api/create-location-custom-attribute-definition) for provider field semantics and limits.

## Output

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