> ## 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 Booking Custom Attribute Definition

> Creates a bookings custom attribute definition.

`square.createBookingCustomAttributeDefinition` creates a bookings custom attribute definition.

## Example

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

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

    square.createBookingCustomAttributeDefinition({
      customAttributeDefinition: {},
    })
  },
)
```

## Inputs

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

| Field                       | Type                               | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| --------------------------- | ---------------------------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `customAttributeDefinition` | `Square.CustomAttributeDefinition` | Yes      | —       | The custom attribute definition to create, with the following fields: - `key` - `name`. If provided, `name` must be unique (case-sensitive) across all visible booking-related custom attribute definitions for the seller. - `description` - `visibility`. Note that all custom attributes are visible in exported booking data, including those set to `VISIBILITY_HIDDEN`. - `schema`. 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, see [Specifying the schema](https://developer.squareup.com/docs/booking-custom-attributes-api/custom-attribute-definitions#specify-schema). |
| `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 [CreateBookingCustomAttributeDefinition reference](https://developer.squareup.com/reference/square/booking-custom-attributes-api/create-booking-custom-attribute-definition) for provider field semantics and limits.

## Output

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