# Does inventory\_change serve as a true change log?

**URL:** <https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350>\
**Category:** GraphQL API\
**Created:** [February 8, 2023, 8:40pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350 "2023-02-08T20:40:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![cschouten](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@cschouten](https://community.shiphero.com/u/cschouten)\
**Post date:** [February 8, 2023, 8:40pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/1 "2023-02-08T20:40:31Z")

</div>

Hello again!

My team and I had a question around the inventory\_change query.

Let’s say an inventory change event was made for location A, depositing 6250 items, and another inventory change event was made for a different location B, depositing 6250 items. In reality, our team knows the 6250 items were moved from A to B; however, when I query inventory\_change for that specific item (sku), we don’t see an event that shows a “zeroing out” of the first location.

In other words, rather than creating another event denoting the removal of 6250 items from location A, ShipHero instead seems to have deleted the initial event. Here’s the example request\_id: 63e4079b39746cf8ee1a0bc9.

Is there a reason why this event is missing from inventory\_change? Thanks!

All the best,  
Colin

---

<div class="post-metadata">

**Author:** ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)\
**Post date:** [February 8, 2023, 9:33pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/2 "2023-02-08T21:33:57Z")

</div>

Hello @cschouten

I’m checking that product, and I don’t see the stock moving from one location to another. I see 6250 added to a location. Several orders shipped, removing stock from that location and finally removing the remaining 6238 from that location, zeroing it out.

I see this both in the UI and API.

There’s an extra entry in the API for a receiving of 6250 of that SKU. It has the URL to access the PO, and the number in eh URL is the POs ID. If you check that PO, you will see it is associated with another child account.

Not sure if this helps clear everything, but if you can point out how and when you zeroed out that inventory, I may be able to find more info. Though these actions seem to be old now so, there might not be complete logs for them.

Have a nice day!  
TomasFD

---

<div class="post-metadata">

**Author:** ![cschouten](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@cschouten](https://community.shiphero.com/u/cschouten)\
**Post date:** [February 8, 2023, 10:38pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/3 "2023-02-08T22:38:04Z")

</div>

Thanks @tomasfd!

Just to clarify, an inventory change event was made for location A, depositing 6250 items, then another inventory change event was made for a different location B, depositing 6250 items

Eventually, another inventory change event was made for location B, removing 6250 items. Looking at our stock today (specifically for the SKU in the request\_id), location A and location B are empty.

By just going off of the inventory change events, we would expect location A still contains 6250 items. This means that ShipHero did not create an inventory change event to zero-out location A when the inventory was moved from A to B.

Right now, we only see a _single_ inventory\_change event for location `QmluOjMwNDI3Nzc=` , depositing 6250 items.

All the best,  
Colin

---

<div class="post-metadata">

**Author:** ![coltonsberry](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@coltonsberry](https://community.shiphero.com/u/coltonsberry)\
**Post date:** [February 9, 2023, 3:20pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/4 "2023-02-09T15:20:36Z")

</div>

Due to the missing event for zeroing out location QmluOjMwNDI3Nzc=, we are currently unable to rely on inventory\_changes to construct the state of our inventory at a given point in time.

@tomasfd , would you mind confirming that you are observing the same issue that we are? Specifically the issue of location QmluOjMwNDI3Nzc= containing 6250 items according to inventory\_changes.

Assuming that you confirm the issue exists, how can we correct the state of inventory\_changes so that we may rely on it for calculating our storage totals over time?

---

<div class="post-metadata">

**Author:** ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)\
**Post date:** [February 9, 2023, 8:01pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/5 "2023-02-09T20:01:11Z")

</div>

@cschouten / @coltonsberry

Is not that the inventory change log is not returning it. I can’t find that zeroed out action in our logs. Can you share how and when this was done for us to look into it?

Kind regards,  
TomasFD

---

<div class="post-metadata">

**Author:** ![coltonsberry](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@coltonsberry](https://community.shiphero.com/u/coltonsberry)\
**Post date:** [February 10, 2023, 5:28pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/6 "2023-02-10T17:28:58Z")

</div>

Hi @tomasfd ,

Thanks again for your reply. Check out these attached images from the ShipHero UI. In one image, you will see that the inventory change log indicates that B.01.07.02 has 6250 of 1001-02-INSERT stored. In the other image, you will see product locations view, indicating that B.01.07.02 is not at all storing 1001-02-INSERT.

This is the issue. Is it possible that the product locations view is filtering out 1001-02-INSERT due to the SKU being inactive, or something of that sort?

Best,  
Colton

Inventory change log image:

 ![inventory_change_log](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/fa8eafc4edb44665eb0489e41d1f674dc607de70.jpeg)

---

<div class="post-metadata">

**Author:** ![coltonsberry](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@coltonsberry](https://community.shiphero.com/u/coltonsberry)\
**Post date:** [February 10, 2023, 5:29pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/7 "2023-02-10T17:29:56Z")

</div>

Product locations image:

 ![product_locations](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/dccaf674885e505d94d0c11e4f0a1c6e63cab867.jpeg)

---

<div class="post-metadata">

**Author:** ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)\
**Post date:** [February 10, 2023, 7:26pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/8 "2023-02-10T19:26:44Z")

</div>

Hello @coltonsberry!

I checked the PO for that movement. You can see the ID on the inventory log reason. When you go inside it you can see the SKU does not exist for that customer.

I believe that is what is causing this inconsistency.

Kind regards,  
TomasFD

---

<div class="post-metadata">

**Author:** ![coltonsberry](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@coltonsberry](https://community.shiphero.com/u/coltonsberry)\
**Post date:** [February 13, 2023, 1:47pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/9 "2023-02-13T13:47:46Z")

</div>

Hey again @tomasfd ,

Thanks again for your reply. I do see that the purchase order shows that the product does not exist in ShipHero. However, when I search for the product under the “Products” page, it does exist.

 ![Screenshot 2023-02-13 at 8.47.12 AM](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/9cc4b15bb42d86046181bffa79ff35612804baad.png)

---

<div class="post-metadata">

**Author:** ![coltonsberry](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@coltonsberry](https://community.shiphero.com/u/coltonsberry)\
**Post date:** [February 13, 2023, 1:49pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/10 "2023-02-13T13:49:00Z")

</div>

![Screenshot 2023-02-13 at 8.47.21 AM](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/40d958053c0929b0207f183435901a97539db303.jpeg)

---

<div class="post-metadata">

**Author:** ![coltonsberry](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@coltonsberry](https://community.shiphero.com/u/coltonsberry)\
**Post date:** [February 13, 2023, 1:50pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/11 "2023-02-13T13:50:21Z")

</div>

So my question is, using the GraphQL API, how can we determine whether or not a product “exists within ShipHero” as the purchase order page is reporting?

---

<div class="post-metadata">

**Author:** ![tomasfd](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tomasfd](https://community.shiphero.com/u/tomasfd)\
**Post date:** [February 13, 2023, 2:10pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/12 "2023-02-13T14:10:54Z")

</div>

Hello @coltonsberry !

If you check the associated 3PL customer for the product and the PO, you will see they differ. You need to have the product created for each customer account.

You could run a `product` query using `sku` and `customer_account_id` as filters.

Kind regards,  
TomasFD

---

<div class="post-metadata">

**Author:** ![coltonsberry](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@coltonsberry](https://community.shiphero.com/u/coltonsberry)\
**Post date:** [February 13, 2023, 3:27pm UTC](https://community.shiphero.com/t/does-inventory-change-serve-as-a-true-change-log/2350/13 "2023-02-13T15:27:48Z")

</div>

@tomasfd , thank you for clarifying that. We have remediated the issue on our side by joining inventory change with product, on both accountId and productId. The problematic row is then filtered out due to the product no longer corresponding to the account on the inventory change entry.
