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

# Cancel Transfer Order

> Cancels a transfer order in [STARTED](entity:TransferOrderStatus) or [PARTIALLY_RECEIVED](entity:TransferOrderStatus) status.

`square.cancelTransferOrder` cancels a transfer order in [STARTED](entity:TransferOrderStatus) or [PARTIALLY\_RECEIVED](entity:TransferOrderStatus) status.

## Example

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

export default automation("Cancel Square Transfer Order", () => {
  onDashboardRun({ title: "Cancel Square Transfer Order" })

  square.cancelTransferOrder({
    transferOrderId: "transfer_order_id",
    idempotencyKey: "65cc0586-3e82-4d08-b524-3885cffd52",
    version: BigInt("1753117449752"),
  })
})
```

## Inputs

Every input accepts a compatible signal. It requires `INVENTORY_READ` and `INVENTORY_WRITE`.

| Field             | Type     | Required | Default | Description                                                                                                                                              |
| ----------------- | -------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `transferOrderId` | `string` | Yes      | —       | The ID of the transfer order to cancel. Must be in STARTED or PARTIALLY\_RECEIVED status.                                                                |
| `idempotencyKey`  | `string` | Yes      | —       | A unique string that identifies this UpdateTransferOrder request. Keys can be any valid string but must be unique for every UpdateTransferOrder request. |
| `version`         | `bigint` | No       | —       | Version for optimistic concurrency                                                                                                                       |

Use the official [CancelTransferOrder reference](https://developer.squareup.com/reference/square/transfer-order-api/cancel-transfer-order) for provider field semantics and limits.

## Output

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