Queries

Stock levels are the current inventory quantities and valuations of each variant per location.

Available queries

StockLevels - Returns a list of stock levels based on the filter define

query {
  StockLevels {
    data {
      id
      location {
        id
        label
      }
      variant {
        id
        label
        sku
      }
      on_hand
      available
      incoming
      reserved
      reorder_point
      bin_location
      to_reorder
      last_sold_date
    }
  }
}


Available fields

StockLevel data type

id
Id of the stock level
variant
Variant concerned
location
Location
on_hand
On hand quantity
available
Available quantity
incoming
Incoming quantity
reserved
Reserved quantity
reorder_point
Re-order point
bin location
Bin location
to_reorder
Quantity to re-order
last_sold_date
Date of the last variant sold for the location
on_hand_aggregate
Aggregated on hand quantity across the selected stock levels
available_aggregate
Aggregated available quantity across the selected stock levels
incoming_aggregate
Aggregated incoming quantity across the selected stock levels
reserved_aggregate
Aggregated reserved quantity across the selected stock levels
valuation
Valuation history of the stock level


Filters

You can create filters based on following fields

id
Example: {"column": "ID", "operator": "EQ", "value": 200050}
on_hand
Example: {"column": "ON_HAND", "operator": "EQ", "value": 10}
available
Example: {"column": "AVAILABLE", "operator": "EQ", "value": 8}
incoming
Example: {"column": "INCOMING", "operator": "EQ", "value": 2}
bin_location
Example: {"column": "BIN_LOCATION", "operator": "EQ", "value": "A1"}
reorder_point
Example: {"column": "REORDER_POINT", "operator": "EQ", "value": 5}
reserved
Example: {"column": "RESERVED", "operator": "EQ", "value": 1}
to_reorder
Example: {"column": "TO_REORDER", "operator": "EQ", "value": 2}
last_sold_date
Example: {"column": "LAST_SOLD_DATE", "operator": "EQ", "value": "2023-03-03"}
location_id
Example: {"column": "LOCATION_ID", "operator": "EQ", "value": 100001}
location_active
Example: {"column": "LOCATION_ACTIVE", "operator": "EQ", "value": true}
location_deleted_at
Example: {"column": "LOCATION_DELETED_AT", "operator": "EQ", "value": null}
variant_id
Example: {"column": "VARIANT_ID", "operator": "EQ", "value": 100012}
variant_label
Example: {"column": "VARIANT_LABEL", "operator": "LIKE", "value": "%Jacket%"}
variant_sku
Example: {"column": "VARIANT_SKU", "operator": "EQ", "value": "135267U23"}
variant_active
Example: {"column": "VARIANT_ACTIVE", "operator": "EQ", "value": true}
variant_type
Example: {"column": "VARIANT_TYPE", "operator": "EQ", "value": "standard"}
supplier_id
Example: {"column": "SUPPLIER_ID", "operator": "EQ", "value": 300001}

Sorting

You can sort data based on following fields: id, on_hand, available, incoming, reorder_point, bin_location, to_reorder, reserved, last_sold_date, location_id, location_label, variant_id, variant_sku, variant_label, variant_active



InventoryLog data type

id
Unique identifier of the inventory log
location
Location concerned by the inventory log
line_item
Line item that triggered the inventory log
sku
SKU of the variant concerned
arguments
Arguments of the inventory log operation
variant
Variant concerned
user
User who performed the inventory log operation
on_hand
On hand quantity after the operation
available
Available quantity after the operation
incoming
Incoming quantity after the operation
on_hand_diff
Difference of on hand quantity
available_diff
Difference of available quantity
incoming_diff
Difference of incoming quantity
cost
Unit cost of the variant at the time of the operation
valuation
Valuation difference of the operation
type
Type of the inventory log operation (sale, purchase, adjustment, ...)
created_at
Date of the inventory log
dated_at
Business date of the inventory log
source
Source of the inventory log (document, stock adjustment, ...)
context
Context of the operation (linked document, order type, ...)
variant_sku
SKU of the variant
variant_label
Label of the variant
variant_type
Type of the variant
batch_number_id
ID of the batch number, if applicable
batch_number_label
Label of the batch number, if applicable
has_batch_numbers
If true, the variant uses batch numbers
batch_number_inventory_logs
Batch number inventory logs linked to this inventory log