query GetBatchNumberStockLevel($id: ID) {
BatchNumberStockLevel(id: $id) {
id
on_hand
variant { id }
location { id }
batch_number { id }
}
}
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 }
}
}
{
"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 |
|---|
id | Int | Unique identifier of the batch number stock level. |
on_hand | Float | Quantity on hand for this batch number at this location. |
variant | Object | Linked variant entity. |
location | Object | Linked location entity. |
batch_number | Object | 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
query SortBatchNumberStockLevels(
$where: QueryBatchNumberStockLevelsWhereWhereConditions
) {
BatchNumberStockLevels(
where: $where
orderBy: [{ column: ON_HAND, order: DESC }]
) {
id
on_hand
variant { id }
location { id }
batch_number { id }
}
}
{
"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 }
}
]
}
}