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

# Retrieve Inventory Count

> Retrieves the current calculated stock count for a given [CatalogObject](entity:CatalogObject) at a given set of [Location](entity:Location)s.

`square.retrieveInventoryCount` retrieves the current calculated stock count for a given [CatalogObject](entity:CatalogObject) at a given set of [Location](entity:Location)s.

## Example

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

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

  square.retrieveInventoryCount({
    catalogObjectId: "catalog_object_id",
    locationIds: "location_ids",
    cursor: "cursor",
  })
})
```

## Inputs

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

| Field             | Type             | Required | Default | Description                                                                                                                                                                                                                                                   |
| ----------------- | ---------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `catalogObjectId` | `string`         | Yes      | —       | ID of the CatalogObject to retrieve.                                                                                                                                                                                                                          |
| `locationIds`     | `string \| null` | No       | —       | The Location IDs to look up as a comma-separated list. An empty list queries all locations.                                                                                                                                                                   |
| `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. |

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

## Output

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