In the dashboard i dont see any items, but when i use the below API, then it brings me items

I am using the below API and I can see that it brings 3 objects, but in the dashboard the location doesnt have items.

It seems to be a problem with some items that are appearing everywhere.

DEBUG:urllib3.connectionpool:https://connect.squareup.com:443 "POST /v2/inventory/counts/batch-retrieve HTTP/1.1" 200 271
DEBUG:app:Retrieved 3 inventory counts
DEBUG:app:Final inventory list: [{'catalog_object_id': '6QHOKNHMXRGXIBIIR3UHRTZJ', 'catalog_object_name': 'Biblias - B1001 - ', 'quantity': '0'}, {'catalog_object_id': 'KDCTEPPPLD7ETXGR4LSZBE2J', 'catalog_object_name': 'Biblias - B1003 - ', 'quantity': '0'}, {'catalog_object_id': 'OAZN4YTROXM54ZWP2QSFKQ5P', 'catalog_object_name': 'Biblias - B1002 - ', 'quantity': '0'}]
DEBUG:root:Square inventory response: [{'catalog_object_id': '6QHOKNHMXRGXIBIIR3UHRTZJ', 'catalog_object_name': 'Biblias - B1001 - ', 'quantity': '0'}, {'catalog_object_id': 'KDCTEPPPLD7ETXGR4LSZBE2J', 'catalog_object_name': 'Biblias - B1003 - ', 'quantity': '0'}, {'catalog_object_id': 'OAZN4YTROXM54ZWP2QSFKQ5P', 'catalog_object_name': 'Biblias - B1002 - ', 'quantity': '0'}]
INFO:root:Successfully prepared inventory list with 3 items

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Retrieve Inventory Quantities
Inventory API: How It Works
Reconcile Inventory Count

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

The Inventory API retrieves the inventory counts for item variations that are defined in your Square product catalog. The inventory count is the quantity of a particular item variation that is currently in stock. If you’re seeing items in the inventory count that are not visible in your dashboard, it could be because these items have an inventory count of zero.

In your debug log, it shows that the quantity for all three items ('Biblias - B1001 - ', 'Biblias - B1003 - ', 'Biblias - B1002 - ') is ‘0’. This means these items are currently out of stock. If an item variation’s quantity reaches zero, it might not be displayed in certain views in your dashboard, depending on your settings.

If you want to hide out-of-stock items in the API response, you would need to filter out items with a quantity of ‘0’ in your application code after you retrieve the inventory counts. The Inventory API itself does not provide a built-in way to exclude out-of-stock items.

This answer was reviewed by @Bryan-Square.

Thank you for your response. I really appreciate it.

In the locations that these items are appearing, it is not that the count is zero, it is that they are not allocated to that location at all.

This item, when i enter to edit it on the edit item page, in the dashboard, shows me that in the locations it has 2 locations only, but it appears in the API on all the locations.

It is not that the item count is zero, it is that the item is not at that location. Please let me know what you think, or what evidence I can provide you.

To make my point more clear, let me show you the api inquiry for more than 2s location and it brings this item back. You will see that this item B1001 comes every time.

Location 1

NFO:root:Fetching inventory for location: L4QC03SS83XDA
DEBUG:app:Fetching inventory for location: L4QC03SS83XDA
DEBUG:app:Fetching catalog items...
DEBUG:urllib3.connectionpool:https://connect.squareup.com:443 "POST /v2/catalog/search-catalog-items HTTP/1.1" 200 None
INFO:app:Successfully retrieved 112 catalog items
DEBUG:app:Retrieved 112 catalog items
DEBUG:app:Created catalog map with 224 entries
DEBUG:urllib3.connectionpool:https://connect.squareup.com:443 "POST /v2/inventory/counts/batch-retrieve HTTP/1.1" 200 273
DEBUG:app:Retrieved 3 inventory counts
DEBUG:app:Final inventory list: [{'catalog_object_id': '6QHOKNHMXRGXIBIIR3UHRTZJ', 'catalog_object_name': 'Biblias - B1001 - ', 'quantity': '0'}, {'catalog_object_id': 'KDCTEPPPLD7ETXGR4LSZBE2J', 'catalog_object_name': 'Biblias - B1003 - ', 'quantity': '0'}, {'catalog_object_id': 'OAZN4YTROXM54ZWP2QSFKQ5P', 'catalog_object_name': 'Biblias - B1002 - ', 'quantity': '0'}]
DEBUG:root:Square inventory response: [{'catalog_object_id': '6QHOKNHMXRGXIBIIR3UHRTZJ', 'catalog_object_name': 'Biblias - B1001 - ', 'quantity': '0'}, {'catalog_object_id': 'KDCTEPPPLD7ETXGR4LSZBE2J', 'catalog_object_name': 'Biblias - B1003 - ', 'quantity': '0'}, {'catalog_object_id': 'OAZN4YTROXM54ZWP2QSFKQ5P', 'catalog_object_name': 'Biblias - B1002 - ', 'quantity': '0'}]
INFO:root:Successfully prepared inventory list with 3 items

Location 2

INFO:root:Fetching inventory for location: L4MHDD7K82A5W
DEBUG:app:Fetching inventory for location: L4MHDD7K82A5W
DEBUG:app:Fetching catalog items...
DEBUG:urllib3.connectionpool:https://connect.squareup.com:443 "POST /v2/catalog/search-catalog-items HTTP/1.1" 200 None
INFO:app:Successfully retrieved 112 catalog items
DEBUG:app:Retrieved 112 catalog items
DEBUG:app:Created catalog map with 224 entries
DEBUG:urllib3.connectionpool:https://connect.squareup.com:443 "POST /v2/inventory/counts/batch-retrieve HTTP/1.1" 200 271
DEBUG:app:Retrieved 3 inventory counts
DEBUG:app:Final inventory list: [{'catalog_object_id': '6QHOKNHMXRGXIBIIR3UHRTZJ', 'catalog_object_name': 'Biblias - B1001 - ', 'quantity': '0'}, {'catalog_object_id': 'KDCTEPPPLD7ETXGR4LSZBE2J', 'catalog_object_name': 'Biblias - B1003 - ', 'quantity': '0'}, {'catalog_object_id': 'OAZN4YTROXM54ZWP2QSFKQ5P', 'catalog_object_name': 'Biblias - B1002 - ', 'quantity': '0'}]
DEBUG:root:Square inventory response: [{'catalog_object_id': '6QHOKNHMXRGXIBIIR3UHRTZJ', 'catalog_object_name': 'Biblias - B1001 - ', 'quantity': '0'}, {'catalog_object_id': 'KDCTEPPPLD7ETXGR4LSZBE2J', 'catalog_object_name': 'Biblias - B1003 - ', 'quantity': '0'}, {'catalog_object_id': 'OAZN4YTROXM54ZWP2QSFKQ5P', 'catalog_object_name': 'Biblias - B1002 - ', 'quantity': '0'}]
INFO:root:Successfully prepared inventory list with 3 items

Location 3

INFO:root:Fetching inventory for location: L3Q8W2SVJPGN2
DEBUG:app:Fetching inventory for location: L3Q8W2SVJPGN2
DEBUG:app:Fetching catalog items...
DEBUG:urllib3.connectionpool:https://connect.squareup.com:443 "POST /v2/catalog/search-catalog-items HTTP/1.1" 200 None
INFO:app:Successfully retrieved 112 catalog items
DEBUG:app:Retrieved 112 catalog items
DEBUG:app:Created catalog map with 224 entries
DEBUG:urllib3.connectionpool:https://connect.squareup.com:443 "POST /v2/inventory/counts/batch-retrieve HTTP/1.1" 200 272
DEBUG:app:Retrieved 3 inventory counts
DEBUG:app:Final inventory list: [{'catalog_object_id': '6QHOKNHMXRGXIBIIR3UHRTZJ', 'catalog_object_name': 'Biblias - B1001 - ', 'quantity': '0'}, {'catalog_object_id': 'KDCTEPPPLD7ETXGR4LSZBE2J', 'catalog_object_name': 'Biblias - B1003 - ', 'quantity': '0'}, {'catalog_object_id': 'OAZN4YTROXM54ZWP2QSFKQ5P', 'catalog_object_name': 'Biblias - B1002 - ', 'quantity': '0'}]
DEBUG:root:Square inventory response: [{'catalog_object_id': '6QHOKNHMXRGXIBIIR3UHRTZJ', 'catalog_object_name': 'Biblias - B1001 - ', 'quantity': '0'}, {'catalog_object_id': 'KDCTEPPPLD7ETXGR4LSZBE2J', 'catalog_object_name': 'Biblias - B1003 - ', 'quantity': '0'}, {'catalog_object_id': 'OAZN4YTROXM54ZWP2QSFKQ5P', 'catalog_object_name': 'Biblias - B1002 - ', 'quantity': '0'}]
INFO:root:Successfully prepared inventory list with 3 items```

I’m still having trouble understanding the issue. The catalog object is either enabled for all locations or it’s present at a specific location. The example catalog object that you provided is:

 "present_at_all_locations": false,
        "present_at_location_ids": [
            "L1QJKD4J69PKK",
            "LEJZ2G8PC6NH1"
        ],

However I see that your calling SearchCatalogItems with an empty query so you’ll always get the entire catalog for the Square account. :slight_smile:

Thank you for your response. This is what I think is happening.

In the first picture, you can see the /search-catalog-items, and you can see that the item 6QHOKNHMXRGXIBIIR3UHRTZJ is only available in 2 locations.

In the second picture /inventory/counts/batch-retrieve/ I did a simple text search of the response of the “item id” 6QHOKNHMXRGXIBIIR3UHRTZJ and I found this item on all the locations that shows the first picture. I don’t know why that is, but that second query should be presenting the item in just 2 locations present on the fist picture. That behavior doesn’t happen for all the items, just for the items where I am having the issue.

The 2 locations of the first picture on /search-catalog-tems

"LEJZ2G8PC6NH1",
"L1QJKD4J69PKK"

In the second picture you will see that the object 6QHOKNHMXRGXIBIIR3UHRTZJ appears 100 times (one per location), so that is throwing me off.

There is the second picture where the item appears in many locations.

I think that this is an error from square that is sending on this query an item on multiple locations when it is not there, but i am a noobie, can you please confirm?