> ## 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 Inventory Adjustment

> Applies an update to the provided adjustment.

`square.updateInventoryAdjustment` applies an update to the provided adjustment.

## Example

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

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

  square.updateInventoryAdjustment({
    idempotencyKey: "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe",
    adjustment: {},
  })
})
```

## Inputs

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

| Field            | Type                         | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------------- | ---------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `idempotencyKey` | `string`                     | Yes      | —       | A client-supplied, universally unique identifier (UUID) for the request. See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the [Build Basics](https://developer.squareup.com/docs/buildbasics) section for more information.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `adjustment`     | `Square.InventoryAdjustment` | Yes      | —       | Represents the updates being written to a past/existing inventory adjustment. This works using sparse updates, meaning that any fields omitted from the inputted InventoryAdjustment will retain their values. Only updates to the quantity, cost\_money, vendor\_id, and reason\_id fields of an InventoryAdjustment can be made here. Note that the quantity field must be provided, but it can be identical to the current quantity if there are no desired quantity changes. cost\_money and vendor\_id can only be written to adjustments that add stock to the system (from\_state of NONE or UNLINKED\_RETURN) and to untracked sale adjustments. reason\_id can be changed to any reason that is valid for the adjustment's state transition. The reason of a system-generated adjustment (for example, SALE or RECOUNT) cannot be changed. Adjustments generated by Square from other records cannot be updated. This includes inferred adjustments created by physical counts, transfer-like cross-location adjustments, and component adjustments. Adjustments linked to purchase orders cannot be updated. Adjustments linked to sales can only have cost\_money and vendor\_id updated, and only for untracked sales. Restock adjustments linked to an itemized return can have their quantity updated, up to the quantity remaining on the return. Adjustments older than one year cannot be updated. |

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

## Output

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