Queries

Stock counts are the physical inventory audit sessions and their line items.

Available queries

StockCount - Returns a single stock count based on the id provided

query {
  StockCount(id: 200050) {
    id
    label
    status
    dated_at
    notes
    valuation_diff
    location {
      id
      label
    }
    stock_count_line_items {
      paginatorInfo {
        total
      }
      data {
        id
        new_on_hand
        on_hand
        variance
      }
    }
  }
}

StockCounts - Returns a list of stock counts based on the filter define

query {
  StockCounts {
    data {
      id
      label
      status
      dated_at
    }
  }
}

StockCountLineItem - Returns a single stock count line item based on the id provided

query {
  StockCountLineItem(id: 200100) {
    id
    stock_count {
      id
      label
    }
    variant {
      id
      label
      sku
    }
    batch_number {
      id
      label
    }
    bin_location
    new_on_hand
    on_hand
    variance
    updated_at
  }
}

StockCountLineItems - Returns a list of stock count line items based on the filter define

query {
  StockCountLineItems {
    data {
      id
      stock_count {
        id
        label
      }
      variant {
        id
        label
        sku
      }
      new_on_hand
      on_hand
      variance
    }
  }
}


Available fields

StockCount data type

id
Unique identifier of the stock count
label
Label or reference number of the stock count
status
Status of the stock count (in_progress, completed, cancelled)
dated_at
Date of the stock count
notes
Notes attached to the stock count
valuation_diff
Total difference in stock valuation
location
Location/warehouse where the count occurs
stock_count_line_items
Items counted during the stock count

StockCountLineItem data type

id
Unique identifier of the stock count line item
updated_at
Date of the latest update of the line item
batch_number_id
ID of the batch number, if applicable
stock_count
Parent stock count
variant
Product variant counted
batch_number
Batch number counted
bin_location
Bin location within the location
new_on_hand
New counted quantity
on_hand
Current system quantity
variance
Difference between counted and system quantity


Filters

You can create filters based on following fields

StockCounts

id
Example: {"column": "ID", "operator": "EQ", "value": 200050}
label
Example: {"column": "LABEL", "operator": "LIKE", "value": "%SC-2025%"}
status
Example: {"column": "STATUS", "operator": "EQ", "value": "in_progress"}

StockCountLineItems

id
Example: {"column": "ID", "operator": "EQ", "value": 200100}
stock_count_id
Example: {"column": "STOCK_COUNT_ID", "operator": "EQ", "value": 200050}
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_barcode
Example: {"column": "VARIANT_BARCODE", "operator": "EQ", "value": "3760244512345"}
batch_number_id
Example: {"column": "BATCH_NUMBER_ID", "operator": "EQ", "value": 300050}
batch_number_label
Example: {"column": "BATCH_NUMBER_LABEL", "operator": "LIKE", "value": "%LOT-2025%"}

Sorting

You can sort data based on following fields:

StockCounts

  • id, label, status, created_at, updated_at

StockCountLineItems

  • id, label, updated_at