Error with Inventory Batch Retrieve API

There is something wrong with the inventory batch retrieve API when you use limits.

I am calling /v2/inventory/counts/batch-retrieve to get the counts of 18 product variations over 2 locations.
If I leave limit unset and make the call, that’s fine. 18 variations x 2 locations is only 56 items to return.
The return of this call is correct and I get all unique pairs that look like this (for every variation):

{
      "catalog_object_id": "ITEM_VARIATION_A",
      "location_id": "LOCATION_1",
      "quantity": "20",
...
    },
    {
      "catalog_object_id": "ITEM_VARIATION_A",
      "location_id": "LOCATION_2",
      "quantity": "20",

    }

However, I am testing the pagination and so I made the call with a limit of 10, updating the cursor every time and making a new call until cursor is undefined.
In this scenario, I’m getting specifically one object that is duplicated for location1 and missing its location info for location2.
So I get this instead (for one item only, specifically)

{
      "catalog_object_id": "ITEM_VARIATION_A",
      "location_id": "LOCATION_1",
      "quantity": "20",
...
    },
    {
      "catalog_object_id": "ITEM_VARIATION_A",
      "location_id": "**LOCATION_1**",
      "quantity": "20",

    }

Now I tested wtih different values for limit, and it keeps happening to a different item, but only one item (the other 54 entries are all unique and correct).

Furthermore, I noticed a second isuse. If the total number of items (56 in my case) is divisble by the value of limit, a cursor is still returned, even though there is nothing else to actually return. So specifically for my case, this issue comes up when limit is set to 18 or 56.

Can someone please take a look at this issue?

What’s you application ID and is this with sandbox or production? :slightly_smiling_face:

The application ID is sandbox-sq0idb-bYENdRHJSvDxxXmnIGanTA
and this is in Sandbox

Also what’s the item_id that being returned twice and the ID of the one missing? :slightly_smiling_face:

It changes depending on the limit that I set. I’ll just give 2 examples. When limit is 10, I get KT7W2SXOIRUZCGYZHGPQADLL back twice.
When limit is 11, I get Y2Z4YH25LS7XIKONOJ66W4IG back twice.

Hi Bryan, I just want to see if there’s any update with this issue?