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?