Batch numbers are the lots of a product variant, tracked with their expiry dates and the associated stock.
GraphQL
query {
BatchNumber (id: 100012) {
id
label
barcode
expiry_date
}
}
GraphQL
query {
BatchNumbers {
data {
id
label
barcode
}
}
}
id Unique identifier of the Batch
barcode Barcode of the batch
expiry_date Date when the batch is expiring
variant_sku Sku of the variant of the batch
variant_label Label of the variant of the batch
variant_type Type of the variant of the batch (normal, kit, ...)
variant Variant of the batch
stock_levels Stock levels of the batch on the locations
You can create filters based on following fields
label Example: { "column" : "LABEL", "operator" : "LIKE", "value" : "%011%" }
barcode Example: { "column" : "BARCODE", "operator" : "LIKE", "value" : "111212887%" }
variant_sku Example: { "column" : "VARIANT\_SKU", "operator" : "LIKE", "value" : "DE889%" }
Variant_id Example: { "column": "VARIANT\_ID", "operator": "EQ", "value": 1000001 }
expiry_date Example: { "column": "EXPIRY\_DATE", "operator": "GT", "value": "2023-12-01" }
You can sort data based on following fields : id, label, barcode, expiry_date, variant_sku, variant_id
GraphQL
query BatchNumbers(
$orderBy: [QueryBatchNumbersOrderByOrderByClause!],
$first: Int = 50,
$page: Int
) {
BatchNumbers(
orderBy: $orderBy
first: $first
page: $page
) {
paginatorInfo {
total
}
data {
id
sku
barcode
label
expiry_date
}
}
}
JSON
{
"orderBy": [
{
"column": "EXPIRY_DATE",
"order": "ASC"
}
],
"first": 50,
"page": 1
}