View current inventory quantities, valuations, and reorder thresholds by location.
StockLevels — Returns a paginated list of stock levels with sorting and filters
StockLevels — Returns a paginated list of stock levels with sorting and filtersNote: Querying a single StockLevel by ID is not publicly supported. Use this query to retrieve inventory levels.
Example Query:
query StockLevels(
$where: QueryStockLevelsWhereWhereConditions,
$orderBy: [QueryStockLevelsOrderByOrderByClause!],
$first: Int,
$page: Int
) {
StockLevels(
where: $where,
orderBy: $orderBy,
first: $first,
page: $page
) {
paginatorInfo {
total
currentPage
}
data {
id
on_hand
available
incoming
reserved
reorder_point
bin_location
to_reorder
location { id label }
variant { id label sku }
}
}
}StockLevel — Returns a single stock level by id
StockLevel — Returns a single stock level by idExample Query:
query GetStockLevel($id: ID!) {
StockLevel(id: $id) {
id
on_hand
available
incoming
reserved
bin_location
location { id label }
variant { id label sku }
}
}Available fields
| Field | Type | Description |
|---|---|---|
id | Int | Unique identifier. |
on_hand | Float | Physical quantity on hand. |
available | Float | Quantity available for sale (on_hand - reserved). |
incoming | Float | Quantity ordered from suppliers (e.g. Purchase Orders). |
reserved | Float | Quantity reserved in active documents (e.g. Sales Orders). |
reorder_point | Float | Reorder point configured for this location/variant. |
bin_location | String | Bin location. |
to_reorder | Float | Calculated quantity to reorder. |
location | Location | Associated location/warehouse. |
variant | Variant | Associated product variant. |
on_hand_aggregate | Float | Total on hand across all filtered levels. |
available_aggregate | Float | Total available across all filtered levels. |
incoming_aggregate | Float | Total incoming across all filtered levels. |
reserved_aggregate | Float | Total reserved across all filtered levels. |
valuation | ValuationHistory | Current valuation of the stock level. |
last_sold_date | String | Date of last sale. |
Filters
The following fields can be used in the where parameter:
id, on_hand, available, incoming, bin_location, reorder_point, reserved, to_reorder, last_sold_date, location_id, location_active, location_type, variant_id, variant_label, variant_sku, variant_active, variant_type, supplier_id.
Example Filters:
| Field | Example |
|---|---|
id | { "column": "ID", "operator": "EQ", "value": 200050 } |
location_id | { "column": "LOCATION_ID", "operator": "EQ", "value": 100 } |
variant_id | { "column": "VARIANT_ID", "operator": "EQ", "value": 5001 } |
variant_sku | { "column": "VARIANT_SKU", "operator": "EQ", "value": "SKU-RED" } |
on_hand | { "column": "ON_HAND", "operator": "GT", "value": 0 } |
available | { "column": "AVAILABLE", "operator": "LT", "value": 10 } |
bin_location | { "column": "BIN_LOCATION", "operator": "LIKE", "value": "%A1%" } |
supplier_id | { "column": "SUPPLIER_ID", "operator": "EXISTS", "value": 3001 } |
Sorting
You can sort results using the orderBy parameter:
idon_handavailableincomingreorder_pointbin_locationto_reorderreservedlast_sold_datelocation_idlocation_labellocation_typevariant_idvariant_skuvariant_labelvariant_active
Data Types
InventoryLog
InventoryLog| Field | Type | Description |
|---|---|---|
id | Int | Log entry ID. |
location | Location | Associated location. |
line_item | LineItem | Associated line item. |
sku | String | Variant SKU. |
arguments | String | Log arguments/details. |
variant | Variant | Associated variant. |
user | User | User who performed the action. |
on_hand | Float | Stock on hand after change. |
available | Float | Available stock after change. |
incoming | Float | Incoming stock after change. |
on_hand_diff | Float | Change in on-hand quantity. |
available_diff | Float | Change in available quantity. |
incoming_diff | Float | Change in incoming quantity. |
cost | Float | Unit cost at time of change. |
valuation | Float | Total valuation at time of change. |
type | String | Type of inventory change. |
created_at | DateTime | Timestamp of the log entry. |
dated_at | String | Date of the inventory change. |
timeline_at | String | Timeline date. |
source | String | Source of the change (e.g., "sale", "purchase"). |
document_id | Int | Related document ID. |
order_type | String | Order type. |
context | String | Context of the change. |
variant_sku | String | Variant SKU (enhanced field). |
variant_label | String | Variant label (enhanced field). |
variant_type | String | Variant type (enhanced field). |
batch_number_id | Int | Batch number ID. |
batch_number_label | String | Batch number label. |
has_batch_numbers | Boolean | Whether this log has batch numbers. |
batch_number_inventory_logs | [BatchNumberInventoryLog] | Batch number details. |
Grouping Options
You can group results using the groupBy parameter for reports:
| Field | Description |
|---|---|
variant_id | Group by internal variant ID. |
Data Types
BatchNumberStockLevelInput
BatchNumberStockLevelInput| Field | Type | Description |
|---|---|---|
id | ID | Stock level ID (for updates). |
quantity | Float | Quantity to allocate. |
variant | VariantInput | Variant details. |
location | LocationInput | Location details. |
batch_number | BatchNumberInput | Batch number details. |
StockCountLineItemInput
StockCountLineItemInput| Field | Type | Description |
|---|---|---|
id | ID | Line item ID (for updates). |
variant | VariantInput | Variant details. |
batch_number | BatchNumberInput | Batch number details. |
new_on_hand | Float | New on-hand quantity after count. |
on_hand | Float | Original on-hand quantity. |
AutoAllocateTraceabilityResult
AutoAllocateTraceabilityResult| Field | Type | Description |
|---|---|---|
batch_numbers | [AutoAllocatedBatchNumberLineItem] | Allocated batch numbers. |
serial_numbers | [SerialNumber] | Allocated serial numbers. |
AutoAllocatedBatchNumberLineItem
AutoAllocatedBatchNumberLineItem| Field | Type | Description |
|---|---|---|
quantity | Float | Quantity allocated to this batch. |
batch_number | BatchNumber | Associated batch number. |
serial_numbers | [SerialNumber] | Serial numbers for this batch. |
