GraphQL
query GetBatchNumberStockLevel($id: ID) {
BatchNumberStockLevel(id: $id) {
id
on_hand
variant { id }
location { id }
batch_number { id }
}
}
GraphQL
query BatchNumberStockLevels(
$groupBy: QueryBatchNumberStockLevelsGroupByGroupByClause,
$where: QueryBatchNumberStockLevelsWhereWhereConditions,
$orderBy: [QueryBatchNumberStockLevelsOrderByOrderByClause!]
) {
BatchNumberStockLevels(
groupBy: $groupBy
where: $where
orderBy: $orderBy
) {
id
on_hand
variant { id }
location { id }
batch_number { id }
}
}
JSON
{
"groupBy": {
"HAVING": [
{ "column": "ID", "value": 100012 }
]
},
"where": {
"AND": [
{ "column": "BATCH_NUMBER_ID", "operator": "EQ", "value": 100010 }
]
},
"orderBy": [
{ "column": "ON_HAND", "order": "DESC" }
]
}
Field Type Description idInt Unique identifier of the batch number stock level. on_handFloat Quantity on hand for this batch number at this location. variantObject Linked variant entity. locationObject Linked location entity. batch_numberObject Linked batch number entity.
You can create filters based on following fields
id - Int Example: { "column": "ID", "operator": "EQ", "value": 100012 }
on_hand - Float Example: { "column": "ON_HAND", "operator": "GT", "value": 50 }
variant_id - ID Example: { "column": "VARIANT_ID", "operator": "EQ", "value": 100076 }
location_id - ID Example: { "column": "LOCATION_ID", "operator": "EQ", "value": 100245 }
batch_number_id - ID Example: { "column": "BATCH_NUMBER_ID", "operator": "EQ", "value": 100010 }
batch_number_label - String Example: { "column": "BATCH_NUMBER_LABEL", "operator": "LIKE", "value": "%BATCH%" }
batch_number_deleted_at - DateTime Example: { "column": "BATCH_NUMBER_DELETED_AT", "operator": "IS_NULL", "value": null }
You can sort data based on following fields: id, on_hand, variant_id, location_id, batch_number_id, expiry_date
GraphQL
query SortBatchNumberStockLevels(
$where: QueryBatchNumberStockLevelsWhereWhereConditions
) {
BatchNumberStockLevels(
where: $where
orderBy: [{ column: ON_HAND, order: DESC }]
) {
id
on_hand
variant { id }
location { id }
batch_number { id }
}
}
JSON
{
"data": {
"BatchNumberStockLevels": [
{
"id": 100001,
"on_hand": 150.5,
"variant": { "id": 100076 },
"location": { "id": 100245 },
"batch_number": { "id": 100010 }
},
{
"id": 100002,
"on_hand": 75.0,
"variant": { "id": 100077 },
"location": { "id": 100246 },
"batch_number": { "id": 100011 }
}
]
}
}