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

> Updates a subscription by modifying or clearing `subscription` field values.

`square.updateSubscription` updates a subscription by modifying or clearing `subscription` field values.

## Example

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

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

  square.updateSubscription({
    subscriptionId: "subscription_id",
    subscription: {
      cardId: "{NEW CARD ID}",
    },
  })
})
```

## Inputs

Every input accepts a compatible signal. It requires `CUSTOMERS_READ` and `INVOICES_WRITE` and `ITEMS_READ` and `ORDERS_WRITE` and `PAYMENTS_WRITE` and `SUBSCRIPTIONS_WRITE`.

| Field            | Type                  | Required | Default | Description                                                                                                                                                                                                             |
| ---------------- | --------------------- | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `subscriptionId` | `string`              | Yes      | —       | The ID of the subscription to update.                                                                                                                                                                                   |
| `subscription`   | `Square.Subscription` | No       | —       | The subscription object containing the current version, and fields to update. Unset fields will be left at their current server values, and JSON `null` values will be treated as a request to clear the relevant data. |

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

## Output

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