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

> Updates a customer profile.

`square.updateCustomer` updates a customer profile.

## Example

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

export default automation("Update Square Customer", () => {
  onDashboardRun({ title: "Update Square Customer" })

  square.updateCustomer({
    customerId: "customer_id",
    emailAddress: "New.Amelia.Earhart@example.com",
    note: "updated customer note",
    version: BigInt("2"),
  })
})
```

## Inputs

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

| Field          | Type                    | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                          |
| -------------- | ----------------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `customerId`   | `string`                | Yes      | —       | The ID of the customer to update.                                                                                                                                                                                                                                                                                                                                                                    |
| `givenName`    | `string \| null`        | No       | —       | The given name (that is, the first name) associated with the customer profile. The maximum length for this value is 300 characters.                                                                                                                                                                                                                                                                  |
| `familyName`   | `string \| null`        | No       | —       | The family name (that is, the last name) associated with the customer profile. The maximum length for this value is 300 characters.                                                                                                                                                                                                                                                                  |
| `companyName`  | `string \| null`        | No       | —       | A business name associated with the customer profile. The maximum length for this value is 500 characters.                                                                                                                                                                                                                                                                                           |
| `nickname`     | `string \| null`        | No       | —       | A nickname for the customer profile. The maximum length for this value is 100 characters.                                                                                                                                                                                                                                                                                                            |
| `emailAddress` | `string \| null`        | No       | —       | The email address associated with the customer profile. The maximum length for this value is 254 characters.                                                                                                                                                                                                                                                                                         |
| `address`      | `Square.Address`        | No       | —       | The physical address associated with the customer profile. Only new or changed fields are required in the request. 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.                                             |
| `phoneNumber`  | `string \| null`        | No       | —       | The 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).                                                                                        |
| `referenceId`  | `string \| null`        | No       | —       | An optional second ID used to associate the customer profile with an entity in another system. The maximum length for this value is 100 characters.                                                                                                                                                                                                                                                  |
| `note`         | `string \| null`        | No       | —       | A custom note associated with the customer profile.                                                                                                                                                                                                                                                                                                                                                  |
| `birthday`     | `string \| null`        | No       | —       | The 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.                                                                                     |
| `version`      | `bigint`                | No       | —       | The current version of the customer profile. As a best practice, you should include this field to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. For more information, see [Update a customer profile](https://developer.squareup.com/docs/customers-api/use-the-api/keep-records#update-a-customer-profile). |
| `taxIds`       | `Square.CustomerTaxIds` | No       | —       | 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).                                                                                                                         |

Use the official [UpdateCustomer reference](https://developer.squareup.com/reference/square/customers-api/update-customer) for provider field semantics and limits.

## Output

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