How to track Product Inventory Adjustments

Dario_Luparello
New Member
1 0 0

Hello,

We'd like to keep track of all Product Inventory Adjustments, by Variant. Is there an API endpoint to retrieve that information? I'm aware of how to retrieve the current inventory count and information about transfers, but what I'm interested in is the history log of all "update quantity" actions in the Inventory tab. This is of course necessary both for auditing and accounting reasons.

Thank you!

neewadogs.com

 

Replies 4 (4)
Daniel9
Excursionist
30 0 5

Hi Dario,

There isn't an API I've seen that can show you the history of a product/variant but you could build a log yourself using the webhook API. If you set up a webhook for products updates, Shopify would send a request to your server each time a product is modified. The request would include the current state of the product so you could save those and then you would have a historical record of how the product was.

There's more info on setting up webhooks at https://help.shopify.com/api/reference/webhook

Best,
Daniel

Tired of spending hours manually editing products? Check out https://apps.shopify.com/bulk-product-editor
KarlOffenberger
Shopify Partner
1873 184 863

Hi Dario,

I am not aware of any way to query past inventory adjustments.

You could however subscribe to the inventory_levels/update webhook topic and keep track of such events yourself.

Hope this helps!

Liked this post? You might also like our fantastic upsell apps Candy Rack, Last Upsell post-purchase and Candy Cart or offer free gifts with Gift Box. All made with ❤️  and care by Digismoothie
KarlOffenberger
Shopify Partner
1873 184 863

Oh, sorry, didn't realize this is such an old post.

Seems the forum got jumbled up as all of a sudden there's a few very old posts popping up among new ones!

Liked this post? You might also like our fantastic upsell apps Candy Rack, Last Upsell post-purchase and Candy Cart or offer free gifts with Gift Box. All made with ❤️  and care by Digismoothie
FurnaceX
Shopify Partner
42 2 36

I see that there is a non-public API called inventoryAdjustments that Shopify is using on the product's inventory history page:

 

  query InventoryHistory($first: Int, $last: Int, $after: String, $before: String, $query: String) {  
    inventoryAdjustments(first: $first, last: $last, after: $after, before: $before, query: $query) {
      edges {      
        node {        
          app {          
            id          
            title          
            __typename        
          }        
          availableDelta        
          availableQuantity        
          createdAt        
          id        
          reasonMessage        
          referenceDocument {
            __typename          
            ... on InventoryTransfer {            
              id            
              name            
              __typename          
            }          
            ... on Order {            
              id            
              name            
              __typename          
            }          
            ... on PurchaseOrder {
              id            
              name            
              __typename          
            }          
            ... on Refund {            
              id            
              order {              
                id              
                name              
                __typename            
              }            
              __typename          
            }          
            ... on Location 
            {            
              id            
              name            
              __typename          
            }        
          }        
          staffMember {          
            id          
            name          
            __typename        
          }        
          __typename      
        }      
        cursor      
        __typename    
      }    
      pageInfo {      
        hasNextPage      
        hasPreviousPage      
        __typename    
      }    
      __typename  
    }
}

 

Will this be publicly available any time soon?  Is it possible to get early access to it?