v1

latestOpenAPI 3.0.0Apache 2.02026-07-142008071.1 MB
Inventory

BatchRetrieveInventoryChanges

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.

post/v2/inventory/changes/batch-retrieve

Request body

catalog_object_idsstring[]

The filter to return results by CatalogObject ID. The filter is only applicable when set. The default value is null.

cursorstring

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 guide for more information.

location_idsstring[]

The filter to return results by Location ID. The filter is only applicable when set. The default value is null.

statesstring[]

The filter to return ADJUSTMENT query results by InventoryState. This filter is only applied when set. The default value is null.

typesstring[]

The filter to return results by InventoryChangeType values other than TRANSFER. The default value is [PHYSICAL_COUNT, ADJUSTMENT].

updated_afterstring

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_beforestring

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

Example request

{
  "request_body": {
    "catalog_object_ids": [
      "W62UWFY35CWMYGVWK6TWJDNI"
    ],
    "location_ids": [
      "C6W5YS5QM06F5"
    ],
    "states": [
      "IN_STOCK"
    ],
    "types": [
      "PHYSICAL_COUNT"
    ],
    "updated_after": "2016-11-01T00:00:00.000Z",
    "updated_before": "2016-12-01T00:00:00.000Z"
  }
}

Response

Success

cursorstring

The pagination cursor to be used in a subsequent request. If unset, this is the final response. See the Pagination guide for more information.

Example response

{
  "changes": [
    {
      "physical_count": {
        "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI",
        "catalog_object_type": "ITEM_VARIATION",
        "created_at": "2016-11-16T22:25:24.878Z",
        "employee_id": "LRK57NSQ5X7PUD05",
        "id": "46YDTW253DWGGK9HMAE6XCAO",
        "location_id": "C6W5YS5QM06F5",
        "occurred_at": "2016-11-16T22:24:49.028Z",
        "quantity": "86",
        "reference_id": "22c07cf4-5626-4224-89f9-691112019399",
        "source": {
          "application_id": "416ff29c-86c4-4feb-b58c-9705f21f3ea0",
          "name": "Square Point of Sale 4.37",
          "product": "SQUARE_POS"
        },
        "state": "IN_STOCK"
      },
      "type": "PHYSICAL_COUNT"
    }
  ],
  "errors": []
}