Inventory BatchGetChanges isn't filtering

I’m trying to get OrderIDs/TransactionIDs from specific CatalogIds. In my current code I’m passing in 18 strings to the BRICReq(), but I’m getting back everything as if I have no filter. When I run the same 18 CatalogIDs in the API explorer, I get back the expected values. I tried copy/pasting the code from the API explorer that worked, and I get the same unfiltered result.

What am I doing wrong with filtering?

IEnumerable<string> classIds = classes.Select(c => c.SquareID);

Pager invChanges = await _client.Inventory.BatchGetChangesAsync(
new BatchRetrieveInventoryChangesRequest()
{
CatalogObjectIds = classIds,
LocationIds = [LocationId]
});

Page<InventoryChange> page = invChanges.CurrentPage;
List<Adjustment> adjustments = [];
//Iterate all pages
do
{
	//Iterate all items getting quantites in an out
	foreach (var item in page.Items)
	{
...
	}
	if (invChanges.HasNextPage)
		page = await invChanges.GetNextPageAsync();
	else
		page = Page<InventoryChange>.Empty;
} while (!page.IsEmpty);

:waving_hand: 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

Search for Items and Objects
Catalog API
Inventory API

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.

I solved the issue. I provided the “Item” Id to the BatchGetCatalogObjectsRequest(), but I needed to provide the Item.ItemVariation[0].Id

I am not sure why the API explorer doesn’t behalf the same as the SDK though.