Error getting location name from inventory_changes

I am running this query:

{ inventory_changes(date_from:“2020-08-01”){ request_id complexity data(first: 25){ pageInfo{ hasNextPage endCursor} edges{ node {location_id user_id account_id warehouse_id sku previous_on_hand change_in_on_hand reason location {id name} created_at} } } } }

In one of our accounts I am getting this error for all the results:
{
“message”: “Unexpected Error”,
“operation”: “inventory_changes”,
“field”: “id”,
“request_id”: “5f68b5448c9a00a6655b5c21”,
“code”: 22
}

If I remove “id” from the “location”, like this:
{ inventory_changes(date_from:“2020-08-01”){ request_id complexity data(first: 25){ pageInfo{ hasNextPage endCursor} edges{ node {location_id user_id account_id warehouse_id sku previous_on_hand change_in_on_hand reason location {name} created_at} } } } }

I then get this result:
“node”: {
“location_id”: “QmluOjU5MzE3Mw==”,
“user_id”: “VXNlcjo4MTMzMA==”,
“account_id”: “QWNjb3VudDozNTI4”,
“warehouse_id”: “V2FyZWhvdXNlOjU5NjU=”,
“sku”: “T18 GNV XS”,
“previous_on_hand”: 0,
“change_in_on_hand”: 2,
“reason”: “Received from Purchase Order <a href=”/dashboard/purchase-orders/details/567308">BX-Women-4",
“location”: {
“name”: null
},
“created_at”: “2020-09-16T12:02:13+00:00”
}

QUESTION: Why is the “location_id” in the InventoryChangeResult a valid value but when I try to get the nested location{id} it causes exceptions. Also, the name is returned as null. It should be a valid location with the id "“QmluOjU5MzE3Mw==”

Is this a bug or a data corruption issue?

Hi @bbarrett!
Thanks for those details, I see what you are referring to.
I see that the account seems to be a cancelled account (Client account), is it also happening for non cancelled accounts?
Thanks in advance!
Tom

It seems to be working as expected with other accounts. However, we cannot see where this account I am working with is indicated as canceled. Is this indicated in the UI anywhere? We have POs and received inventory against this account. As far as we know this account is not canceled and we are currently trying to move forward getting the account setup for business.

Hi @bbarrett!
My apologies for that, I might have been looking to the wrong account. That account is Active
I’m checking to see what happened and will provide an update asap, just wanted to confirm with you that the account is Active, sorry about that

Hi again @bbarrett!
I apologize again for this, it might have been a piece of bad advice on my side.
The error and name you are seeing there

“location”: {
“name”: null
},

Are beign returned null because it is being retrieved from the Customer and not the 3PL. I asked our engineering team and they told me that the Customer should not be seeing information on locations, that information should only be available to the 3PL (same as the UI)

So that is why I shouldn’t have mentioned to get the location information using the Customer Bearer on:
Inventory_changes query with customer_account_id filter

I will add this information to the Feature Request so we can filter by customer_account_id instead of using the customer’s bearer.
Once again i apologize for the inconvenience and I will let you know as soon as I have a response about this.
Thanks again!
Tom

Just to confirm, I will not be able to filter the inventory_changes for a specific customer account and simultaneously get the location name. Not until the inventory_changes query the supports customer_account_id filter.

But, I can get the location_id and effectively filter the results by using a customer account specific token?

I’d like to also suggest that all your queries support the customer_account_id filter for the sake of minimizing calls against the API.

That is correct, for now maybe you could get the location_id with the customer bearer as you did

“node”: { “location_id”: “QmluOjU5MzE3Mw==”,

And then with the 3PL get the name of the location using the location query and filtering by id if you need the location name

Makes sens thanks for the suggestion!, on this query it is meant to be used to filter by warehouse_id, but it makes complete sense to also filter by customer_account_id

I will update as soon as this request gets evaluated.
Thanks again!
Tom

Hi @bbarrett!
I just wanted to provide an update on this.
The request has been approved and now is on our engineering board to be built (to be able to filter for customer_account_id on the inventory_changes query).
It might take some time until this gets implemented, but I will let you know as soon as I have a better ETA for it.
Thanks again!
Tom