Simplest Way to Generate Inventory Summary

Hello, I am looking for a way to generate a query that gives us an inventory summary. I am aware of the Inventory Snapshots, but I want to confirm the data we need is in them and that there isn’t an easier way to achieve what we need.

A couple notes:

  • we only have one location/warehouse
  • we have less than 100 skus

Here is the basic data we need for each product:

  • sku
  • “on hand” quantity
  • “available” quantity
  • “backorder” quantity
  • “on order” quantity (this is the one I’m not sure we can get from a simple query?)

That’s it. Basically re-building the gui on the ShipHero interface.

Thanks!
Tom

Hi @tomgerhardt!

Welcome to our Community. We are happy to have you!

Snapshots are the easiest and most cost-effective way to get that data. Here’s an extract of how you would see an SKU:

{
    "sku": "test-inventory-webhook",
    "account_id": "QWNjb3VudDo2Mzg5OA==",
    "vendors":
    {
        "VmVuZG9yOjQyMzA0OA==":
        {
            "vendor_id": "VmVuZG9yOjQyMzA0OA==",
            "vendor_name": "Tomas Ferrin Depaoli",
            "vendor_sku": ""
        }
    },
    "warehouse_products":
    {
        "V2FyZWhvdXNlOjc2NzMz":
        {
            "warehouse_id": "V2FyZWhvdXNlOjc2NzMz",
            "on_hand": 223,
            "allocated": 20,
            "backorder": 0,
            "available": 178,
            "non_sellable": 1250,
            "item_bins":
            {
                "QmluOjUxNzUxNzI=":
                {
                    "location_id": "QmluOjUxNzUxNzI=",
                    "location_name": "test-webhook-NP-NS",
                    "lot_id": "",
                    "lot_name": "",
                    "expiration_date": "",
                    "sellable": false,
                    "quantity": 1250
                },
                "QmluOjQyOTkzMDg=":
                {
                    "location_id": "QmluOjQyOTkzMDg=",
                    "location_name": "unassigned",
                    "lot_id": "",
                    "lot_name": "",
                    "expiration_date": "",
                    "sellable": true,
                    "quantity": 90
                },
                "QmluOjUxNzUxNzA=":
                {
                    "location_id": "QmluOjUxNzUxNzA=",
                    "location_name": "test-webhook-NP-S",
                    "lot_id": "",
                    "lot_name": "",
                    "expiration_date": "",
                    "sellable": true,
                    "quantity": 58
                },
                "QmluOjUwMzk1Nzk=":
                {
                    "location_id": "QmluOjUwMzk1Nzk=",
                    "location_name": "Receiving",
                    "lot_id": "",
                    "lot_name": "",
                    "expiration_date": "",
                    "sellable": true,
                    "quantity": 75
                }
            }
        }
    }
}

You can also query warehouse_products to get the same information:

query {
  warehouse_products {
    data(first: 10) {
      edges {
        node {
          sku
          warehouse_id
          on_hand
          allocated
          backorder
          available
          non_sellable_quantity
          locations(first: 10) {
            edges {
              node {
                location_id
                quantity
                location {
                  name
                  sellable
                  pickable
                }
              }
            }
          }
        }
      }
    }
  }
}

However, running this query will require you to paginate for the results. But having a limited number of SKUs might make it a better option. If you can query all of them in just one call without running into credit throttling, your information will be closer to real-time, as the snapshot is asynchronous.

As for the on_order quantity, the allocated and backorder quantities added up should add up to that value.

Have a great day!
TomasFD

(Sorry for those deleted posts, realized I hadn’t checked something.)

Thanks @tomasfd for the response! But, I am still not able to get the “on order” data I am looking for. Attached is a screenshot of the ShipHero GUI where it shows the data:

The allocated on the data I am getting back is 0 for that same sku in the screenshot. Any other ideas?

Hey @tomgerhardt! My suggestion only considered active orders (unfulfilled and not canceled). That number considers all orders with the product, even if it has already been fulfilled.

We don’t have that value exposed in the API yet. I will pass the feedback along.