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

# Batch Retrieve Inventory Changes

> Returns historical physical counts and adjustments based on the provided filter criteria.

`square.batchRetrieveInventoryChanges` returns historical physical counts and adjustments based on the provided filter criteria.

## Example

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

export default automation("Batch Square Retrieve Inventory Changes", () => {
  onDashboardRun({ title: "Batch Square Retrieve Inventory Changes" })

  square.batchRetrieveInventoryChanges({})
})
```

## Inputs

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

| Field              | Type                                           | Required | Default                                    | Description                                                                                                                                                                                                                                                   |
| ------------------ | ---------------------------------------------- | -------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `catalogObjectIds` | `string[] \| null`                             | No       | null                                       | The filter to return results by `CatalogObject` ID. The filter is only applicable when set. The default value is null.                                                                                                                                        |
| `locationIds`      | `string[] \| null`                             | No       | null                                       | The filter to return results by `Location` ID. The filter is only applicable when set. The default value is null.                                                                                                                                             |
| `types`            | `Square.InventoryChangeType[] \| null`         | No       | `[PHYSICAL_COUNT, ADJUSTMENT]`             | The filter to return results by `InventoryChangeType` values other than `TRANSFER`. The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`.                                                                                                                      |
| `states`           | `Square.InventoryState[] \| null`              | No       | null                                       | The filter to return `ADJUSTMENT` query results by `InventoryState`. This filter is only applied when set. The default value is null.                                                                                                                         |
| `updatedAfter`     | `string \| null`                               | No       | the UNIX epoch of (`1970-01-01T00:00:00Z`) | The filter to return results with their `calculated_at` value after the given time as specified in an RFC 3339 timestamp. The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`).                                                                    |
| `updatedBefore`    | `string \| null`                               | No       | the UNIX epoch of (`1970-01-01T00:00:00Z`) | The filter to return results with their `created_at` or `calculated_at` value strictly before the given time as specified in an RFC 3339 timestamp. The default value is the UNIX epoch of (`1970-01-01T00:00:00Z`).                                          |
| `cursor`           | `string \| null`                               | No       | —                                          | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information. |
| `limit`            | `number \| null`                               | No       | —                                          | The number of records to return.                                                                                                                                                                                                                              |
| `sort`             | `Square.BatchRetrieveInventoryChangesSort`     | No       | —                                          | Specification of how returned inventory changes should be ordered. Currently, inventory changes can only be ordered by the occurred\_at field. The default sort order for occurred\_at is ASC (changes are returned oldest-first by default).                 |
| `reasonIds`        | `Square.InventoryAdjustmentReasonId[] \| null` | No       | —                                          | The filter to return `ADJUSTMENT` query results by inventory adjustment reason. This filter is only applied when set. The request cannot include both `reason_ids` and `states`.                                                                              |

Use the official [BatchRetrieveInventoryChanges reference](https://developer.squareup.com/reference/square/inventory-api/batch-retrieve-inventory-changes) for provider field semantics and limits.

## Output

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