Access batch/lot numbers, expiry dates, and associated stock levels.
BatchNumber — Returns a single batch number by id or barcode
BatchNumber — Returns a single batch number by id or barcodeExample Query:
query GetBatchNumber($id: ID!) {
BatchNumber(id: $id) {
id
label
barcode
expiry_date
variant_sku
variant_label
variant { id label }
stock_levels {
paginatorInfo { total }
data { id on_hand }
}
}
}Example Result:
{
"data": {
"BatchNumber": {
"id": 10001,
"label": "BATCH-A001",
"barcode": "1234567890",
"expiry_date": "2026-12-31",
"variant_sku": "PRD-001",
"variant_label": "Awesome Product",
"variant": { "id": 5001, "label": "Awesome Product" }
}
}
}BatchNumbers — Returns a list of batch numbers with sorting and filters
BatchNumbers — Returns a list of batch numbers with sorting and filtersExample Query:
query BatchNumbers(
$where: QueryBatchNumbersWhereWhereConditions,
$orderBy: [QueryBatchNumbersOrderByOrderByClause!],
$first: Int,
$page: Int
) {
BatchNumbers(
where: $where,
orderBy: $orderBy,
first: $first,
page: $page
) {
paginatorInfo {
total
currentPage
}
data {
id
label
barcode
expiry_date
}
}
}Example Variables:
{
"where": {
"AND": [
{ "column": "VARIANT_ID", "operator": "EQ", "value": 5001 }
]
},
"orderBy": [
{ "column": "EXPIRY_DATE", "order": "ASC" }
],
"first": 50,
"page": 1
}Available fields
| Field | Type | Description |
|---|---|---|
id | Int | Unique identifier. |
label | String | Batch/Lot number. |
barcode | String | Associated barcode. |
expiry_date | Date | Expiration date of the batch. |
variant_id | Int | ID of the linked product variant. |
variant_sku | String | SKU of the linked product variant. |
variant_label | String | Name of the linked product variant. |
variant_type | String | Type of the product variant. |
variant | Variant | Associated product variant data. |
stock_levels | [BatchNumberStockLevel] | Stock levels for this batch across locations. |
Filters
| Field | Example |
|---|---|
id | { "column": "ID", "operator": "EQ", "value": 10001 } |
label | { "column": "LABEL", "operator": "LIKE", "value": "%BATCH-A%" } |
barcode | { "column": "BARCODE", "operator": "EQ", "value": "1234567890" } |
expiry_date | { "column": "EXPIRY_DATE", "operator": "LT", "value": "2026-01-01" } |
variant_id | { "column": "VARIANT_ID", "operator": "EQ", "value": 5001 } |
variant_sku | { "column": "VARIANT_SKU", "operator": "LIKE", "value": "PRD-%" } |
