---
title: "BatchRetrieveInventoryChanges"
method: POST
path: "/v2/inventory/changes/batch-retrieve"
tags: ["Inventory"]
---

# BatchRetrieveInventoryChanges

`POST /v2/inventory/changes/batch-retrieve`

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

Results are paginated and sorted in ascending order according their
`occurred_at` timestamp (oldest first).

BatchRetrieveInventoryChanges is a catch-all query endpoint for queries
that cannot be handled by other, simpler endpoints.

## Request body

- BatchRetrieveInventoryChangesRequest
  - `catalog_object_ids` string[] — The filter to return results by `CatalogObject` ID. The filter is only applicable when set. The default value is null.
  - `cursor` string — 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.
  - `location_ids` string[] — The filter to return results by `Location` ID. The filter is only applicable when set. The default value is null.
  - `states` string[] — The filter to return `ADJUSTMENT` query results by `InventoryState`. This filter is only applied when set. The default value is null.
  - `types` string[] — The filter to return results by `InventoryChangeType` values other than `TRANSFER`. The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`.
  - `updated_after` string — 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`).
  - `updated_before` string — 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`).

## Response `200`

Success

- BatchRetrieveInventoryChangesResponse
  - `changes` InventoryChange[] — The current calculated inventory changes for the requested objects and locations.
    - `adjustment` InventoryAdjustment — Represents a change in state or quantity of product inventory at a particular time and location.
      - `adjustment_group` InventoryAdjustmentGroup
        - `from_state` string — Representative `from_state` for adjustments within the group. For example, for a group adjustment from `IN_STOCK` to `SOLD`, there can be two component adjustments in the group: one from `IN_STOCK`to `COMPOSED` and the other one from `COMPOSED` to `SOLD`. Here, the representative `from_state` for the `InventoryAdjustmentGroup` is `IN_STOCK`.
        - `id` string — A unique ID generated by Square for the `InventoryAdjustmentGroup`.
        - `root_adjustment_id` string — The inventory adjustment of the composed variation.
        - `to_state` string — Representative `to_state` for adjustments within group. For example, for a group adjustment from `IN_STOCK` to `SOLD`, the two component adjustments in the group can be from `IN_STOCK` to `COMPOSED` and from `COMPOSED` to `SOLD`. Here, the representative `to_state` of the `InventoryAdjustmentGroup` is `SOLD`.
      - `catalog_object_id` string — The Square-generated ID of the [CatalogObject](https://developer.squareup.com/reference/square_2021-08-18/objects/CatalogObject) being tracked.
      - `catalog_object_type` string — The [type](https://developer.squareup.com/reference/square_2021-08-18/enums/CatalogObjectType) of the [CatalogObject](https://developer.squareup.com/reference/square_2021-08-18/objects/CatalogObject) being tracked. Tracking is only supported for the `ITEM_VARIATION` type.
      - `created_at` string — An RFC 3339-formatted timestamp that indicates when the inventory adjustment is received.
      - `employee_id` string — The Square-generated ID of the [Employee](https://developer.squareup.com/reference/square_2021-08-18/objects/Employee) responsible for the inventory adjustment.
      - `from_state` string — The [inventory state](https://developer.squareup.com/reference/square_2021-08-18/enums/InventoryState) of the related quantity of items before the adjustment.
      - `goods_receipt_id` string — The Square-generated ID of the goods receipt that caused the adjustment. Only relevant for state transitions from the Square for Retail app.
      - `id` string — A unique ID generated by Square for the `InventoryAdjustment`.
      - `location_id` string — The Square-generated ID of the [Location](https://developer.squareup.com/reference/square_2021-08-18/objects/Location) where the related quantity of items is being tracked.
      - `occurred_at` string — A client-generated RFC 3339-formatted timestamp that indicates when the inventory adjustment took place. For inventory adjustment updates, the `occurred_at` timestamp cannot be older than 24 hours or in the future relative to the time of the request.
      - `purchase_order_id` string — The Square-generated ID of the purchase order that caused the adjustment. Only relevant for state transitions from the Square for Retail app.
      - `quantity` string — The number of items affected by the adjustment as a decimal string. Can support up to 5 digits after the decimal point.
      - `reference_id` string — An optional ID provided by the application to tie the `InventoryAdjustment` to an external system.
      - `refund_id` string — The Square-generated ID of the [Refund][#type-refund] that caused the adjustment. Only relevant for refund-related state transitions.
      - `source` SourceApplication — Provides information about the application used to generate a change.
        - `application_id` string — Read-only Square ID assigned to the application. Only used for [Product](https://developer.squareup.com/reference/square_2021-08-18/enums/Product) type `EXTERNAL_API`.
        - `name` string — Read-only display name assigned to the application (e.g. `"Custom Application"`, `"Square POS 4.74 for Android"`).
        - `product` string — Read-only [Product](https://developer.squareup.com/reference/square_2021-08-18/enums/Product) type for the application.
      - `to_state` string — The [inventory state](https://developer.squareup.com/reference/square_2021-08-18/enums/InventoryState) of the related quantity of items after the adjustment.
      - `total_price_money` Money — Represents an amount of money. `Money` fields can be signed or unsigned. Fields that do not explicitly define whether they are signed or unsigned are considered unsigned and can only hold positive amounts. For signed fields, the sign of the value indicates the purpose of the money transfer. See [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) for more information.
        - `amount` integer — The amount of money, in the smallest denomination of the currency indicated by `currency`. For example, when `currency` is `USD`, `amount` is in cents. Monetary amounts can be positive or negative. See the specific field description to determine the meaning of the sign in a particular case.
        - `currency` string — The type of currency, in __ISO 4217 format__. For example, the currency code for US dollars is `USD`. See [Currency](https://developer.squareup.com/reference/square_2021-08-18/enums/Currency) for possible values.
      - `transaction_id` string — The Square-generated ID of the [Transaction][#type-transaction] that caused the adjustment. Only relevant for payment-related state transitions.
    - `measurement_unit` CatalogMeasurementUnit — Represents the unit used to measure a `CatalogItemVariation` and specifies the precision for decimal quantities.
      - `measurement_unit` MeasurementUnit — Represents a unit of measurement to use with a quantity, such as ounces or inches. Exactly one of the following fields are required: `custom_unit`, `area_unit`, `length_unit`, `volume_unit`, and `weight_unit`.
        - `area_unit` string — Represents a standard area unit.
        - `custom_unit` MeasurementUnitCustom — The information needed to define a custom unit, provided by the seller.
          - `abbreviation` string, required — The abbreviation of the custom unit, such as "bsh" (bushel). This appears in the cart for the Point of Sale app, and in reports.
          - `name` string, required — The name of the custom unit, for example "bushel".
        - `generic_unit` string — Reserved for API integrations that lack the ability to specify a real measurement unit
        - `length_unit` string — Represents a standard length unit.
        - `time_unit` string — Represents a standard unit of time.
        - `type` string — Represents the type of the measurement unit.
        - `volume_unit` string — Represents a standard volume unit.
        - `weight_unit` string — Represents a standard unit of weight or mass.
      - `precision` integer — An integer between 0 and 5 that represents the maximum number of positions allowed after the decimal in quantities measured with this unit. For example: - if the precision is 0, the quantity can be 1, 2, 3, etc. - if the precision is 1, the quantity can be 0.1, 0.2, etc. - if the precision is 2, the quantity can be 0.01, 0.12, etc. Default: 3
    - `measurement_unit_id` string — The ID of the [CatalogMeasurementUnit](https://developer.squareup.com/reference/square_2021-08-18/objects/CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change.
    - `physical_count` InventoryPhysicalCount — Represents the quantity of an item variation that is physically present at a specific location, verified by a seller or a seller's employee. For example, a physical count might come from an employee counting the item variations on hand or from syncing with an external system.
      - `catalog_object_id` string — The Square-generated ID of the [CatalogObject](https://developer.squareup.com/reference/square_2021-08-18/objects/CatalogObject) being tracked.
      - `catalog_object_type` string — The [type](https://developer.squareup.com/reference/square_2021-08-18/enums/CatalogObjectType) of the [CatalogObject](https://developer.squareup.com/reference/square_2021-08-18/objects/CatalogObject) being tracked. Tracking is only supported for the `ITEM_VARIATION` type.
      - `created_at` string — An RFC 3339-formatted timestamp that indicates when the physical count is received.
      - `employee_id` string — The Square-generated ID of the [Employee](https://developer.squareup.com/reference/square_2021-08-18/objects/Employee) responsible for the physical count.
      - `id` string — A unique Square-generated ID for the [InventoryPhysicalCount](https://developer.squareup.com/reference/square_2021-08-18/objects/InventoryPhysicalCount).
      - `location_id` string — The Square-generated ID of the [Location](https://developer.squareup.com/reference/square_2021-08-18/objects/Location) where the related quantity of items is being tracked.
      - `occurred_at` string — A client-generated RFC 3339-formatted timestamp that indicates when the physical count was examined. For physical count updates, the `occurred_at` timestamp cannot be older than 24 hours or in the future relative to the time of the request.
      - `quantity` string — The number of items affected by the physical count as a decimal string. The number can support up to 5 digits after the decimal point.
      - `reference_id` string — An optional ID provided by the application to tie the [InventoryPhysicalCount](https://developer.squareup.com/reference/square_2021-08-18/objects/InventoryPhysicalCount) to an external system.
      - `source` SourceApplication — Provides information about the application used to generate a change.
        - `application_id` string — Read-only Square ID assigned to the application. Only used for [Product](https://developer.squareup.com/reference/square_2021-08-18/enums/Product) type `EXTERNAL_API`.
        - `name` string — Read-only display name assigned to the application (e.g. `"Custom Application"`, `"Square POS 4.74 for Android"`).
        - `product` string — Read-only [Product](https://developer.squareup.com/reference/square_2021-08-18/enums/Product) type for the application.
      - `state` string — The current [inventory state](https://developer.squareup.com/reference/square_2021-08-18/enums/InventoryState) for the related quantity of items.
    - `transfer` InventoryTransfer — Represents the transfer of a quantity of product inventory at a particular time from one location to another.
      - `catalog_object_id` string — The Square-generated ID of the [CatalogObject](https://developer.squareup.com/reference/square_2021-08-18/objects/CatalogObject) being tracked.
      - `catalog_object_type` string — The [type](https://developer.squareup.com/reference/square_2021-08-18/enums/CatalogObjectType) of the [CatalogObject](https://developer.squareup.com/reference/square_2021-08-18/objects/CatalogObject) being tracked.Tracking is only supported for the `ITEM_VARIATION` type.
      - `created_at` string — An RFC 3339-formatted timestamp that indicates when Square received the transfer request.
      - `employee_id` string — The Square-generated ID of the [Employee](https://developer.squareup.com/reference/square_2021-08-18/objects/Employee) responsible for the inventory transfer.
      - `from_location_id` string — The Square-generated ID of the [Location](https://developer.squareup.com/reference/square_2021-08-18/objects/Location) where the related quantity of items was tracked before the transfer.
      - `id` string — A unique ID generated by Square for the `InventoryTransfer`.
      - `occurred_at` string — A client-generated RFC 3339-formatted timestamp that indicates when the transfer took place. For write actions, the `occurred_at` timestamp cannot be older than 24 hours or in the future relative to the time of the request.
      - `quantity` string — The number of items affected by the transfer as a decimal string. Can support up to 5 digits after the decimal point.
      - `reference_id` string — An optional ID provided by the application to tie the `InventoryTransfer` to an external system.
      - `source` SourceApplication — Provides information about the application used to generate a change.
        - `application_id` string — Read-only Square ID assigned to the application. Only used for [Product](https://developer.squareup.com/reference/square_2021-08-18/enums/Product) type `EXTERNAL_API`.
        - `name` string — Read-only display name assigned to the application (e.g. `"Custom Application"`, `"Square POS 4.74 for Android"`).
        - `product` string — Read-only [Product](https://developer.squareup.com/reference/square_2021-08-18/enums/Product) type for the application.
      - `state` string — The [inventory state](https://developer.squareup.com/reference/square_2021-08-18/enums/InventoryState) for the quantity of items being transferred.
      - `to_location_id` string — The Square-generated ID of the [Location](https://developer.squareup.com/reference/square_2021-08-18/objects/Location) where the related quantity of items was tracked after the transfer.
    - `type` string — Indicates how the inventory change is applied. See [InventoryChangeType](https://developer.squareup.com/reference/square_2021-08-18/enums/InventoryChangeType) for all possible values.
  - `cursor` string — The pagination cursor to be used in a subsequent request. If unset, this is the final response. See the [Pagination](https://developer.squareup.com/docs/working-with-apis/pagination) guide for more information.
  - `errors` Error[] — Any errors that occurred during the request.
    - `category` string, required — The high-level category for the error.
    - `code` string, required — The specific code of the error.
    - `detail` string — A human-readable description of the error for debugging purposes.
    - `field` string — The name of the field provided in the original request (if any) that the error pertains to.

---

[API](https://skmtc.net/square/apis/squareup.md) · [All operations](https://skmtc.net/square/apis/squareup/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/square/squareup/revisions/8d95e3639487/schema)
