Access stock count/inventory audit sessions and their line items.
StockCount — Returns a single stock count by id
StockCount — Returns a single stock count by idExample Query:
query GetStockCount($id: ID!) {
StockCount(id: $id) {
id
label
status
dated_at
notes
valuation_diff
location { id label }
stock_count_line_items {
paginatorInfo { total }
data { id new_on_hand }
}
}
}StockCounts — Returns a paginated list of stock counts with sorting and filters
StockCounts — Returns a paginated list of stock counts with sorting and filtersExample Query:
query StockCounts(
$where: QueryStockCountsWhereWhereConditions,
$orderBy: [QueryStockCountsOrderByOrderByClause!],
$first: Int,
$page: Int
) {
StockCounts(
where: $where,
orderBy: $orderBy,
first: $first,
page: $page
) {
paginatorInfo {
total
currentPage
}
data {
id
label
status
dated_at
}
}
}StockCountBarcodeMatches — Looks up line items by barcode in a stock count
StockCountBarcodeMatches — Looks up line items by barcode in a stock countquery StockCountBarcodeMatches($id: ID!, $barcode: String!) {
StockCountBarcodeMatches(id: $id, barcode: $barcode) {
id
stock_count_id
variant_id
batch_number_id
new_on_hand
variant { id label sku }
}
}Arguments:
Available fields
| Field | Type | Description |
|---|---|---|
id | Int | Unique identifier. |
label | String | Stock count label or reference number. |
status | StockCountStatus | Current status. |
dated_at | Date | Document date. |
notes | String | Notes. |
valuation_diff | Float | Total difference in stock valuation. |
location | Location | Warehouse where the count occurs. |
stock_count_line_items | [StockCountLineItem] | Items counted. |
Filters
The following fields can be used in the where parameter:
id, label, status.
Example Filters:
| Field | Example |
|---|---|
id | { "column": "ID", "operator": "EQ", "value": 200050 } |
label | { "column": "LABEL", "operator": "LIKE", "value": "%SC-2025%" } |
status | { "column": "STATUS", "operator": "EQ", "value": "in_progress" } |
Sorting
You can sort results using the orderBy parameter:
idlabelstatuscreated_atupdated_atdated_atlocation_label
StockCountLineItem — Returns a single stock count line item by id
StockCountLineItem — Returns a single stock count line item by idExample Query:
query GetStockCountLineItem($id: ID!) {
StockCountLineItem(id: $id) {
id
stock_count_id
variant_id
batch_number_id
stock_count {
id
label
status
}
variant {
id
label
sku
}
batch_number {
id
label
}
bin_location
new_on_hand
on_hand
variance
updated_at
}
}| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier. |
stock_count_id | ID | ID of the parent stock count. |
variant_id | ID | ID of the product variant. |
batch_number_id | ID | ID of the batch number (if applicable). |
stock_count | StockCount | Parent stock count relationship. |
variant | Variant | Product variant relationship. |
batch_number | BatchNumber | Batch number relationship. |
bin_location | String | Bin location within the location. |
new_on_hand | Float | New counted quantity. |
on_hand | Float | Current system quantity. |
variance | Float | Difference between counted and system quantity. |
updated_at | DateTime | Last update timestamp. |
Data Types
StockCountSerialNumberLineItem
StockCountSerialNumberLineItemEnums
StockCountStatus
StockCountStatus| Value | Description |
|---|---|
in_progress | Count is currently in progress. |
stock_update_in_progress | Stock is being updated based on the count. |
completed | Stock update finished and count is completed. |
cancelled | Document voided. |
