Filter Warehouse Products Endpoint

Hello!

I’m curious if it is possible to run a GraphQL query on the products or warehouse products endpoint that returns a list of SKUs with their corresponding on hand and available quantities for only products that have a quantity > 0?

I’m working with a client that has > 25k total products in the system that are active but only roughly 8k have quantity on hand/available. Filtering the query to only return the 8k products with available inventory will be much more efficient.

Here’s the query that i’m currently leveraging:

query {
  warehouse_products(active: true) {
    request_id
    complexity
    data (after: "<%cursor%>") {
      pageInfo {
        hasNextPage
        hasPreviousPage
        startCursor
        endCursor
      }
      edges {
        node {
          id
					active
          warehouse_identifier
          on_hand
          available
          product {
            sku
          }
        }
      }
    }
  }
}

Hello Isaac,

You can check all arguments for our queries in our schema: Schema – Developer Resources | ShipHero.

None of those 2 queries have an argument only to return products with stock.

However, our inventory snapshot does. This single 80 credit cost mutation triggers an async process that pushes a URL to a JSON to a URL you set. This JSON has the inventory for all products across all your warehouses, but it can be filtered by warehouse_id and has_inventory. You can find more information here: Inventory-Snapshot – Developer Resources | ShipHero

Have a great day!
TomasFD