Batch retrieve inventory counts
Returns current counts for the provided CatalogObjects at the requested Locations.
Results are paginated and sorted in descending order according to their
calculated_at
timestamp (newest first).
When updated_after
is specified, only counts that have changed since that
time (based on the server timestamp for the most recent change) are
returned. This allows clients to perform a "sync" operation, for example
in response to receiving a Webhook notification.
Name | Description |
---|---|
catalog_
|
The filter to return results by |
location_
|
The filter to return results by |
updated_
|
The filter to return results with their Examples for January 25th, 2020 6:25:34pm Pacific Standard Time: UTC: 2020-01-26T02:25:34Z Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00 |
cursor
|
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. |
states
|
The filter to return results by |
limit
|
The number of records to return. |
Response Fields
Name | Description |
---|---|
errors
|
Any errors that occurred during the request. |
counts
|
The current calculated inventory counts for the requested objects and locations. |
cursor
|
The pagination cursor to be used in a subsequent request. If unset, this is the final response. See the Pagination guide for more information. |
Examples
- cURL
- Ruby
- Python
- C#
- Java
- PHP
- Node.js
curl https://connect.squareup.com/v2/inventory/counts/batch-retrieve \
-X POST \
-H 'Square-Version: 2022-07-20' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"catalog_object_ids": [
"W62UWFY35CWMYGVWK6TWJDNI"
],
"location_ids": [
"59TNP9SA8VGDA"
],
"updated_after": "2016-11-16T00:00:00.000Z"
}'
{
"errors": [],
"counts": [
{
"catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI",
"catalog_object_type": "ITEM_VARIATION",
"state": "IN_STOCK",
"location_id": "59TNP9SA8VGDA",
"quantity": "79",
"calculated_at": "2016-11-16T22:28:01.223Z"
}
]
}