Ability to get breakdown of orders holding committed inventory count

Hello, I am in the process of building our private 3PL app shopify integration and I am trying to get the breakdown of Shopify’s committed quantity count by order like what is shown on Shopify admin, which is helpful to exclude inventory from orders not submitted to 3pl when doing inventory syncing, but it looks like the API that shopify admin dashboard uses is not a public API, is there any way to accomplish the same thing with public shopify graphql?

The API that admin panel uses is this:

query CommittedInventoryPopoverQuery($id: ID!) {
  inventoryLevel(id: $id) {
    id
    quantities(names: ["committed"]) {
      id
      quantity
      name
      activeLedgerDocuments(first: 25) {
        nodes {
          documentUri
          quantity
          displayName
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
}


{
  "id": "gid://shopify/InventoryLevel/138761765153?inventory_item_id=52347780628769"
}

and its response:

{
    "data": {
        "inventoryLevel": {
            "id": "gid://shopify/InventoryLevel/138761765153?inventory_item_id=52347780628769",
            "quantities": [
                {
                    "id": "gid://shopify/InventoryQuantity/138761765153?inventory_item_id=52347780628769&name=committed",
                    "quantity": 13,
                    "name": "committed",
                    "activeLedgerDocuments": {
                        "nodes": [
                            {
                                "documentUri": "gid://shopify/Order/6431070126369",
                                "quantity": 1,
                                "displayName": "#62744",
                                "__typename": "InventoryActiveLedgerDocument"
                            },
                            {
                                "documentUri": "gid://shopify/Order/6430229561633",
                                "quantity": 1,
                                "displayName": "#62503",
                                "__typename": "InventoryActiveLedgerDocument"
                            },
                            {
                                "documentUri": "gid://shopify/Order/6429867671841",
                                "quantity": 1,
                                "displayName": "#62377",
                                "__typename": "InventoryActiveLedgerDocument"
                            },
                            {
                                "documentUri": "gid://shopify/Order/6428611903777",
                                "quantity": 1,
                                "displayName": "#62072",
                                "__typename": "InventoryActiveLedgerDocument"
                            },
                            {
                                "documentUri": "gid://shopify/Order/6379796267297",
                                "quantity": 1,
                                "displayName": "#45919",
                                "__typename": "InventoryActiveLedgerDocument"
                            },
                            {
                                "documentUri": "gid://shopify/Order/6379400757537",
                                "quantity": 1,
                                "displayName": "#45848",
                                "__typename": "InventoryActiveLedgerDocument"
                            },
                            {
                                "documentUri": "gid://shopify/Order/6378643652897",
                                "quantity": 1,
                                "displayName": "#45685",
                                "__typename": "InventoryActiveLedgerDocument"
                            },
                            {
                                "documentUri": "gid://shopify/Order/6378158391585",
                                "quantity": 1,
                                "displayName": "#45612",
                                "__typename": "InventoryActiveLedgerDocument"
                            },
                            {
                                "documentUri": "gid://shopify/Order/6377548808481",
                                "quantity": 2,
                                "displayName": "#45469",
                                "__typename": "InventoryActiveLedgerDocument"
                            },
                            {
                                "documentUri": "gid://shopify/Order/6377507651873",
                                "quantity": 1,
                                "displayName": "#45467",
                                "__typename": "InventoryActiveLedgerDocument"
                            },
                            {
                                "documentUri": "gid://shopify/Order/6375849623841",
                                "quantity": 1,
                                "displayName": "#45135",
                                "__typename": "InventoryActiveLedgerDocument"
                            },
                            {
                                "documentUri": "gid://shopify/Order/6375437664545",
                                "quantity": 1,
                                "displayName": "#45082",
                                "__typename": "InventoryActiveLedgerDocument"
                            }
                        ],
                        "__typename": "InventoryActiveLedgerDocumentConnection"
                    },
                    "__typename": "InventoryQuantity"
                }
            ],
            "__typename": "InventoryLevel"
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 10,
            "actualQueryCost": 8,
            "throttleStatus": {
                "maximumAvailable": 40000.0,
                "currentlyAvailable": 39992,
                "restoreRate": 2000.0
            }
        }
    }
}

but the activeLedgerDocuments which shows the breakdown of quantity committed by order is not available on the public api: inventoryLevel - GraphQL Admin

1 Like

Hey @Andrew_Jaanuu, just reading over your post. Would the on_hand state work better for your scnario? This total represents all inventory not yet shipped across the different states, so it should reflect the total number you would expect to have on hand in your warehouse at that point in time.

If you do need the orders associated with specific inventory states, you can use an orders query with filters to return the orders with those items that haven’t been fulfilled.

on_hand won’t work because that quantity from the warehouse that we try to match what’ on shopify includes other unavailable inventory in addition to inventory reserved for orders together with available inventory.

Thanks for clarifying that. In this case, currently the orders query would be how you can get the specific order details.

how can I make the order query to return the orders associated with specific inventory states being equivalent to the CommittedInventoryPopoverQuery above?

Here’s an example of query fields that would return orders that contain a specific sku that should match the committed inventory.

query: "fulfillment_status:unfulfilled AND status:open AND sku:16615192"

While you’re testing this, I recommend adding in the syntax debugging headers to help verify the queries are being parsed as intended.