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